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

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

Issue 2309863002: Plumb reserve method of the BudgetAPI (Closed)
Patch Set: Rename BudgetServiceErrorType::NO_ERROR to ::NONE to avoid Windows constant name clash. Created 4 years, 3 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/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 b0a2ed786eae8f69d2bc776d8164ee4914fa798b..faafdc685c4428e47e44dfb41d3b86e2a2fb6836 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
@@ -38,6 +38,14 @@ self.addEventListener('message', function(workerEvent) {
}).catch(makeErrorHandler(event.data.command));
break;
+ case 'reserve':
+ navigator.budget.reserve('silent-push').then(success => {
+ port.postMessage({
+ command: event.data.command,
+ success: success });
+ }).catch(makeErrorHandler(event.data.command));
+ break;
+
default:
port.postMessage({
command: 'error',

Powered by Google App Engine
This is Rietveld 408576698