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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-event-worker.js

Issue 2676733002: Upstream foreign fetch tests. (Closed)
Patch Set: rebase Created 3 years, 10 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
OLDNEW
(Empty)
1 self.addEventListener('install', function(event) {
2 test(function() {
3 assert_throws(new TypeError(), function() {
4 new ForeignFetchEvent('type');
5 });
6 }, 'ForeignFetchEvent constructor with no init dict');
7
8 test(function() {
9 assert_throws(new TypeError(), function() {
10 new ForeignFetchEvent('type', {});
11 });
12 }, 'ForeignFetchEvent constructor with empty init dict');
13
14 test(function() {
15 assert_throws(new TypeError(), function() {
16 new ForeignFetchEvent('type', { request: null });
17 });
18 }, 'ForeignFetchEvent constructor with null request');
19
20 test(function() {
21 var request = new Request('https://www.example.com/');
22 var event = new ForeignFetchEvent('type', { request: request, origin: 'o rigin' });
23 assert_equals(event.type, 'type');
24 assert_equals(event.request, request);
25 assert_equals(event.origin, 'origin');
26 }, 'ForeignFetchEvent constructor with all init dict members');
27 });
28
29 // Import testharness after install handler to make sure our install handler
30 // runs first. Otherwise only one test will run.
31 importScripts('../../resources/testharness.js');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698