summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkelvinp <kelvinp@chromium.org>2015-02-25 10:43:06 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-25 18:43:40 +0000
commit1ef617bbcc2ebfc22415a08aadf6df52eb3a0405 (patch)
tree0faecd142717c579d2b756ef64ed8cb58a14d1aa
parente2d2b8ec967d92754b97942dbb20685b318bf8d9 (diff)
downloadchromium_src-1ef617bbcc2ebfc22415a08aadf6df52eb3a0405.zip
chromium_src-1ef617bbcc2ebfc22415a08aadf6df52eb3a0405.tar.gz
chromium_src-1ef617bbcc2ebfc22415a08aadf6df52eb3a0405.tar.bz2
Enables bump scrolling browser test on the Chromoting Waterfall.
This CL enables bump scrolling browser test on the Chromoting Waterfall. It also fixes the test logic of retrieving the plugin position for testing. BUG=461538 TEST=New test passed in Chromoting waterfall https://chromium-swarm.appspot.com/user/task/25d71d39de843110 Review URL: https://codereview.chromium.org/951773005 Cr-Commit-Position: refs/heads/master@{#318081}
-rw-r--r--remoting/webapp/browser_test/bump_scroll_browser_test.js26
-rw-r--r--remoting/webapp/crd/js/desktop_viewport.js13
-rw-r--r--testing/chromoting/browser_test_commands_linux.txt3
3 files changed, 34 insertions, 8 deletions
diff --git a/remoting/webapp/browser_test/bump_scroll_browser_test.js b/remoting/webapp/browser_test/bump_scroll_browser_test.js
index 76b5211..f8dc7cc 100644
--- a/remoting/webapp/browser_test/bump_scroll_browser_test.js
+++ b/remoting/webapp/browser_test/bump_scroll_browser_test.js
@@ -119,7 +119,7 @@ browserTest.Bump_Scroll.prototype.noScrollWindowed = function() {
window.innerWidth + this.kHostDesktopSizeDelta,
window.innerHeight + this.kHostDesktopSizeDelta);
this.moveMouseTo(0, 0);
- return this.verifyScroll(undefined, undefined);
+ return this.verifyNoScroll();
};
/**
@@ -131,7 +131,7 @@ browserTest.Bump_Scroll.prototype.noScrollSmaller = function() {
window.innerWidth - this.kHostDesktopSizeDelta,
window.innerHeight - this.kHostDesktopSizeDelta);
this.moveMouseTo(0, 0);
- return this.verifyScroll(undefined, undefined);
+ return this.verifyNoScroll();
};
/**
@@ -217,13 +217,13 @@ browserTest.Bump_Scroll.prototype.testVerifyScroll = function() {
var that = this;
// No events raised (e.g. windowed mode).
- var result = this.verifyScroll(undefined, undefined, fakeViewport)
+ var result = this.verifyNoScroll(fakeViewport)
.then(function() {
// Start and end events raised, but no scrolling (e.g. full-screen mode
// with host desktop <= window size).
fakeViewport = new browserTest.FakeDesktopViewport;
- var result = that.verifyScroll(undefined, undefined, fakeViewport);
+ var result = that.verifyNoScroll(fakeViewport);
fakeViewport.raiseEvent(STARTED, {});
fakeViewport.raiseEvent(STOPPED, {});
return result;
@@ -320,3 +320,21 @@ browserTest.Bump_Scroll.prototype.verifyScroll =
return verifyPluginPosition();
});
};
+
+/**
+ * @param {browserTest.FakeDesktopViewport=} opt_desktopViewport
+ * DesktopViewport fake, for testing.
+ *
+ * @return {Promise<boolean>} A promise that resolves to true if no scrolling
+ * occurs within a timeout.
+ */
+browserTest.Bump_Scroll.prototype.verifyNoScroll =
+ function(opt_desktopViewport) {
+ var desktopViewport = opt_desktopViewport ||
+ remoting.desktopConnectedView.getViewportForTesting();
+ var bumpScroller = desktopViewport.getBumpScrollerForTesting();
+ if (!bumpScroller) {
+ Promise.resolve(true);
+ }
+ return this.verifyScroll(undefined, undefined, desktopViewport);
+}; \ No newline at end of file
diff --git a/remoting/webapp/crd/js/desktop_viewport.js b/remoting/webapp/crd/js/desktop_viewport.js
index 1c9082d..02c9a521 100644
--- a/remoting/webapp/crd/js/desktop_viewport.js
+++ b/remoting/webapp/crd/js/desktop_viewport.js
@@ -92,10 +92,17 @@ remoting.DesktopViewport.prototype.getResizeToClient = function() {
* @return {{top:number, left:number}} The top-left corner of the plugin.
*/
remoting.DesktopViewport.prototype.getPluginPositionForTesting = function() {
- var style = this.pluginContainer_.style;
+ /**
+ * @param {number|string} value
+ * @return {number}
+ */
+ function toFloat(value) {
+ var number = parseFloat(value);
+ return isNaN(number) ? 0 : number;
+ }
return {
- top: parseFloat(style.marginTop),
- left: parseFloat(style.marginLeft)
+ top: toFloat(this.pluginContainer_.style.marginTop),
+ left: toFloat(this.pluginContainer_.style.marginLeft)
};
};
diff --git a/testing/chromoting/browser_test_commands_linux.txt b/testing/chromoting/browser_test_commands_linux.txt
index 7d69040..659e4b6 100644
--- a/testing/chromoting/browser_test_commands_linux.txt
+++ b/testing/chromoting/browser_test_commands_linux.txt
@@ -11,4 +11,5 @@
/usr/bin/python ../xvfb.py #PROD_DIR# #PROD_DIR#/browser_tests --gtest_filter=It2MeBrowserTest.MANUAL_InvalidAccessCode --run-manual --ui-test-action-timeout=100000 --webapp-unpacked=#PROD_DIR#/remoting/remoting.webapp --extension-name=Chromoting --accounts-file=../../remoting/tools/internal/test_accounts.json --account-type=gmail --override-user-data-dir=/tmp/chromoting_test_profile
/usr/bin/python ../xvfb.py #PROD_DIR# #PROD_DIR#/browser_tests --gtest_filter=RemoteDesktopBrowserTest.MANUAL_Cancel_PIN --run-manual --ui-test-action-timeout=100000 --webapp-unpacked=#PROD_DIR#/remoting/remoting.webapp.v2 --extension-name=Chromoting --accounts-file=../../remoting/tools/internal/test_accounts.json --account-type=gmail --me2me-pin=123456 --override-user-data-dir=/tmp/chromoting_test_profile
/usr/bin/python ../xvfb.py #PROD_DIR# #PROD_DIR#/browser_tests --gtest_filter=RemoteDesktopBrowserTest.MANUAL_Update_PIN --run-manual --ui-test-action-timeout=100000 --webapp-unpacked=#PROD_DIR#/remoting/remoting.webapp.v2 --extension-name=Chromoting --accounts-file=../../remoting/tools/internal/test_accounts.json --account-type=gmail --me2me-pin=123456 --override-user-data-dir=/tmp/chromoting_test_profile
-/usr/bin/python ../xvfb.py #PROD_DIR# #PROD_DIR#/browser_tests --gtest_filter=RemoteDesktopBrowserTest.MANUAL_Invalid_PIN --run-manual --ui-test-action-timeout=100000 --webapp-unpacked=#PROD_DIR#/remoting/remoting.webapp.v2 --extension-name=Chromoting --accounts-file=../../remoting/tools/internal/test_accounts.json --account-type=gmail --me2me-pin=123457 --override-user-data-dir=/tmp/chromoting_test_profile \ No newline at end of file
+/usr/bin/python ../xvfb.py #PROD_DIR# #PROD_DIR#/browser_tests --gtest_filter=RemoteDesktopBrowserTest.MANUAL_Invalid_PIN --run-manual --ui-test-action-timeout=100000 --webapp-unpacked=#PROD_DIR#/remoting/remoting.webapp.v2 --extension-name=Chromoting --accounts-file=../../remoting/tools/internal/test_accounts.json --account-type=gmail --me2me-pin=123457 --override-user-data-dir=/tmp/chromoting_test_profile
+/usr/bin/python ../xvfb.py #PROD_DIR# #PROD_DIR#/browser_tests --gtest_filter=FullscreenBrowserTest.MANUAL_Me2Me_Bump_Scroll --run-manual --ui-test-action-timeout=100000 --webapp-unpacked=#PROD_DIR#/remoting/remoting.webapp.v2 --extension-name=Chromoting --accounts-file=../../remoting/tools/internal/test_accounts.json --account-type=gmail --me2me-pin=123456 --override-user-data-dir=/tmp/chromoting_test_profile \ No newline at end of file