OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Include test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['chrome/browser/resources/chromeos/chromevox/testing/' + | 6 GEN_INCLUDE(['chrome/browser/resources/chromeos/chromevox/testing/' + |
7 'chromevox_e2e_test_base.js']); | 7 'chromevox_e2e_test_base.js']); |
8 | 8 |
9 /** | 9 /** |
10 * Base test fixture for ChromeVox Next end to end tests. | 10 * Base test fixture for ChromeVox Next end to end tests. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * @override | 25 * @override |
26 */ | 26 */ |
27 testGenCppIncludes: function() { | 27 testGenCppIncludes: function() { |
28 ChromeVoxE2ETest.prototype.testGenCppIncludes.call(this); | 28 ChromeVoxE2ETest.prototype.testGenCppIncludes.call(this); |
29 GEN('#include "base/command_line.h"'); | 29 GEN('#include "base/command_line.h"'); |
30 }, | 30 }, |
31 | 31 |
32 runWithAutomation: function(doc, callback) { | 32 runWithAutomation: function(doc, callback) { |
33 this.runWithDocument(doc, function() { | 33 this.runWithDocument(doc, function() { |
34 chrome.automation.getTree(function(root) { | 34 chrome.automation.getTree(function(root) { |
35 callback(root); | 35 if (root.children.length == 0) { |
| 36 root.addEventListener('loadComplete', |
| 37 function() { |
| 38 callback(root); |
| 39 }.bind(this), true); |
| 40 } else { |
| 41 callback(root); |
| 42 } |
36 }.bind(this)); | 43 }.bind(this)); |
37 }.bind(this)); | 44 }.bind(this)); |
38 } | 45 } |
39 }; | 46 }; |
OLD | NEW |