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

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

Issue 11232059: Clean up copy&paste in confirmation dialogs for prefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit addressed. Created 8 years, 2 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 | « chrome/browser/resources/options/spelling_confirm_overlay.js ('k') | no next file » | 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 08b4ff4eeac15694302fa742b78b866b4a3b1a85..8a5f1cd4998204b4dca06ccdc9db899de3ffc3d1 100644
--- a/chrome/browser/ui/webui/options/options_browsertest.js
+++ b/chrome/browser/ui/webui/options/options_browsertest.js
@@ -114,10 +114,11 @@ TEST_F('OptionsWebUITest', 'testDefaultZoomFactor', function() {
// interstitial is pressed, otherwise the abort button is pressed.
OptionsWebUITest.prototype.testDoNotTrackInterstitial =
function(confirmInterstitial) {
+ Preferences.prefsFetchedCallback({'enable_do_not_track': {'value': false } });
var buttonToClick = confirmInterstitial ? $('do-not-track-confirm-ok')
: $('do-not-track-confirm-cancel');
var dntCheckbox = $('do-not-track-enabled');
- var dntOverlay = DoNotTrackConfirmOverlay.getInstance();
+ var dntOverlay = OptionsPage.registeredOverlayPages['donottrackconfirm'];
assertFalse(dntCheckbox.checked);
var visibleChangeCounter = 0;
@@ -134,8 +135,7 @@ OptionsWebUITest.prototype.testDoNotTrackInterstitial =
window.setTimeout(function() {
assertFalse(dntOverlay.visible);
assertEquals(confirmInterstitial, dntCheckbox.checked);
- DoNotTrackConfirmOverlay.getInstance().removeEventListener(
- visibleChangeHandler);
+ dntOverlay.removeEventListener(visibleChangeHandler);
testDone();
}, 0);
break;
@@ -143,12 +143,11 @@ OptionsWebUITest.prototype.testDoNotTrackInterstitial =
assertTrue(false);
}
}
- DoNotTrackConfirmOverlay.getInstance().addEventListener('visibleChange',
- visibleChangeHandler);
+ dntOverlay.addEventListener('visibleChange', visibleChangeHandler);
if (confirmInterstitial) {
this.mockHandler.expects(once()).setBooleanPref(
- ["enable_do_not_track", true]);
+ ['enable_do_not_track', true, 'Options_DoNotTrackCheckbox']);
} else {
// The mock handler complains if setBooleanPref is called even though
// it should not be.
@@ -170,8 +169,9 @@ TEST_F('OptionsWebUITest', 'EnableDoNotTrackAndCancelInterstitial',
// Check that the "Do not Track" preference can be correctly disabled.
// In order to do that, we need to enable it first.
TEST_F('OptionsWebUITest', 'EnableAndDisableDoNotTrack', function() {
+ Preferences.prefsFetchedCallback({'enable_do_not_track': {'value': false } });
var dntCheckbox = $('do-not-track-enabled');
- var dntOverlay = DoNotTrackConfirmOverlay.getInstance();
+ var dntOverlay = OptionsPage.registeredOverlayPages['donottrackconfirm'];
assertFalse(dntCheckbox.checked);
var visibleChangeCounter = 0;
@@ -188,8 +188,7 @@ TEST_F('OptionsWebUITest', 'EnableAndDisableDoNotTrack', function() {
window.setTimeout(function() {
assertFalse(dntOverlay.visible);
assertTrue(dntCheckbox.checked);
- DoNotTrackConfirmOverlay.getInstance().removeEventListener(
- visibleChangeHandler);
+ dntOverlay.removeEventListener(visibleChangeHandler);
dntCheckbox.click();
}, 0);
break;
@@ -197,11 +196,10 @@ TEST_F('OptionsWebUITest', 'EnableAndDisableDoNotTrack', function() {
assertNotReached();
}
}
- DoNotTrackConfirmOverlay.getInstance().addEventListener('visibleChange',
- visibleChangeHandler);
+ dntOverlay.addEventListener('visibleChange', visibleChangeHandler);
this.mockHandler.expects(once()).setBooleanPref(
- eq(["enable_do_not_track", true]));
+ eq(["enable_do_not_track", true, 'Options_DoNotTrackCheckbox']));
var verifyCorrectEndState = function() {
window.setTimeout(function() {
« no previous file with comments | « chrome/browser/resources/options/spelling_confirm_overlay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698