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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.https.html

Issue 2495873002: Manually import wpt@359815a0ff565cb6ca89349f6e9e154789267d8b (Closed)
Patch Set: Add Crash/Timeout expectation for bitmaprenderer-as-imagesource.html Created 4 years, 1 month 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/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.https.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.html b/third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.https.html
similarity index 82%
rename from third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.html
rename to third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.https.html
index 47b536d2198ab0773c1d380f54ccf95194f0860e..8a8a8f67f22fe81479331680944b9dca71f4643b 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/html/webappapis/scripting/events/messageevent-constructor.https.html
@@ -2,6 +2,7 @@
<title>MessageEvent constructor</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
+<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script>
test(function() {
var ev = new MessageEvent("test")
@@ -75,4 +76,21 @@ test(function() {
}, "Calling initMessageEvent with only 7 parameters should throw a TypeError")
}, "All parameters to initMessageEvent should be mandatory")
+promise_test(function(t) {
+ var worker_url = "/service-workers/service-worker/resources/empty-worker.js";
+ var scope = "/service-workers/service-worker/resources/";
+ var registration;
+
+ return service_worker_unregister_and_register(t, worker_url, scope)
+ .then(function(r) {
+ registration = r;
+ return wait_for_state(t, r.installing, "activated");
+ })
+ .then(function() {
+ var ev = new MessageEvent("test", { source: registration.active });
+ assert_equals(ev.source, registration.active, "source attribute should return the ServiceWorker");
+ service_worker_unregister(t, scope);
+ });
+ }, "Passing ServiceWorker for source member");
+
</script>

Powered by Google App Engine
This is Rietveld 408576698