Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..24364f1169f8867c0d3e2c3fc9e75a7cc9278105 |
| --- /dev/null |
| +++ b/chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +var allTests = [ |
| + function testLoadTabs() { |
| + function findAllWebAreas(node, nodes) { |
| + if (node.role == chrome.automation.RoleType.webArea) |
| + nodes.push(node); |
|
dmazzoni
2014/10/29 06:53:30
nit: indent
|
| + |
| + var children = node.children(); |
| + for (var i = 0; i < children.length; i++) { |
| + var child = findAllWebAreas(children[i], nodes); |
| + } |
| + } |
| + var webAreas = []; |
| + findAllWebAreas(rootNode, webAreas); |
| + assertEq(2, webAreas.length); |
| + var second = webAreas[1]; |
| + second.load(function() { |
| + var subroot = second.firstChild(); |
| + assertEq(chrome.automation.RoleType.rootWebArea, subroot.role); |
| + var button = subroot.firstChild().firstChild(); |
| + assertEq(chrome.automation.RoleType.button, button.role); |
| + |
| + var para = subroot.firstChild().lastChild().previousSibling(); |
| + assertEq(chrome.automation.RoleType.textField, para.role); |
| + chrome.test.succeed(); |
| + }); |
| + } |
| +]; |
| + |
| +setupAndRunTests(allTests, |
| + '<button>alpha</button><input type="text">hello</input>'); |