Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aborting fetch #6484

Merged
merged 13 commits into from
Aug 2, 2017
2 changes: 1 addition & 1 deletion fetch/api/abort/cache.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
}, "Signals are not stored in the cache API, even if they're already aborted");
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion fetch/api/abort/general-serviceworker.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
})();
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion fetch/api/abort/general.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I found generating multiple tests with a wrapper simpler than contextualTestName: see https://github.com/w3c/web-platform-tests/tree/master/streams readme and https://github.com/w3c/web-platform-tests/blob/master/streams/generate-test-wrappers.js

</script>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions fetch/api/abort/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,6 @@ test(t => {
});

assert_true(!!cancelReason, 'Cancel called sync');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test makes sense. Can we not assert anything more specific about cancelReason than that it's truthy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh, that's supposed to be the next two lines. Copy & paste error.

assert_equals(err.constructor, DOMException);
assert_equals(err.name, 'AbortError');
assert_equals(cancelReason.constructor, DOMException);
assert_equals(cancelReason.name, 'AbortError');
}, contextualTestName("Readable stream synchronously cancels with AbortError if aborted before reading"));
2 changes: 1 addition & 1 deletion fetch/api/abort/serviceworker-intercepted.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@
}, "Stream errors once aborted.");
</script>
</body>
</html>
</html>
6 changes: 5 additions & 1 deletion fetch/api/resources/basic.html
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<!DOCTYPE html>
<!DOCTYPE html>
<!--
Duplicating this resource to make service worker scoping simpler in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Duplicating /common/blank.html..."

serviceworker-intercepted.https.html
-->
2 changes: 1 addition & 1 deletion fetch/api/resources/sw-intercept.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ async function broadcast(msg) {
addEventListener('fetch', event => {
event.waitUntil(broadcast(event.request.url));
event.respondWith(fetch(event.request));
});
});