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

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

Issue 2347473005: Make required dictionary members non-nullable again (Closed)
Patch Set: rm TouchInit, add tests Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-event-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-event-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..a778ed1f581c308bc5c247ca0dcd8f418cffa049
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-event-worker.js
@@ -0,0 +1,31 @@
+self.addEventListener('install', function(event) {
+ test(function() {
+ assert_throws(new TypeError(), function() {
+ new ForeignFetchEvent('type');
+ });
+ }, 'ForeignFetchEvent constructor with no init dict');
+
+ test(function() {
+ assert_throws(new TypeError(), function() {
+ new ForeignFetchEvent('type', {});
+ });
+ }, 'ForeignFetchEvent constructor with empty init dict');
+
+ test(function() {
+ assert_throws(new TypeError(), function() {
+ new ForeignFetchEvent('type', { request: null });
+ });
+ }, 'ForeignFetchEvent constructor with null request');
+
+ test(function() {
+ var request = new Request('https://www.example.com/');
+ var event = new ForeignFetchEvent('type', { request: request, origin: 'origin' });
+ assert_equals(event.type, 'type');
+ assert_equals(event.request, request);
+ assert_equals(event.origin, 'origin');
+ }, 'ForeignFetchEvent constructor with all init dict members');
+ });
+
+// Import testharness after install handler to make sure our install handler
+// runs first. Otherwise only one test will run.
+importScripts('../../resources/testharness.js');

Powered by Google App Engine
This is Rietveld 408576698