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..a5d1d691308f45690e36cc46b9b112c67469ba12 100644 |
--- a/chrome/browser/ui/webui/options/options_browsertest.js |
+++ b/chrome/browser/ui/webui/options/options_browsertest.js |
@@ -22,38 +22,27 @@ 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); |
+ // 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; |
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); |
}, |
}; |