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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/accessibility/accessibility-pane-test.js

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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 var initialize_AccessibilityTest = function() { 1 var initialize_AccessibilityTest = function() {
2 2
3 InspectorTest.accessibilitySidebarPane = function() 3 InspectorTest.accessibilitySidebarPane = function()
4 { 4 {
5 return self.runtime.sharedInstance(WebInspector.AccessibilitySidebarView); 5 return self.runtime.sharedInstance(Accessibility.AccessibilitySidebarView);
6 } 6 }
7 7
8 /** 8 /**
9 * @param {string} idValue 9 * @param {string} idValue
10 * @return {Promise} 10 * @return {Promise}
11 */ 11 */
12 InspectorTest.selectNodeAndWaitForAccessibility = function(idValue) 12 InspectorTest.selectNodeAndWaitForAccessibility = function(idValue)
13 { 13 {
14 return new Promise((resolve) => { 14 return new Promise((resolve) => {
15 InspectorTest.selectNodeWithId(idValue, function() { 15 InspectorTest.selectNodeWithId(idValue, function() {
16 self.runtime.sharedInstance(WebInspector.AccessibilitySidebarView).d oUpdate().then(resolve); 16 self.runtime.sharedInstance(Accessibility.AccessibilitySidebarView). doUpdate().then(resolve);
17 }); 17 });
18 }); 18 });
19 } 19 }
20 20
21 InspectorTest.dumpSelectedElementAccessibilityNode = function() 21 InspectorTest.dumpSelectedElementAccessibilityNode = function()
22 { 22 {
23 var sidebarPane = InspectorTest.accessibilitySidebarPane(); 23 var sidebarPane = InspectorTest.accessibilitySidebarPane();
24 24
25 if (!sidebarPane) { 25 if (!sidebarPane) {
26 InspectorTest.addResult("No sidebarPane in dumpSelectedElementAccessibil ityNode"); 26 InspectorTest.addResult("No sidebarPane in dumpSelectedElementAccessibil ityNode");
27 InspectorTest.completeTest(); 27 InspectorTest.completeTest();
28 return; 28 return;
29 } 29 }
30 InspectorTest.dumpAccessibilityNode(sidebarPane._axNodeSubPane._axNode); 30 InspectorTest.dumpAccessibilityNode(sidebarPane._axNodeSubPane._axNode);
31 } 31 }
32 32
33 /** 33 /**
34 * @param {!WebInspector.AccessibilityNode} accessibilityNode 34 * @param {!Accessibility.AccessibilityNode} accessibilityNode
35 */ 35 */
36 InspectorTest.dumpAccessibilityNode = function(accessibilityNode) 36 InspectorTest.dumpAccessibilityNode = function(accessibilityNode)
37 { 37 {
38 if (!accessibilityNode) { 38 if (!accessibilityNode) {
39 InspectorTest.addResult("<null>"); 39 InspectorTest.addResult("<null>");
40 InspectorTest.completeTest(); 40 InspectorTest.completeTest();
41 return; 41 return;
42 } 42 }
43 43
44 var builder = []; 44 var builder = [];
45 builder.push(accessibilityNode.role().value); 45 builder.push(accessibilityNode.role().value);
46 builder.push(accessibilityNode.name() ? '"' + accessibilityNode.name().value + '"' 46 builder.push(accessibilityNode.name() ? '"' + accessibilityNode.name().value + '"'
47 : "<undefined>"); 47 : "<undefined>");
48 if (accessibilityNode.properties()) { 48 if (accessibilityNode.properties()) {
49 for (var property of accessibilityNode.properties()) { 49 for (var property of accessibilityNode.properties()) {
50 if ("value" in property) 50 if ("value" in property)
51 builder.push(property.name + '="' + property.value.value + '"'); 51 builder.push(property.name + '="' + property.value.value + '"');
52 } 52 }
53 } 53 }
54 InspectorTest.addResult(builder.join(" ")); 54 InspectorTest.addResult(builder.join(" "));
55 } 55 }
56 56
57 /** 57 /**
58 * @param {string} attribute 58 * @param {string} attribute
59 * @return {?WebInspector.ARIAAttributesTreeElement} 59 * @return {?Accessibility.ARIAAttributesTreeElement}
60 */ 60 */
61 InspectorTest.findARIAAttributeTreeElement = function(attribute) 61 InspectorTest.findARIAAttributeTreeElement = function(attribute)
62 { 62 {
63 var sidebarPane = InspectorTest.accessibilitySidebarPane(); 63 var sidebarPane = InspectorTest.accessibilitySidebarPane();
64 64
65 if (!sidebarPane) { 65 if (!sidebarPane) {
66 InspectorTest.addResult("Could not get Accessibility sidebar pane."); 66 InspectorTest.addResult("Could not get Accessibility sidebar pane.");
67 InspectorTest.completeTest(); 67 InspectorTest.completeTest();
68 return; 68 return;
69 } 69 }
70 70
71 var ariaSubPane = sidebarPane._ariaSubPane; 71 var ariaSubPane = sidebarPane._ariaSubPane;
72 var treeOutline = ariaSubPane._treeOutline; 72 var treeOutline = ariaSubPane._treeOutline;
73 var childNodes = treeOutline._rootElement._children; 73 var childNodes = treeOutline._rootElement._children;
74 for (var treeElement of childNodes) { 74 for (var treeElement of childNodes) {
75 if (treeElement._attribute.name === attribute) 75 if (treeElement._attribute.name === attribute)
76 return treeElement; 76 return treeElement;
77 } 77 }
78 return null; 78 return null;
79 } 79 }
80 80
81 }; 81 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698