Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: remoting/webapp/browser_test/bump_scroll_browser_test.js

Issue 1086563005: [Chromoting] Use MockConnection for bump scrolling browser test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@IncludeBTinWebapp
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/remoting_test.gypi ('k') | remoting/webapp/crd/js/mock_client_plugin.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/browser_test/bump_scroll_browser_test.js
diff --git a/remoting/webapp/browser_test/bump_scroll_browser_test.js b/remoting/webapp/browser_test/bump_scroll_browser_test.js
index a90d5b17711a488258a58321df9cbf667d979c04..38eea467206034bc741ce7c78cff58ab10af5a71 100644
--- a/remoting/webapp/browser_test/bump_scroll_browser_test.js
+++ b/remoting/webapp/browser_test/bump_scroll_browser_test.js
@@ -84,7 +84,16 @@ browserTest.Bump_Scroll.prototype.run = function(data) {
if (!base.isAppsV2()) {
browserTest.fail(
'Bump-scroll requires full-screen, which can only be activated ' +
- 'programmatically in apps v2.')
+ 'programmatically in apps v2.');
+ }
+
+ var mockConnection = new remoting.MockConnection();
+ mockConnection.plugin().mock$useDefaultBehavior(
+ remoting.MockClientPlugin.AuthMethod.PIN);
+
+ function cleanup() {
+ mockConnection.restore();
+ browserTest.disconnect();
}
this.testVerifyScroll().then(function() {
@@ -109,11 +118,11 @@ browserTest.Bump_Scroll.prototype.run = function(data) {
this.scrollDirection.bind(this, 0.5, 0.0) // Top edge
).then(
function(value) {
- browserTest.disconnect();
+ cleanup();
return browserTest.pass(value);
},
function(error) {
- browserTest.disconnect();
+ cleanup();
return browserTest.fail(error);
}
);
« no previous file with comments | « remoting/remoting_test.gypi ('k') | remoting/webapp/crd/js/mock_client_plugin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698