OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
4 <script src="../resources-test.js"></script> | 4 <script src="../resources-test.js"></script> |
5 <script src="search-test.js"></script> | 5 <script src="search-test.js"></script> |
6 <script> | 6 <script> |
7 function test() | 7 function test() |
8 { | 8 { |
9 // This file should not match search query. | |
10 var text = "searchTest" + "UniqueString"; | |
11 InspectorTest.runAfterResourcesAreFinished(["search.js"], step2); | 9 InspectorTest.runAfterResourcesAreFinished(["search.js"], step2); |
| 10 var resource; |
12 | 11 |
13 function step2() | 12 function step2() |
14 { | 13 { |
15 var resource = WebInspector.resourceForURL("http://127.0.0.1:8000/inspec
tor/search/resources/search.js"); | 14 resource = WebInspector.resourceForURL("http://127.0.0.1:8000/inspector/
search/resources/search.js"); |
16 InspectorTest.addResult(resource.url); | 15 InspectorTest.addResult(resource.url); |
17 resource.searchInContent(text, step3); | 16 |
| 17 // This file should not match search query. |
| 18 var text = "searchTest" + "UniqueString"; |
| 19 resource.searchInContent(text, false, false, step3); |
18 } | 20 } |
19 | 21 |
20 function step3(searchMatches) | 22 function step3(searchMatches) |
21 { | 23 { |
22 InspectorTest.dumpSearchMatches(searchMatches); | 24 InspectorTest.dumpSearchMatches(searchMatches); |
| 25 |
| 26 // This file should not match search query. |
| 27 var text = "searchTest" + "UniqueString"; |
| 28 resource.searchInContent(text, true, false, step4); |
| 29 } |
| 30 |
| 31 function step4(searchMatches) |
| 32 { |
| 33 InspectorTest.dumpSearchMatches(searchMatches); |
| 34 |
| 35 var text = "[a-z]earchTestUniqueString"; |
| 36 resource.searchInContent(text, false, true, step5); |
| 37 } |
| 38 |
| 39 function step5(searchMatches) |
| 40 { |
| 41 InspectorTest.dumpSearchMatches(searchMatches); |
| 42 |
| 43 var text = "[a-z]earchTestUniqueString"; |
| 44 resource.searchInContent(text, true, true, step6); |
| 45 } |
| 46 |
| 47 function step6(searchMatches) |
| 48 { |
| 49 InspectorTest.dumpSearchMatches(searchMatches); |
| 50 |
23 InspectorTest.completeTest(); | 51 InspectorTest.completeTest(); |
24 } | 52 } |
25 } | 53 } |
26 </script> | 54 </script> |
27 </head> | 55 </head> |
28 <body> | 56 <body> |
29 <p>Tests single resource search in inspector page agent.</p> | 57 <p>Tests single resource search in inspector page agent.</p> |
30 <a href="https://bugs.webkit.org/show_bug.cgi?id=68998">Bug 68998</a> | 58 <a href="https://bugs.webkit.org/show_bug.cgi?id=68998">Bug 68998</a> |
31 | 59 |
32 <iframe src="resources/search.html" onload="runTest()"> | 60 <iframe src="resources/search.html" onload="runTest()"> |
33 </body> | 61 </body> |
34 </html> | 62 </html> |
OLD | NEW |