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

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

Issue 2347473005: Make required dictionary members non-nullable again (Closed)
Patch Set: rm TouchInit, add tests Created 4 years, 2 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
1 importScripts('interfaces.js'); 1 importScripts('interfaces.js');
2 importScripts('worker-testharness.js'); 2 importScripts('worker-testharness.js');
3 3
4 var EVENT_HANDLER = 'object'; 4 var EVENT_HANDLER = 'object';
5 5
6 test(function() { 6 test(function() {
7 verify_interface('ServiceWorkerGlobalScope', 7 verify_interface('ServiceWorkerGlobalScope',
8 self, 8 self,
9 { 9 {
10 clients: 'object', 10 clients: 'object',
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 delete: 'function', 65 delete: 'function',
66 keys: 'function' 66 keys: 'function'
67 }); 67 });
68 }); 68 });
69 }, 'Cache'); 69 }, 'Cache');
70 70
71 test(function() { 71 test(function() {
72 assert_equals( 72 assert_equals(
73 new ExtendableEvent('ExtendableEvent').type, 73 new ExtendableEvent('ExtendableEvent').type,
74 'ExtendableEvent', 'Type of ExtendableEvent should be ExtendableEvent'); 74 'ExtendableEvent', 'Type of ExtendableEvent should be ExtendableEvent');
75 assert_throws(new TypeError, function() {
76 new FetchEvent('FetchEvent');
77 }, 'FetchEvent constructor with one argument throws');
78 assert_throws(new TypeError, function() {
79 new FetchEvent('FetchEvent', {});
80 }, 'FetchEvent constructor with empty init dict throws');
81 assert_throws(new TypeError, function() {
82 new FetchEvent('FetchEvent', {request: null});
83 }, 'FetchEvent constructor with null request member throws');
75 var req = new Request('https://www.example.com/', {method: 'POST'}); 84 var req = new Request('https://www.example.com/', {method: 'POST'});
76 assert_equals( 85 assert_equals(
77 new FetchEvent('FetchEvent', {request: req}).type, 86 new FetchEvent('FetchEvent', {request: req}).type,
78 'FetchEvent', 'Type of FetchEvent should be FetchEvent'); 87 'FetchEvent', 'Type of FetchEvent should be FetchEvent');
79 assert_equals( 88 assert_equals(
80 new FetchEvent('FetchEvent', {request: req}).cancelable, 89 new FetchEvent('FetchEvent', {request: req}).cancelable,
81 false, 'Default FetchEvent.cancelable should be false'); 90 false, 'Default FetchEvent.cancelable should be false');
82 assert_equals( 91 assert_equals(
83 new FetchEvent('FetchEvent', {request: req}).bubbles, 92 new FetchEvent('FetchEvent', {request: req}).bubbles,
84 false, 'Default FetchEvent.bubbles should be false'); 93 false, 'Default FetchEvent.bubbles should be false');
(...skipping 22 matching lines...) Expand all
107 true, 116 true,
108 'FetchEvent.isReload with option {isReload: true} should be true'); 117 'FetchEvent.isReload with option {isReload: true} should be true');
109 assert_equals( 118 assert_equals(
110 new FetchEvent( 119 new FetchEvent(
111 'FetchEvent', 120 'FetchEvent',
112 {request: req, isReload: true}).request.url, 121 {request: req, isReload: true}).request.url,
113 'https://www.example.com/', 122 'https://www.example.com/',
114 'FetchEvent.request.url should return the value it was ' + 123 'FetchEvent.request.url should return the value it was ' +
115 'initialized to'); 124 'initialized to');
116 }, 'Event constructors'); 125 }, 'Event constructors');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698