Changeset 278520 in webkit
- Timestamp:
- Jun 4, 2021, 9:39:39 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278519 r278520 1 2021-06-04 Chris Dumez <cdumez@apple.com> 2 3 Worker.constructor throws an exception when the url param is an empty string 4 https://bugs.webkit.org/show_bug.cgi?id=226637 5 6 Reviewed by Darin Adler. 7 8 Update existing tests to reflect behavior change. 9 10 * fast/workers/worker-constructor-expected.txt: 11 * fast/workers/worker-constructor.html: 12 * http/tests/workers/worker-invalid-url-expected.txt: 13 * http/tests/workers/worker-invalid-url.html: 14 1 15 2021-06-04 Diego Pino Garcia <dpino@igalia.com> 2 16 -
trunk/LayoutTests/fast/workers/worker-constructor-expected.txt
r219663 r278520 1 CONSOLE MESSAGE: SyntaxError: Unexpected token '<' 1 2 Test Worker constructor functionality. Should print a series of PASS messages, followed with DONE. 2 3 … … 4 5 PASS: trying to create workers recursively resulted in an exception (RangeError: Maximum call stack size exceeded.) 5 6 PASS: invoking Worker constructor without arguments resulted in an exception (TypeError: Not enough arguments) 6 PASS: invoking Worker constructor with empty script URL resulted in an exception (SyntaxError: The string did not match the expected pattern.)7 PASS: onerror invoked for an empty script URL. 7 8 PASS: invoking Worker constructor with invalid script URL resulted in an exception (SyntaxError: The string did not match the expected pattern.) 8 9 PASS: onerror invoked for a script that could not be loaded. -
trunk/LayoutTests/fast/workers/worker-constructor.html
r124680 r278520 73 73 var worker = new Worker(""); 74 74 worker.onerror = function() { 75 log(" FAIL: onerror invoked for an empty script URL.");75 log("PASS: onerror invoked for an empty script URL."); 76 76 runNextTest(); 77 77 } 78 78 } catch (ex) { 79 log(" PASS: invoking Worker constructor with empty script URL resulted in an exception (" + ex + ")");79 log("FAIL: invoking Worker constructor with empty script URL resulted in an exception (" + ex + ")"); 80 80 runNextTest(); 81 81 } -
trunk/LayoutTests/http/tests/workers/worker-invalid-url-expected.txt
r88575 r278520 1 Test worker invalid url exceptions. Should print two "PASS" statements.1 Test worker invalid url exceptions. Should print one "PASS" statement. 2 2 3 3 PASS: Got security error. 4 PASS: Got syntax error.5 4 -
trunk/LayoutTests/http/tests/workers/worker-invalid-url.html
r120167 r278520 1 1 <html> 2 2 <body> 3 <p>Test worker invalid url exceptions. Should print two "PASS" statements.</p>3 <p>Test worker invalid url exceptions. Should print one "PASS" statement.</p> 4 4 <div id=result></div> 5 5 <script> … … 21 21 log("FAIL: Got error code " + error.code + ". Expected error code 18."); 22 22 } 23 24 try {25 new Worker("");26 log("FAIL: No exception throw when accessing an invalid url.");27 } catch (error) {28 if (error.code == 12)29 log("PASS: Got syntax error.");30 else31 log("FAIL: Got error code " + error.code + ". Expected error code 12.");32 }33 23 </script> 34 24 </body> -
trunk/LayoutTests/imported/w3c/ChangeLog
r278477 r278520 1 2021-06-04 Chris Dumez <cdumez@apple.com> 2 3 Worker.constructor throws an exception when the url param is an empty string 4 https://bugs.webkit.org/show_bug.cgi?id=226637 5 6 Reviewed by Darin Adler. 7 8 Rebaseline WPT test now that it is passing. 9 10 * web-platform-tests/workers/constructors/Worker/Worker-constructor-expected.txt: 11 1 12 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/constructors/Worker/Worker-constructor-expected.txt
r267649 r278520 3 3 PASS Test recursive Worker creation. 4 4 PASS Test worker creation with no arguments 5 FAIL Test Worker creation with empty script URL. The string did not match the expected pattern.5 PASS Test Worker creation with empty script URL. 6 6 PASS Test invalid script URL. 7 7 PASS Test not existent script URL. -
trunk/Source/WebCore/ChangeLog
r278518 r278520 1 2021-06-04 Chris Dumez <cdumez@apple.com> 2 3 Worker.constructor throws an exception when the url param is an empty string 4 https://bugs.webkit.org/show_bug.cgi?id=226637 5 6 Reviewed by Darin Adler. 7 8 Stop throwing an exception if the Worker constructor gets called with an empty string. 9 Instead treat it as a relative URL, like Chrome and Firefox do. 10 11 No new tests, updated existing ones. 12 13 * workers/AbstractWorker.cpp: 14 (WebCore::AbstractWorker::resolveURL): 15 1 16 2021-06-04 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/workers/AbstractWorker.cpp
r243887 r278520 43 43 ExceptionOr<URL> AbstractWorker::resolveURL(const String& url, bool shouldBypassMainWorldContentSecurityPolicy) 44 44 { 45 if (url.isEmpty())46 return Exception { SyntaxError };47 48 45 auto& context = *scriptExecutionContext(); 49 46
Note:
See TracChangeset
for help on using the changeset viewer.