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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js

Issue 2571453002: Expose the BudgetService interface to Workers. (Closed)
Patch Set: Rebase Created 4 years 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/http/tests/budget/resources/instrumentation-service-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js b/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
index faafdc685c4428e47e44dfb41d3b86e2a2fb6836..c4491ec18e191abe9c78231046a2f40cf57669fc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
+++ b/third_party/WebKit/LayoutTests/http/tests/budget/resources/instrumentation-service-worker.js
@@ -46,6 +46,24 @@ self.addEventListener('message', function(workerEvent) {
}).catch(makeErrorHandler(event.data.command));
break;
+ case 'checkInterfaces':
+ let success = false;
+ let message = "";
+ try {
+ success = 'BudgetService' in self &&
+ WorkerNavigator.prototype.hasOwnProperty('budget') &&
+ BudgetService.prototype.hasOwnProperty('getCost') &&
+ BudgetService.prototype.hasOwnProperty('getBudget') &&
+ BudgetService.prototype.hasOwnProperty('reserve')
+ } catch(err) {
+ message = err.message;
+ }
+ port.postMessage({
+ command: event.data.command,
+ success: success,
+ message: message});
+ break;
+
default:
port.postMessage({
command: 'error',

Powered by Google App Engine
This is Rietveld 408576698