Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2087)

Unified Diff: chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js

Issue 667713006: Implement automatic load of composed/embedded automation trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>');

Powered by Google App Engine
This is Rietveld 408576698