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

Unified Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js

Issue 308003003: Allow requesting Automation tree by tabId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary content script from tests Created 6 years, 7 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/tabs/sanity_check.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js b/chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js
index b391c97c4b4d66251cb7c184f1936b12241b8a0a..a1b39312bf5062c4ed50787e85080efbf60cd01e 100644
--- a/chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js
+++ b/chrome/test/data/extensions/api_test/automation/tests/tabs/sanity_check.js
@@ -12,68 +12,70 @@ var RemoveUntestedStates = function(state) {
var allTests = [
function testSimplePage() {
- var title = tree.root.attributes['docTitle'];
- assertEq('Automation Tests', title);
- RemoveUntestedStates(tree.root.state);
- assertEq(
- {enabled: true, focusable: true, readOnly: true},
- tree.root.state);
- var children = tree.root.children();
- assertEq(1, children.length);
+ tree.addEventListener('loadComplete', function() {
+ var title = tree.root.attributes['docTitle'];
+ assertEq('Automation Tests', title);
+ RemoveUntestedStates(tree.root.state);
+ assertEq(
+ {enabled: true, focusable: true, readOnly: true},
+ tree.root.state);
+ var children = tree.root.children();
+ assertEq(1, children.length);
- var body = children[0];
- assertEq('body', body.attributes['htmlTag']);
+ var body = children[0];
+ assertEq('body', body.attributes['htmlTag']);
- RemoveUntestedStates(body.state);
- assertEq({enabled: true, readOnly: true},
- body.state);
+ RemoveUntestedStates(body.state);
+ assertEq({enabled: true, readOnly: true},
+ body.state);
- var contentChildren = body.children();
- assertEq(3, contentChildren.length);
- var okButton = contentChildren[0];
- assertEq('Ok', okButton.attributes['name']);
- RemoveUntestedStates(okButton.state);
- assertEq({enabled: true, focusable: true, readOnly: true},
- okButton.state);
- var userNameInput = contentChildren[1];
- assertEq('Username',
- userNameInput.attributes['description']);
- RemoveUntestedStates(userNameInput.state);
- assertEq({enabled: true, focusable: true},
- userNameInput.state);
- var cancelButton = contentChildren[2];
- assertEq('Cancel',
- cancelButton.attributes['name']);
- RemoveUntestedStates(cancelButton.state);
- assertEq({enabled: true, focusable: true, readOnly: true},
- cancelButton.state);
+ var contentChildren = body.children();
+ assertEq(3, contentChildren.length);
+ var okButton = contentChildren[0];
+ assertEq('Ok', okButton.attributes['name']);
+ RemoveUntestedStates(okButton.state);
+ assertEq({enabled: true, focusable: true, readOnly: true},
+ okButton.state);
+ var userNameInput = contentChildren[1];
+ assertEq('Username',
+ userNameInput.attributes['description']);
+ RemoveUntestedStates(userNameInput.state);
+ assertEq({enabled: true, focusable: true},
+ userNameInput.state);
+ var cancelButton = contentChildren[2];
+ assertEq('Cancel',
+ cancelButton.attributes['name']);
+ RemoveUntestedStates(cancelButton.state);
+ assertEq({enabled: true, focusable: true, readOnly: true},
+ cancelButton.state);
- // Traversal.
- assertEq(undefined, tree.root.parent());
- assertEq(tree.root, body.parent());
+ // Traversal.
+ assertEq(undefined, tree.root.parent());
+ assertEq(tree.root, body.parent());
- assertEq(body, tree.root.firstChild());
- assertEq(body, tree.root.lastChild());
+ assertEq(body, tree.root.firstChild());
+ assertEq(body, tree.root.lastChild());
- assertEq(okButton, body.firstChild());
- assertEq(cancelButton, body.lastChild());
+ assertEq(okButton, body.firstChild());
+ assertEq(cancelButton, body.lastChild());
- assertEq(body, okButton.parent());
- assertEq(body, userNameInput.parent());
- assertEq(body, cancelButton.parent());
+ assertEq(body, okButton.parent());
+ assertEq(body, userNameInput.parent());
+ assertEq(body, cancelButton.parent());
- assertEq(undefined, okButton.previousSibling());
- assertEq(undefined, okButton.firstChild());
- assertEq(userNameInput, okButton.nextSibling());
- assertEq(undefined, okButton.lastChild());
+ assertEq(undefined, okButton.previousSibling());
+ assertEq(undefined, okButton.firstChild());
+ assertEq(userNameInput, okButton.nextSibling());
+ assertEq(undefined, okButton.lastChild());
- assertEq(okButton, userNameInput.previousSibling());
- assertEq(cancelButton, userNameInput.nextSibling());
+ assertEq(okButton, userNameInput.previousSibling());
+ assertEq(cancelButton, userNameInput.nextSibling());
- assertEq(userNameInput, cancelButton.previousSibling());
- assertEq(undefined, cancelButton.nextSibling());
+ assertEq(userNameInput, cancelButton.previousSibling());
+ assertEq(undefined, cancelButton.nextSibling());
- chrome.test.succeed();
+ chrome.test.succeed();
+ });
}
];

Powered by Google App Engine
This is Rietveld 408576698