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

Side by Side Diff: LayoutTests/inspector/filtered-item-selection-dialog-rendering.html

Issue 1095153002: DevTools: fix inspector/filter-item-selection-dialog-rendering.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/filtered-item-selection-dialog-rendering-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script src="../http/tests/inspector/sources-test.js"></script> 4 <script src="../http/tests/inspector/sources-test.js"></script>
5 <script>function dummy1() { } 5 <script>function dummy1() { }
6 //# sourceURL=http://test/helloWorld12.js 6 //# sourceURL=http://test/helloWorld12.js
7 </script> 7 </script>
8 <script>function dummy2() { } 8 <script>function dummy2() { }
9 //# sourceURL=http://test/some/very-long-url/which/usually/breaks-rendering/due- to/trancation/so/that/the-path-is-cut-appropriately/and-no-horizontal-scrollbars /are-shown.js 9 //# sourceURL=http://test/some/very-long-url/which/usually/breaks-rendering/due- to/trancation/so/that/the-path-is-cut-appropriately/and-no-horizontal-scrollbars /are-shown.js
10 </script> 10 </script>
11 <script> 11 <script>
12 function test() 12 function test()
13 { 13 {
14 setTimeout(InspectorTest.completeTest.bind(InspectorTest), 2000);
15
16 var delegate = new WebInspector.SelectUISourceCodeDialog(); 14 var delegate = new WebInspector.SelectUISourceCodeDialog();
17 15
18 InspectorTest.runTestSuite([ 16 InspectorTest.runTestSuite([
19 function testRenderingInNameOnly(next) 17 function testRenderingInNameOnly(next)
20 { 18 {
21 checkQuery("12"); 19 checkQuery("12");
22 next(); 20 next();
23 }, 21 },
24 22
25 function testRenderingInPathAndName(next) 23 function testRenderingInPathAndName(next)
(...skipping 13 matching lines...) Expand all
39 checkQuery("usually-shown.js"); 37 checkQuery("usually-shown.js");
40 next(); 38 next();
41 }, 39 },
42 ]); 40 ]);
43 41
44 function checkQuery(query) 42 function checkQuery(query)
45 { 43 {
46 InspectorTest.addResult("filter query: " + query); 44 InspectorTest.addResult("filter query: " + query);
47 var titleElement = document.createElement("div"); 45 var titleElement = document.createElement("div");
48 var subtitleElement = document.createElement("div"); 46 var subtitleElement = document.createElement("div");
47 var outputs = [];
49 for (var i = 0; i < delegate.itemCount(); ++i) { 48 for (var i = 0; i < delegate.itemCount(); ++i) {
50 delegate.renderItem(i, query, titleElement, subtitleElement); 49 delegate.renderItem(i, query, titleElement, subtitleElement);
51 if (!subtitleElement.textContent.startsWith("test/")) 50 if (!subtitleElement.textContent.startsWith("test/"))
52 continue; 51 continue;
53 dumpRenderedElement(titleElement); 52 var text = elementHighlightedText(titleElement);
54 dumpRenderedElement(subtitleElement); 53 text += "\n" + elementHighlightedText(subtitleElement);
55 InspectorTest.addResult("--------------------"); 54 outputs.push(text);
56 } 55 }
56 outputs.sort();
57 InspectorTest.addResult(outputs.join("\n--------------------\n"));
57 } 58 }
58 59
59 function dumpRenderedElement(element) 60 function elementHighlightedText(element)
60 { 61 {
61 var text = ""; 62 var text = "";
62 for (var i = 0; i < element.childNodes.length; ++i) { 63 for (var i = 0; i < element.childNodes.length; ++i) {
63 var node = element.childNodes[i]; 64 var node = element.childNodes[i];
64 if (node.nodeType === Node.TEXT_NODE) 65 if (node.nodeType === Node.TEXT_NODE)
65 text += node.textContent; 66 text += node.textContent;
66 else 67 else
67 text += String.sprintf("[%s]", node.textContent); 68 text += String.sprintf("[%s]", node.textContent);
68 } 69 }
69 InspectorTest.addResult(text); 70 return text;
70 } 71 }
71 } 72 }
72 </script> 73 </script>
73 </head> 74 </head>
74 75
75 <body onload="runTest()"> 76 <body onload="runTest()">
76 <p> 77 <p>
77 Verifies that SelectUISourceCodeDialog rendering works properly. 78 Verifies that SelectUISourceCodeDialog rendering works properly.
78 </p> 79 </p>
79 80
80 </body> 81 </body>
81 </html> 82 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/filtered-item-selection-dialog-rendering-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698