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

Side by Side Diff: LayoutTests/inspector/elements/elements-panel-search.html

Issue 206313004: DevTools: Rename WebInspector.DOMAgent into WebInspector.DOMModel (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 6 years, 9 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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or g/TR/html4/loose.dtd"> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or g/TR/html4/loose.dtd">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../http/tests/inspector/inspector-test.js"></script> 4 <script src="../../http/tests/inspector/inspector-test.js"></script>
5 <script> 5 <script>
6 function test() 6 function test()
7 { 7 {
8 WebInspector.inspectorView.showPanel("elements"); 8 WebInspector.inspectorView.showPanel("elements");
9 9
10 function searchCallback(next, resultCount) 10 function searchCallback(next, resultCount)
11 { 11 {
12 if (resultCount == 0) { 12 if (resultCount == 0) {
13 InspectorTest.addResult("Nothing found"); 13 InspectorTest.addResult("Nothing found");
14 WebInspector.domAgent.cancelSearch(); 14 WebInspector.domModel.cancelSearch();
15 next(); 15 next();
16 } 16 }
17 17
18 for (var i = 0; i < resultCount; ++i) 18 for (var i = 0; i < resultCount; ++i)
19 WebInspector.domAgent.searchResult(i, searchResultCallback.bind(this , i + 1 === resultCount)); 19 WebInspector.domModel.searchResult(i, searchResultCallback.bind(this , i + 1 === resultCount));
20 20
21 function searchResultCallback(isLastItem, node) 21 function searchResultCallback(isLastItem, node)
22 { 22 {
23 node.getOuterHTML(addSearchResult.bind(this, isLastItem)); 23 node.getOuterHTML(addSearchResult.bind(this, isLastItem));
24 } 24 }
25 25
26 function addSearchResult(isLastItem, error, markupVa_lue) 26 function addSearchResult(isLastItem, error, markupVa_lue)
27 { 27 {
28 InspectorTest.addResult(markupVa_lue.split("").join(" ")); 28 InspectorTest.addResult(markupVa_lue.split("").join(" "));
29 if (isLastItem) { 29 if (isLastItem) {
30 WebInspector.domAgent.cancelSearch(); 30 WebInspector.domModel.cancelSearch();
31 next(); 31 next();
32 } 32 }
33 } 33 }
34 } 34 }
35 35
36 InspectorTest.runTestSuite([ 36 InspectorTest.runTestSuite([
37 function testSetUp(next) 37 function testSetUp(next)
38 { 38 {
39 WebInspector.domAgent.requestDocument(next); 39 WebInspector.domModel.requestDocument(next);
40 }, 40 },
41 41
42 function testPlainText(next) 42 function testPlainText(next)
43 { 43 {
44 WebInspector.domAgent.performSearch("Fo" + "o" + "Bar", searchCallba ck.bind(this, next)); 44 WebInspector.domModel.performSearch("Fo" + "o" + "Bar", searchCallba ck.bind(this, next));
45 }, 45 },
46 46
47 function testPartialText(next) 47 function testPartialText(next)
48 { 48 {
49 WebInspector.domAgent.performSearch("oo" + "Ba", searchCallback.bind (this, next)); 49 WebInspector.domModel.performSearch("oo" + "Ba", searchCallback.bind (this, next));
50 }, 50 },
51 51
52 function testStartTag(next) 52 function testStartTag(next)
53 { 53 {
54 WebInspector.domAgent.performSearch("<inpu" + "t", searchCallback.bi nd(this, next)); 54 WebInspector.domModel.performSearch("<inpu" + "t", searchCallback.bi nd(this, next));
55 }, 55 },
56 56
57 function testEndTag(next) 57 function testEndTag(next)
58 { 58 {
59 WebInspector.domAgent.performSearch("npu" + "t>", searchCallback.bin d(this, next)); 59 WebInspector.domModel.performSearch("npu" + "t>", searchCallback.bin d(this, next));
60 }, 60 },
61 61
62 function testPartialTag(next) 62 function testPartialTag(next)
63 { 63 {
64 WebInspector.domAgent.performSearch("npu" + "t", searchCallback.bind (this, next)); 64 WebInspector.domModel.performSearch("npu" + "t", searchCallback.bind (this, next));
65 }, 65 },
66 66
67 function testPartialAbsentTagStart(next) 67 function testPartialAbsentTagStart(next)
68 { 68 {
69 WebInspector.domAgent.performSearch("<npu" + "t", searchCallback.bin d(this, next)); 69 WebInspector.domModel.performSearch("<npu" + "t", searchCallback.bin d(this, next));
70 }, 70 },
71 71
72 function testPartialAbsentTagEnd(next) 72 function testPartialAbsentTagEnd(next)
73 { 73 {
74 WebInspector.domAgent.performSearch("npu" + ">", searchCallback.bind (this, next)); 74 WebInspector.domModel.performSearch("npu" + ">", searchCallback.bind (this, next));
75 }, 75 },
76 76
77 function testFullTag(next) 77 function testFullTag(next)
78 { 78 {
79 WebInspector.domAgent.performSearch("<inpu" + "t>", searchCallback.b ind(this, next)); 79 WebInspector.domModel.performSearch("<inpu" + "t>", searchCallback.b ind(this, next));
80 }, 80 },
81 81
82 function testExactAttributeName(next) 82 function testExactAttributeName(next)
83 { 83 {
84 WebInspector.domAgent.performSearch("valu" + "e", searchCallback.bin d(this, next)); 84 WebInspector.domModel.performSearch("valu" + "e", searchCallback.bin d(this, next));
85 }, 85 },
86 86
87 function testExactAttributeVal_ue(next) 87 function testExactAttributeVal_ue(next)
88 { 88 {
89 WebInspector.domAgent.performSearch("In" + "putVa" + "l", searchCall back.bind(this, next)); 89 WebInspector.domModel.performSearch("In" + "putVa" + "l", searchCall back.bind(this, next));
90 }, 90 },
91 91
92 function testExactAttributeVal_ueWithQuotes(next) 92 function testExactAttributeVal_ueWithQuotes(next)
93 { 93 {
94 WebInspector.domAgent.performSearch("\"fo" + "o\"", searchCallback.b ind(this, next)); 94 WebInspector.domModel.performSearch("\"fo" + "o\"", searchCallback.b ind(this, next));
95 }, 95 },
96 96
97 function testPartialAttributeVal_ue(next) 97 function testPartialAttributeVal_ue(next)
98 { 98 {
99 WebInspector.domAgent.performSearch("n" + "putVa" + "l", searchCallb ack.bind(this, next)); 99 WebInspector.domModel.performSearch("n" + "putVa" + "l", searchCallb ack.bind(this, next));
100 }, 100 },
101 101
102 function testXPathAttribute(next) 102 function testXPathAttribute(next)
103 { 103 {
104 WebInspector.domAgent.performSearch("//html" + "//@attr", searchCall back.bind(this, next)); 104 WebInspector.domModel.performSearch("//html" + "//@attr", searchCall back.bind(this, next));
105 }, 105 },
106 106
107 function testSelector(next) 107 function testSelector(next)
108 { 108 {
109 WebInspector.domAgent.performSearch("d" + "iv.divclass span", search Callback.bind(this, next)); 109 WebInspector.domModel.performSearch("d" + "iv.divclass span", search Callback.bind(this, next));
110 }, 110 },
111 111
112 function testCaseUpperFindsLower(next) 112 function testCaseUpperFindsLower(next)
113 { 113 {
114 WebInspector.domAgent.performSearch("K" +"OO", searchCallback.bind(t his, next)); 114 WebInspector.domModel.performSearch("K" +"OO", searchCallback.bind(t his, next));
115 }, 115 },
116 116
117 function testCaseLowerFindsUpper(next) 117 function testCaseLowerFindsUpper(next)
118 { 118 {
119 WebInspector.domAgent.performSearch("c" + "aseless", searchCallback. bind(this, next)); 119 WebInspector.domModel.performSearch("c" + "aseless", searchCallback. bind(this, next));
120 }, 120 },
121 121
122 function testCaseAttribute(next) 122 function testCaseAttribute(next)
123 { 123 {
124 WebInspector.domAgent.performSearch("C" + "AMEL", searchCallback.bin d(this, next)); 124 WebInspector.domModel.performSearch("C" + "AMEL", searchCallback.bin d(this, next));
125 } 125 }
126 ]); 126 ]);
127 127
128 } 128 }
129 </script> 129 </script>
130 </head> 130 </head>
131 131
132 <body onload="runTest()"> 132 <body onload="runTest()">
133 <p> 133 <p>
134 Tests that elements panel search is returning proper results. 134 Tests that elements panel search is returning proper results.
135 </p> 135 </p>
136 136
137 <div>FooBar</div> 137 <div>FooBar</div>
138 <input value="InputVal"> 138 <input value="InputVal">
139 <div attr="foo"></div> 139 <div attr="foo"></div>
140 <div id="terminator"></div> 140 <div id="terminator"></div>
141 <div class="divclass"><span>Found by selector</span></div> 141 <div class="divclass"><span>Found by selector</span></div>
142 <span class="foo koo"></span> 142 <span class="foo koo"></span>
143 <span class="CASELESS"></span> 143 <span class="CASELESS"></span>
144 <span data-camel="insenstive"></span> 144 <span data-camel="insenstive"></span>
145 145
146 </body> 146 </body>
147 </html> 147 </html>
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/elements-panel-rewrite-href.html ('k') | LayoutTests/inspector/elements/insert-node.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698