| Index: chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js
|
| diff --git a/chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js b/chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js
|
| index 90e1711b2ef0422bf505be8f7aa01e1f659b12bb..a2f61c97ec70cec9bc8774bb1d8c3e8888ec4c18 100644
|
| --- a/chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js
|
| +++ b/chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js
|
| @@ -22,14 +22,28 @@ var allTests = [
|
| function testLoadTabs() {
|
| var webViews = getAllWebViews();
|
| assertEq(2, webViews.length);
|
| - var subroot = webViews[1].firstChild;
|
| - assertEq(webViews[1], subroot.parent);
|
| - assertEq(subroot, subroot.parent.children[0]);
|
| - var button = subroot.firstChild.firstChild;
|
| - assertEq(chrome.automation.RoleType.button, button.role);
|
| - var input = subroot.firstChild.lastChild.previousSibling;
|
| - assertEq(chrome.automation.RoleType.textField, input.role);
|
| - chrome.test.succeed();
|
| +
|
| + // Test spins up more quickly than the load; listen for the childrenChanged
|
| + // event.
|
| + function childrenChangedListener(evt) {
|
| + var subroot = webViews[1].firstChild;
|
| + assertEq(evt.target, subroot.parent);
|
| + assertEq(subroot, subroot.parent.children[0]);
|
| +
|
| + var button = subroot.firstChild.firstChild;
|
| + assertEq(chrome.automation.RoleType.button, button.role);
|
| +
|
| + var input = subroot.firstChild.lastChild.previousSibling;
|
| + assertEq(chrome.automation.RoleType.textField, input.role);
|
| + webViews[1].removeEventListener(
|
| + chrome.automation.EventType.childrenChanged,
|
| + childrenChangedListener), true;
|
| + chrome.test.succeed();
|
| + }
|
| + webViews[1].addEventListener(
|
| + chrome.automation.EventType.childrenChanged,
|
| + childrenChangedListener,
|
| + true);
|
| },
|
|
|
| function testSubevents() {
|
|
|