OLD | NEW |
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 })); | 101 })); |
102 | 102 |
103 // The test completes after the sync config is sent out. | 103 // The test completes after the sync config is sent out. |
104 this.mockHandler.expects(once()).SyncSetupConfigure(ANYTHING). | 104 this.mockHandler.expects(once()).SyncSetupConfigure(ANYTHING). |
105 will(callFunction(testDone)); | 105 will(callFunction(testDone)); |
106 | 106 |
107 // Click the "Sign in to Chrome..." button. | 107 // Click the "Sign in to Chrome..." button. |
108 this.startSyncing(); | 108 this.startSyncing(); |
109 }); | 109 }); |
110 | 110 |
111 // This test is flaky on Linux bot. See crbug.com/579666 | 111 // This test is flaky on Linux and Windows bots. See crbug.com/579666 and |
112 GEN('#if defined(OS_LINUX)'); | 112 // crbug.com/638884 |
| 113 GEN('#if defined(OS_LINUX) || defined(OS_WIN)'); |
113 GEN('#define MAYBE_RestoreSyncDataTypes DISABLED_RestoreSyncDataTypes'); | 114 GEN('#define MAYBE_RestoreSyncDataTypes DISABLED_RestoreSyncDataTypes'); |
114 GEN('#else'); | 115 GEN('#else'); |
115 GEN('#define MAYBE_RestoreSyncDataTypes RestoreSyncDataTypes'); | 116 GEN('#define MAYBE_RestoreSyncDataTypes RestoreSyncDataTypes'); |
116 GEN('#endif // defined(OS_LINUX)'); | 117 GEN('#endif // defined(OS_LINUX) || defined(OS_WIN)'); |
117 // Test that switching to and from "Sync everything" saves and restores types. | 118 // Test that switching to and from "Sync everything" saves and restores types. |
118 TEST_F('SyncSetupWebUITestAsync', 'MAYBE_RestoreSyncDataTypes', function() { | 119 TEST_F('SyncSetupWebUITestAsync', 'MAYBE_RestoreSyncDataTypes', function() { |
119 this.mockHandler.expects(once()).SyncSetupStartSignIn( | 120 this.mockHandler.expects(once()).SyncSetupStartSignIn( |
120 [false] /* createSupervisedUser */).will(callFunction(function() { | 121 [false] /* createSupervisedUser */).will(callFunction(function() { |
121 SyncSetupOverlay.showSyncSetupPage('configure', {}); | 122 SyncSetupOverlay.showSyncSetupPage('configure', {}); |
122 | 123 |
123 $('sync-select-datatypes').selectedIndex = 1; | 124 $('sync-select-datatypes').selectedIndex = 1; |
124 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); | 125 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); |
125 | 126 |
126 $('bookmarks-checkbox').checked = false; | 127 $('bookmarks-checkbox').checked = false; |
127 cr.dispatchSimpleEvent($('bookmarks-checkbox'), 'change', true); | 128 cr.dispatchSimpleEvent($('bookmarks-checkbox'), 'change', true); |
128 | 129 |
129 $('sync-select-datatypes').selectedIndex = 0; | 130 $('sync-select-datatypes').selectedIndex = 0; |
130 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); | 131 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); |
131 assertTrue($('bookmarks-checkbox').checked); | 132 assertTrue($('bookmarks-checkbox').checked); |
132 | 133 |
133 $('sync-select-datatypes').selectedIndex = 1; | 134 $('sync-select-datatypes').selectedIndex = 1; |
134 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); | 135 cr.dispatchSimpleEvent($('sync-select-datatypes'), 'change', true); |
135 assertFalse($('bookmarks-checkbox').checked); | 136 assertFalse($('bookmarks-checkbox').checked); |
136 | 137 |
137 testDone(); | 138 testDone(); |
138 })); | 139 })); |
139 | 140 |
140 this.startSyncing(); | 141 this.startSyncing(); |
141 }); | 142 }); |
142 | 143 |
143 GEN('#endif // OS_CHROMEOS'); | 144 GEN('#endif // OS_CHROMEOS'); |
OLD | NEW |