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

Unified Diff: chrome/browser/ui/webui/options2/options2_browsertest.js

Issue 9560005: [uber page] Merge advanced options page into browser options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebase again. Created 8 years, 10 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
Index: chrome/browser/ui/webui/options2/options2_browsertest.js
===================================================================
--- chrome/browser/ui/webui/options2/options2_browsertest.js (revision 124465)
+++ chrome/browser/ui/webui/options2/options2_browsertest.js (working copy)
@@ -24,6 +24,7 @@
preLoad: function() {
this.makeAndRegisterMockHandler(
['coreOptionsInitialize',
+ 'defaultZoomFactorAction',
'fetchPrefs',
'observePrefs',
'setBooleanPref',
@@ -71,15 +72,9 @@
// Not meant to run on ChromeOS at this time.
// Not finishing in windows. http://crbug.com/81723
-GEN('#if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_WIN)');
-GEN('#define MAYBE_testRefreshStaysOnCurrentPage \\');
-GEN(' DISABLED_testRefreshStaysOnCurrentPage');
-GEN('#else');
-GEN('#define MAYBE_testRefreshStaysOnCurrentPage ' +
- 'testRefreshStaysOnCurrentPage');
-GEN('#endif');
-
-TEST_F('OptionsWebUITest', 'MAYBE_testRefreshStaysOnCurrentPage', function() {
+// TODO(csilv): Redo logic for uber page.
+TEST_F('OptionsWebUITest', 'DISABLED_testRefreshStaysOnCurrentPage',
+ function() {
var item = $('advancedPageNav');
item.onclick();
window.location.reload();
@@ -91,3 +86,25 @@
assertEquals(expectedTitle, actualTitle);
assertEquals(pageInstance, topPage);
});
+
+/**
+ * Test the default zoom factor select element.
+ */
+TEST_F('OptionsWebUITest', 'testDefaultZoomFactor', function() {
+ // The expected minimum length of the |defaultZoomFactor| element.
+ var defaultZoomFactorMinimumLength = 10;
+ // Verify that the zoom factor element exists.
+ var defaultZoomFactor = $('defaultZoomFactor');
+ assertNotEquals(defaultZoomFactor, null);
+
+ // Verify that the zoom factor element has a reasonable number of choices.
+ expectGE(defaultZoomFactor.options.length, defaultZoomFactorMinimumLength);
+
+ // Simulate a change event, selecting the highest zoom value. Verify that
+ // the javascript handler was invoked once.
+ this.mockHandler.expects(once()).defaultZoomFactorAction(NOT_NULL).
+ will(callFunction(function() { }));
+ defaultZoomFactor.selectedIndex = defaultZoomFactor.options.length - 1;
+ var event = { target: defaultZoomFactor };
+ if (defaultZoomFactor.onchange) defaultZoomFactor.onchange(event);
+});

Powered by Google App Engine
This is Rietveld 408576698