Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/resources/testharness.js |
| diff --git a/third_party/WebKit/LayoutTests/resources/testharness.js b/third_party/WebKit/LayoutTests/resources/testharness.js |
| index 73913d6d32c3178be1a33d9c3a534afd8bbdffce..165a17f346d7fecb960458e722e382253fd4beef 100644 |
| --- a/third_party/WebKit/LayoutTests/resources/testharness.js |
| +++ b/third_party/WebKit/LayoutTests/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]'; |
| } |
| /* |