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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // Verify that initial state is unsynced, click the sign in button, verify | 61 // Verify that initial state is unsynced, click the sign in button, verify |
62 // that the sync setup dialog appears, and dismiss it. | 62 // that the sync setup dialog appears, and dismiss it. |
63 TEST_F('SyncSetupWebUITestAsync', 'VerifySignIn', function() { | 63 TEST_F('SyncSetupWebUITestAsync', 'VerifySignIn', function() { |
64 // Make sure the user is not starting off in the signed in or syncing state. | 64 // Make sure the user is not starting off in the signed in or syncing state. |
65 this.verifyUnsynced(); | 65 this.verifyUnsynced(); |
66 | 66 |
67 // Handle SyncSetupShowSetupUI by navigating to chrome://settings/syncSetup. | 67 // Handle SyncSetupShowSetupUI by navigating to chrome://settings/syncSetup. |
68 this.mockHandler.expects(once()).SyncSetupShowSetupUI(). | 68 this.mockHandler.expects(once()).SyncSetupShowSetupUI(). |
69 will(callFunction(function() { | 69 will(callFunction(function() { |
70 OptionsPage.navigateToPage('syncSetup'); | 70 PageManager.showPageByName('syncSetup'); |
71 })); | 71 })); |
72 | 72 |
73 // Handle SyncSetupStartSignIn by displaying the sync setup dialog, verifying | 73 // Handle SyncSetupStartSignIn by displaying the sync setup dialog, verifying |
74 // that a confirmation dialog appears, and clicking OK to dismiss the dialog. | 74 // that a confirmation dialog appears, and clicking OK to dismiss the dialog. |
75 // Note that this test doesn't actually do a gaia sign in. | 75 // Note that this test doesn't actually do a gaia sign in. |
76 this.mockHandler.expects(once()).SyncSetupStartSignIn(). | 76 this.mockHandler.expects(once()).SyncSetupStartSignIn(). |
77 will(callFunction(function() { | 77 will(callFunction(function() { |
78 SyncSetupOverlay.showSyncSetupPage('configure'); | 78 SyncSetupOverlay.showSyncSetupPage('configure'); |
79 var okButton = $('confirm-everything-ok'); | 79 var okButton = $('confirm-everything-ok'); |
80 assertNotEquals(null, okButton); | 80 assertNotEquals(null, okButton); |
81 okButton.click(); | 81 okButton.click(); |
82 })); | 82 })); |
83 | 83 |
84 // The test completes after the sync config is sent out. | 84 // The test completes after the sync config is sent out. |
85 this.mockHandler.expects(once()).SyncSetupConfigure(ANYTHING). | 85 this.mockHandler.expects(once()).SyncSetupConfigure(ANYTHING). |
86 will(callFunction(testDone)); | 86 will(callFunction(testDone)); |
87 | 87 |
88 // For testing, don't wait to execute timeouts. | 88 // For testing, don't wait to execute timeouts. |
89 var oldSetTimeout = setTimeout; | 89 var oldSetTimeout = setTimeout; |
90 setTimeout = function(fn, timeout) { | 90 setTimeout = function(fn, timeout) { |
91 oldSetTimeout(fn, 0); | 91 oldSetTimeout(fn, 0); |
92 }; | 92 }; |
93 | 93 |
94 // Kick off the test by clicking the "Sign in to Chrome..." button. | 94 // Kick off the test by clicking the "Sign in to Chrome..." button. |
95 this.startSyncing(); | 95 this.startSyncing(); |
96 }); | 96 }); |
97 | 97 |
98 GEN('#endif // OS_CHROMEOS'); | 98 GEN('#endif // OS_CHROMEOS'); |
OLD | NEW |