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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/elements-panel-rewrite-href.html

Issue 2265823002: DevTools: fix instances where asParsedURL is null (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix instances with parsedURL Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <link rel="stylesheet" src="/bogusSheet1.css"> 4 <link rel="stylesheet" src="/bogusSheet1.css">
5 <link rel="stylesheet" src="bogusSheet2.css"> 5 <link rel="stylesheet" src="bogusSheet2.css">
6 <script src="../../http/tests/inspector/inspector-test.js"></script> 6 <script src="../../http/tests/inspector/inspector-test.js"></script>
7 <script src="../../http/tests/inspector/elements-test.js"></script> 7 <script src="../../http/tests/inspector/elements-test.js"></script>
8 <script> 8 <script>
9 9
10 function test() 10 function test()
(...skipping 11 matching lines...) Expand all
22 var href = node.resolveURL(node.getAttribute("src") || node.getA ttribute("href")); 22 var href = node.resolveURL(node.getAttribute("src") || node.getA ttribute("href"));
23 if (!href) { 23 if (!href) {
24 segments.push("<empty>"); 24 segments.push("<empty>");
25 continue; 25 continue;
26 } 26 }
27 if (href.startsWith("http:")) { 27 if (href.startsWith("http:")) {
28 InspectorTest.addResult(href); 28 InspectorTest.addResult(href);
29 continue; 29 continue;
30 } 30 }
31 var parsedURL = href.asParsedURL(); 31 var parsedURL = href.asParsedURL();
32 if (!parsedURL) 32 if (!parsedURL) {
33 testController.notifyDone("FAIL: no URL match for <" + href + ">"); 33 testController.notifyDone("FAIL: no URL match for <" + href + ">");
34 continue;
35 }
34 var split = parsedURL.path.split("/"); 36 var split = parsedURL.path.split("/");
35 for (var i = split.length - 1, j = 0; j < 3 && i >= 0; --i, ++j) 37 for (var i = split.length - 1, j = 0; j < 3 && i >= 0; --i, ++j)
36 segments.push(split[i]); 38 segments.push(split[i]);
37 InspectorTest.addResult(segments.reverse()); 39 InspectorTest.addResult(segments.reverse());
38 } 40 }
39 if (node.nodeName() === "A") 41 if (node.nodeName() === "A")
40 InspectorTest.addResult(node.resolveURL(node.getAttribute("href" ))); 42 InspectorTest.addResult(node.resolveURL(node.getAttribute("href" )));
41 } 43 }
42 InspectorTest.completeTest(); 44 InspectorTest.completeTest();
43 } 45 }
44 } 46 }
45 47
46 </script> 48 </script>
47 </head> 49 </head>
48 50
49 <body> 51 <body>
50 <p> 52 <p>
51 Tests that src and href element targets are rewritten properly. 53 Tests that src and href element targets are rewritten properly.
52 </p> 54 </p>
53 55
54 <a style="display:none" href=" javascript:alert('foo') "></a> 56 <a style="display:none" href=" javascript:alert('foo') "></a>
55 <iframe src="resources/elements-panel-rewrite-href-iframe.html" onload="runTest( )"></iframe> 57 <iframe src="resources/elements-panel-rewrite-href-iframe.html" onload="runTest( )"></iframe>
56 </body> 58 </body>
57 </html> 59 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698