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

Unified Diff: LayoutTests/fast/events/init-serviceworker-message-event.html

Issue 1130113006: ServiceWorker: Introduce ServiceWorkerMessageEvent to replace MessageEvent (3/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add initEvent tests Created 5 years, 7 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: LayoutTests/fast/events/init-serviceworker-message-event.html
diff --git a/LayoutTests/fast/events/init-serviceworker-message-event.html b/LayoutTests/fast/events/init-serviceworker-message-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..b853a5a7a8fc1949caca079a9f7cb73368d6034f
--- /dev/null
+++ b/LayoutTests/fast/events/init-serviceworker-message-event.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Checks that initServiceWorkerMessageEvent() is working");
+
+var newEvent;
+function runTest() {
falken 2015/05/18 03:40:23 why is this a function?
+ port = new MessageChannel().port1;
falken 2015/05/18 03:40:23 let's make this a var
+ newEvent = document.createEvent("ServiceWorkerMessageEvent");
+ shouldThrow('newEvent.initServiceWorkerMessageEvent("message", true, true, "ff", "*", 43, port, {x:1});', '"TypeError: Failed to execute \'initServiceWorkerMessageEvent\' on \'ServiceWorkerMessageEvent\': The 8th argument is neither an array, nor does it have indexed properties."');
+ shouldNotThrow('newEvent.initServiceWorkerMessageEvent("message", true, true, "ff", "*", 43, port, null)');
+ shouldBeType(newEvent, ServiceWorkerMessageEvent);
+}
+
+runTest();
+</script>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698