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

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

Issue 2912593003: [ServiceWorker] Fix bugs of wpt tests for Client.navigate (Closed)
Patch Set: Address comments from falken@ Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/webaudio/autoplay-crossorigin-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bb63e02caf72d48b6151ccfd24f68c24598f0d08..0e6f7608c0f8f6860a6a9a0d880e376158322d5f 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 another execution context,
+ // so do not use instanceof here.
+ return 'ServiceWorker' in self &&
+ Object.prototype.toString.call(worker) == '[object ServiceWorker]';
}
/*
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/webaudio/autoplay-crossorigin-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698