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

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

Issue 1155183006: Reimplement automation API on top of C++-backed AXTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@automation_faster_2
Patch Set: Copy observers Created 5 years, 6 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 64c4e36eb2d3601f1d7960b0b465c882eeb6c959..c45bd6ea1b2a02178b96dce1d143c7f29a634b11 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
@@ -5,48 +5,47 @@
// Do not test orientation or hover attributes (similar to exclusions on native
// accessibility), since they can be inconsistent depending on the environment.
var RemoveUntestedStates = function(state) {
- delete state[StateType.horizontal];
- delete state[StateType.hovered];
- delete state[StateType.vertical];
+ var result = JSON.parse(JSON.stringify(state));
+ delete result[StateType.horizontal];
+ delete result[StateType.hovered];
+ delete result[StateType.vertical];
+ return result;
};
var allTests = [
function testSimplePage() {
var title = rootNode.docTitle;
assertEq('Automation Tests', title);
- RemoveUntestedStates(rootNode.state);
+
+ var state = RemoveUntestedStates(rootNode.state);
assertEq(
- {enabled: true, focusable: true, readOnly: true},
- rootNode.state);
+ {enabled: true, focusable: true, readOnly: true},
+ state);
+
var children = rootNode.children;
assertEq(RoleType.rootWebArea, rootNode.role);
assertEq(1, children.length);
var body = children[0];
assertEq('body', body.htmlTag);
-
- RemoveUntestedStates(body.state);
- assertEq({enabled: true, readOnly: true},
- body.state);
+ state = RemoveUntestedStates(body.state);
+ assertEq({enabled: true, readOnly: true}, state);
var contentChildren = body.children;
assertEq(3, contentChildren.length);
var okButton = contentChildren[0];
assertEq('Ok', okButton.name);
- RemoveUntestedStates(okButton.state);
- assertEq({enabled: true, focusable: true, readOnly: true},
- okButton.state);
+ state = RemoveUntestedStates(okButton.state);
+ assertEq({enabled: true, focusable: true, readOnly: true}, state);
var userNameInput = contentChildren[1];
assertEq('Username',
userNameInput.description);
- RemoveUntestedStates(userNameInput.state);
- assertEq({enabled: true, focusable: true},
- userNameInput.state);
+ state = RemoveUntestedStates(userNameInput.state);
+ assertEq({enabled: true, focusable: true}, state);
var cancelButton = contentChildren[2];
assertEq('Cancel',
cancelButton.name);
- RemoveUntestedStates(cancelButton.state);
- assertEq({enabled: true, focusable: true, readOnly: true},
- cancelButton.state);
+ state = RemoveUntestedStates(cancelButton.state);
+ assertEq({enabled: true, focusable: true, readOnly: true}, state);
// Traversal.
assertEq(undefined, rootNode.parent);

Powered by Google App Engine
This is Rietveld 408576698