| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 5 |
| 6 /** | 6 /** |
| 7 * @fileoverview Tests the local NTP. | 7 * @fileoverview Tests the local NTP. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 | 136 |
| 137 | 137 |
| 138 // ****************************** ADVANCED TESTS ****************************** | 138 // ****************************** ADVANCED TESTS ****************************** |
| 139 // Advanced tests are controlled from the native side. The helpers here are | 139 // Advanced tests are controlled from the native side. The helpers here are |
| 140 // called from native code to set up the page and to check results. | 140 // called from native code to set up the page and to check results. |
| 141 | 141 |
| 142 function handlePostMessage(event) { | 142 function handlePostMessage(event) { |
| 143 if (event.data.cmd == 'loaded') { | 143 if (event.data.cmd == 'loaded') { |
| 144 domAutomationController.setAutomationId(0); | |
| 145 domAutomationController.send('loaded'); | 144 domAutomationController.send('loaded'); |
| 146 } | 145 } |
| 147 } | 146 } |
| 148 | 147 |
| 149 function setupAdvancedTest(opt_waitForIframeLoaded) { | 148 function setupAdvancedTest(opt_waitForIframeLoaded) { |
| 150 if (opt_waitForIframeLoaded) { | 149 if (opt_waitForIframeLoaded) { |
| 151 window.addEventListener('message', handlePostMessage); | 150 window.addEventListener('message', handlePostMessage); |
| 152 } | 151 } |
| 153 | 152 |
| 154 setUp(); | 153 setUp(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 } | 171 } |
| 173 | 172 |
| 174 function fakeboxIsVisible() { | 173 function fakeboxIsVisible() { |
| 175 return elementIsVisible($('fakebox')); | 174 return elementIsVisible($('fakebox')); |
| 176 } | 175 } |
| 177 | 176 |
| 178 function fakeboxIsFocused() { | 177 function fakeboxIsFocused() { |
| 179 return fakeboxIsVisible() && | 178 return fakeboxIsVisible() && |
| 180 document.body.classList.contains('fakebox-focused'); | 179 document.body.classList.contains('fakebox-focused'); |
| 181 } | 180 } |
| OLD | NEW |