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

Unified Diff: chrome/browser/ui/webui/options/options_browsertest.js

Issue 8503003: Seed test for SyncUI: sign in successfully with mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use makeAndRegisterMockHandler in new ChromeSendWebUITest. Created 9 years, 1 month 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 | « chrome/browser/resources/sync_setup_overlay.js ('k') | chrome/browser/ui/webui/sync_setup_browsertest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/options_browsertest.js
diff --git a/chrome/browser/ui/webui/options/options_browsertest.js b/chrome/browser/ui/webui/options/options_browsertest.js
index a97331c6f4bd8f4690c3d01cd82c8e6cef7ca7bc..92cd99b39adf0e869fb97c73399d5f0699d7f079 100644
--- a/chrome/browser/ui/webui/options/options_browsertest.js
+++ b/chrome/browser/ui/webui/options/options_browsertest.js
@@ -22,38 +22,26 @@ OptionsWebUITest.prototype = {
* behave correctly.
*/
preLoad: function() {
+ this.makeAndRegisterMockHandler(
+ ['coreOptionsInitialize',
+ 'fetchPrefs',
+ 'observePrefs',
+ 'setBooleanPref',
+ 'setIntegerPref',
+ 'setDoublePref',
+ 'setStringPref',
+ 'setObjectPref',
+ 'clearPref',
+ 'coreOptionsUserMetricsAction',
+ // TODO(scr): Handle this new message:
+ // getInstantFieldTrialStatus: function() {},
+ ]);
- /**
- * Create handler class with empty methods to allow mocking to register
- * expectations and for registration of handlers with chrome.send.
- */
- function MockOptionsHandler() {}
-
- MockOptionsHandler.prototype = {
- coreOptionsInitialize: function() {},
- fetchPrefs: function() {},
- observePrefs: function() {},
- setBooleanPref: function() {},
- setIntegerPref: function() {},
- setDoublePref: function() {},
- setStringPref: function() {},
- setObjectPref: function() {},
- clearPref: function() {},
- coreOptionsUserMetricsAction: function() {},
- // TODO(scr): Handle this new message:
- // getInstantFieldTrialStatus: function() {},
- };
-
- // Create the actual mock and register stubs for methods expected to be
- // called before our tests run. Specific expectations can be made in the
- // tests themselves.
- var mockHandler = this.mockHandler = mock(MockOptionsHandler);
- mockHandler.stubs().fetchPrefs(ANYTHING);
- mockHandler.stubs().observePrefs(ANYTHING);
- mockHandler.stubs().coreOptionsInitialize();
-
- // Register our mock as a handler of the chrome.send messages.
- registerMockMessageCallbacks(mockHandler, MockOptionsHandler);
+ // Register stubs for methods expected to be called before our tests run.
+ // Specific expectations can be made in the tests themselves.
+ this.mockHandler.stubs().fetchPrefs(ANYTHING);
+ this.mockHandler.stubs().observePrefs(ANYTHING);
+ this.mockHandler.stubs().coreOptionsInitialize();
},
};
« no previous file with comments | « chrome/browser/resources/sync_setup_overlay.js ('k') | chrome/browser/ui/webui/sync_setup_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698