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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js

Issue 2912593003: [ServiceWorker] Fix bugs of wpt tests for Client.navigate (Closed)
Patch Set: Fix other tests influnced by changes of testharness.js Created 3 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: third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js b/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js
index 73913d6d32c3178be1a33d9c3a534afd8bbdffce..165a17f346d7fecb960458e722e382253fd4beef 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js
@@ -483,7 +483,10 @@ policies and contribution forms [3].
}
function is_service_worker(worker) {
- return 'ServiceWorker' in self && worker instanceof ServiceWorker;
+ // The worker object may be from other execution context,
falken 2017/05/29 01:07:04 s/other/another
leonhsl(Using Gerrit) 2017/05/29 13:09:54 Acknowledged.
leonhsl(Using Gerrit) 2017/06/10 02:57:44 Done.
+ // so do not use instanceof here.
+ return 'ServiceWorker' in self &&
+ Object.prototype.toString.call(worker) == '[object ServiceWorker]';
leonhsl(Using Gerrit) 2017/05/28 09:12:59 Another optional solution without changing testhar
Mike West 2017/05/29 08:02:44 I'm not sure we can do that via this update mechan
}
/*

Powered by Google App Engine
This is Rietveld 408576698