aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-06-23 02:45:19 -0700
committerGitHub <noreply@github.com>2017-06-23 02:45:19 -0700
commit9c08a7b5c4e9d10f26207a8efec5f39fe73c6d01 (patch)
tree8ff1118e83388935ce581fc40faa248d766db48f
parent626c029623fea999fd7ea8650a6df8859ac87fcd (diff)
parent030e01c1d1ebad6037ad3111efd6495200a2d1a1 (diff)
downloadservo-9c08a7b5c4e9d10f26207a8efec5f39fe73c6d01.tar.gz
servo-9c08a7b5c4e9d10f26207a8efec5f39fe73c6d01.zip
Auto merge of #17475 - asajeffrey:wpt-workers-exception-handling, r=jdm
Added exception-handling to worker wpt tests. <!-- Please describe your changes on the following line: --> Added exception-handling to worker wpt tests. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15668 and #17460 - [X] These changes do not require tests because these are tests <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17475) <!-- Reviewable:end -->
-rw-r--r--tests/wpt/metadata/MANIFEST.json4
-rw-r--r--tests/wpt/metadata/workers/Worker_ErrorEvent_error.htm.ini2
-rw-r--r--tests/wpt/metadata/workers/data-url.html.ini1
-rw-r--r--tests/wpt/web-platform-tests/workers/Worker_ErrorEvent_error.htm4
-rw-r--r--tests/wpt/web-platform-tests/workers/data-url.html4
5 files changed, 9 insertions, 6 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index a71ce142ff9..85498461e09 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -615810,7 +615810,7 @@
"testharness"
],
"workers/Worker_ErrorEvent_error.htm": [
- "975ca8b575fb2f616623b810696287513b164d2d",
+ "43f1cd277819f57c7708690ff3a91dde8b2a3af5",
"testharness"
],
"workers/Worker_ErrorEvent_filename.htm": [
@@ -616102,7 +616102,7 @@
"testharness"
],
"workers/data-url.html": [
- "50abaf936cfb58ba14e6870c9b7f239f5d54f59c",
+ "a9084f9a3b6fc31d54b564b80869826f132f1166",
"testharness"
],
"workers/interfaces.idl": [
diff --git a/tests/wpt/metadata/workers/Worker_ErrorEvent_error.htm.ini b/tests/wpt/metadata/workers/Worker_ErrorEvent_error.htm.ini
deleted file mode 100644
index f58936a3ebd..00000000000
--- a/tests/wpt/metadata/workers/Worker_ErrorEvent_error.htm.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[Worker_ErrorEvent_error.htm]
- expected: ERROR
diff --git a/tests/wpt/metadata/workers/data-url.html.ini b/tests/wpt/metadata/workers/data-url.html.ini
index 315740342a1..ddcfc38e63b 100644
--- a/tests/wpt/metadata/workers/data-url.html.ini
+++ b/tests/wpt/metadata/workers/data-url.html.ini
@@ -1,6 +1,5 @@
[data-url.html]
type: testharness
- expected: ERROR
[worker has opaque origin]
expected: FAIL
diff --git a/tests/wpt/web-platform-tests/workers/Worker_ErrorEvent_error.htm b/tests/wpt/web-platform-tests/workers/Worker_ErrorEvent_error.htm
index 1c1257d1bd2..b7a7f549c83 100644
--- a/tests/wpt/web-platform-tests/workers/Worker_ErrorEvent_error.htm
+++ b/tests/wpt/web-platform-tests/workers/Worker_ErrorEvent_error.htm
@@ -4,6 +4,10 @@
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
+// The worker events races with the window's load event; if the worker events
+// arrive first, the harness will detect the error event and fail the test.
+setup({ allow_uncaught_exception: true });
+
var t1 = async_test("Error handler outside the worker should not see the error value");
var t2 = async_test("Error handlers inside a worker should see the error value");
diff --git a/tests/wpt/web-platform-tests/workers/data-url.html b/tests/wpt/web-platform-tests/workers/data-url.html
index 3a4eb6c705c..306eaf92b5e 100644
--- a/tests/wpt/web-platform-tests/workers/data-url.html
+++ b/tests/wpt/web-platform-tests/workers/data-url.html
@@ -25,7 +25,9 @@ function assert_worker_construction_fails(test_desc, mime_type, worker_code) {
w.onmessage = t.step_func_done(function(e) {
assert_unreached('Should not receive any message back.');
});
- w.onerror = t.step_func_done(function() {
+ w.onerror = t.step_func_done(function(e) {
+ // Stop the error from being propagated to the WPT test harness
+ e.preventDefault();
});
}, test_desc);
}