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

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/tree_change.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var allTests = [ 5 var allTests = [
6 function testTreeChangedObserverForCreatingNode() { 6 function testTreeChangedObserverForCreatingNode() {
7 chrome.automation.addTreeChangeObserver(function(change) { 7 chrome.automation.addTreeChangeObserver(function(change) {
8 if (change.type == "nodeCreated" && change.target.name == "New") { 8 if (change.type == "subtreeCreated" && change.target.name == "New") {
9 chrome.test.succeed(); 9 chrome.test.succeed();
10 } 10 }
11 }); 11 });
12 12
13 var addButton = rootNode.find({ attributes: { name: 'Add' }}); 13 var addButton = rootNode.find({ attributes: { name: 'Add' }});
14 addButton.doDefault(); 14 addButton.doDefault();
15 }, 15 },
16 16
17 function testTreeChangedObserverForRemovingNode() { 17 function testTreeChangedObserverForRemovingNode() {
18 chrome.automation.addTreeChangeObserver(function(change) { 18 chrome.automation.addTreeChangeObserver(function(change) {
19 if (change.type == "nodeRemoved" && change.target.role == "listItem") { 19 if (change.type == "nodeRemoved" && change.target.role == "listItem") {
20 chrome.test.succeed(); 20 chrome.test.succeed();
21 } 21 }
22 }); 22 });
23 23
24 var removeButton = rootNode.find({ attributes: { name: 'Remove' }}); 24 var removeButton = rootNode.find({ attributes: { name: 'Remove' }});
25 removeButton.doDefault(); 25 removeButton.doDefault();
26 } 26 }
27 ]; 27 ];
28 28
29 setUpAndRunTests(allTests, 'tree_change.html'); 29 setUpAndRunTests(allTests, 'tree_change.html');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698