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

Side by Side Diff: LayoutTests/fast/workers/worker-constructor.html

Issue 84423002: Correctly resolve empty script URLs in Worker constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | LayoutTests/fast/workers/worker-constructor-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 <body> 1 <body>
2 <p>Test Worker constructor functionality. Should print a series of PASS messages , followed with DONE.</p> 2 <p>Test Worker constructor functionality. Should print a series of PASS messages , followed with DONE.</p>
3 <div id=result></div> 3 <div id=result></div>
4 <script> 4 <script>
5 function log(message) 5 function log(message)
6 { 6 {
7 document.getElementById("result").innerHTML += message + "<br>"; 7 document.getElementById("result").innerHTML += message + "<br>";
8 } 8 }
9 9
10 var testCases = [ 10 var testCases = [
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } catch (ex) { 64 } catch (ex) {
65 log("PASS: invoking Worker constructor without arguments resulted in an exception (" + ex + ")"); 65 log("PASS: invoking Worker constructor without arguments resulted in an exception (" + ex + ")");
66 } 66 }
67 runNextTest(); 67 runNextTest();
68 } 68 }
69 69
70 function testEmptyScriptUrl() 70 function testEmptyScriptUrl()
71 { 71 {
72 try { 72 try {
73 var worker = new Worker(""); 73 var worker = new Worker("");
74 worker.onerror = function() { 74 worker.onerror = function(e) {
75 log("FAIL: onerror invoked for an empty script URL."); 75 log("PASS: onerror invoked for an empty script URL, resolving to thi s HTML document's URL.");
76 e.preventDefault();
76 runNextTest(); 77 runNextTest();
77 } 78 }
78 } catch (ex) { 79 } catch (ex) {
79 log("PASS: invoking Worker constructor with empty script URL resulted in an exception (" + ex + ")"); 80 log("FAIL: invoking Worker constructor with empty script URL resulted in a exception (" + ex + ")");
80 runNextTest(); 81 runNextTest();
81 } 82 }
82 } 83 }
83 84
84 function testInvalidScriptUrl() 85 function testInvalidScriptUrl()
85 { 86 {
86 try { 87 try {
87 var worker = new Worker("http://invalid:123$"); 88 var worker = new Worker("http://invalid:123$");
88 worker.onerror = function() { 89 worker.onerror = function() {
89 log("FAIL: onerror invoked for an invalid script URL."); 90 log("FAIL: onerror invoked for an invalid script URL.");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 129
129 if (window.testRunner) { 130 if (window.testRunner) {
130 testRunner.dumpAsText(); 131 testRunner.dumpAsText();
131 testRunner.waitUntilDone(); 132 testRunner.waitUntilDone();
132 } 133 }
133 134
134 runNextTest(); 135 runNextTest();
135 136
136 </script> 137 </script>
137 </body> 138 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/workers/worker-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698