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
|
} |
/* |