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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_browsertest.js

Issue 1608103002: Settings Rewrite: Fix Opening Sync User login (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/settings/people_handler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 GEN('#if !defined(OS_CHROMEOS)'); 5 GEN('#if !defined(OS_CHROMEOS)');
6 6
7 /** 7 /**
8 * Test fixture for sync setup WebUI testing. 8 * Test fixture for sync setup WebUI testing.
9 * @constructor 9 * @constructor
10 * @extends {testing.Test} 10 * @extends {testing.Test}
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 GEN('#if defined(OS_LINUX)'); 85 GEN('#if defined(OS_LINUX)');
86 GEN('#define MAYBE_VerifySignIn DISABLED_VerifySignIn'); 86 GEN('#define MAYBE_VerifySignIn DISABLED_VerifySignIn');
87 GEN('#else'); 87 GEN('#else');
88 GEN('#define MAYBE_VerifySignIn VerifySignIn'); 88 GEN('#define MAYBE_VerifySignIn VerifySignIn');
89 GEN('#endif // defined(OS_LINUX)'); 89 GEN('#endif // defined(OS_LINUX)');
90 TEST_F('SyncSetupWebUITestAsync', 'MAYBE_VerifySignIn', function() { 90 TEST_F('SyncSetupWebUITestAsync', 'MAYBE_VerifySignIn', function() {
91 // Handle SyncSetupStartSignIn by displaying the sync setup dialog, verifying 91 // Handle SyncSetupStartSignIn by displaying the sync setup dialog, verifying
92 // that a confirmation dialog appears, and clicking OK to dismiss the dialog. 92 // that a confirmation dialog appears, and clicking OK to dismiss the dialog.
93 // Note that this test doesn't actually do a gaia sign in. 93 // Note that this test doesn't actually do a gaia sign in.
94 this.mockHandler.expects(once()).SyncSetupStartSignIn( 94 this.mockHandler.expects(once()).SyncSetupStartSignIn(
95 'access-point-settings').will(callFunction(function() { 95 [false] /* createSupervisedUser */).will(callFunction(function() {
96 SyncSetupOverlay.showSyncSetupPage('configure'); 96 SyncSetupOverlay.showSyncSetupPage('configure');
97 var okButton = $('confirm-everything-ok'); 97 var okButton = $('confirm-everything-ok');
98 assertNotEquals(null, okButton); 98 assertNotEquals(null, okButton);
99 okButton.click(); 99 okButton.click();
100 })); 100 }));
101 101
102 // The test completes after the sync config is sent out. 102 // The test completes after the sync config is sent out.
103 this.mockHandler.expects(once()).SyncSetupConfigure(ANYTHING). 103 this.mockHandler.expects(once()).SyncSetupConfigure(ANYTHING).
104 will(callFunction(testDone)); 104 will(callFunction(testDone));
105 105
106 // Click the "Sign in to Chrome..." button. 106 // Click the "Sign in to Chrome..." button.
107 this.startSyncing(); 107 this.startSyncing();
108 }); 108 });
109 109
110 // This test is flaky on Linux bot. See crbug.com/579666 110 // This test is flaky on Linux bot. See crbug.com/579666
111 GEN('#if defined(OS_LINUX)'); 111 GEN('#if defined(OS_LINUX)');
112 GEN('#define MAYBE_RestoreSyncDataTypes DISABLED_RestoreSyncDataTypes'); 112 GEN('#define MAYBE_RestoreSyncDataTypes DISABLED_RestoreSyncDataTypes');
113 GEN('#else'); 113 GEN('#else');
114 GEN('#define MAYBE_RestoreSyncDataTypes RestoreSyncDataTypes'); 114 GEN('#define MAYBE_RestoreSyncDataTypes RestoreSyncDataTypes');
115 GEN('#endif // defined(OS_LINUX)'); 115 GEN('#endif // defined(OS_LINUX)');
116 // Test that switching to and from "Sync everything" saves and restores types. 116 // Test that switching to and from "Sync everything" saves and restores types.
117 TEST_F('SyncSetupWebUITestAsync', 'MAYBE_RestoreSyncDataTypes', function() { 117 TEST_F('SyncSetupWebUITestAsync', 'MAYBE_RestoreSyncDataTypes', function() {
118 this.mockHandler.expects(once()).SyncSetupStartSignIn( 118 this.mockHandler.expects(once()).SyncSetupStartSignIn(
119 'access-point-settings').will(callFunction(function() { 119 [false] /* createSupervisedUser */).will(callFunction(function() {
120 SyncSetupOverlay.showSyncSetupPage('configure', {}); 120 SyncSetupOverlay.showSyncSetupPage('configure', {});
121 121
122 $('sync-select-datatypes').selectedIndex = 1; 122 $('sync-select-datatypes').selectedIndex = 1;
123 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); 123 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true);
124 124
125 $('bookmarks-checkbox').checked = false; 125 $('bookmarks-checkbox').checked = false;
126 cr.dispatchSimpleEvent($('bookmarks-checkbox'), 'change', true); 126 cr.dispatchSimpleEvent($('bookmarks-checkbox'), 'change', true);
127 127
128 $('sync-select-datatypes').selectedIndex = 0; 128 $('sync-select-datatypes').selectedIndex = 0;
129 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); 129 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true);
130 assertTrue($('bookmarks-checkbox').checked); 130 assertTrue($('bookmarks-checkbox').checked);
131 131
132 $('sync-select-datatypes').selectedIndex = 1; 132 $('sync-select-datatypes').selectedIndex = 1;
133 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); 133 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true);
134 assertFalse($('bookmarks-checkbox').checked); 134 assertFalse($('bookmarks-checkbox').checked);
135 135
136 testDone(); 136 testDone();
137 })); 137 }));
138 138
139 this.startSyncing(); 139 this.startSyncing();
140 }); 140 });
141 141
142 GEN('#endif // OS_CHROMEOS'); 142 GEN('#endif // OS_CHROMEOS');
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/people_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698