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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/budget/reserve-in-service-worker.html

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/reserve-in-service-worker.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/budget/reserve-in-service-worker.html
similarity index 77%
copy from third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html
copy to third_party/WebKit/LayoutTests/http/tests/budget/reserve-in-service-worker.html
index c1416e80e8a1083277bc36a499eab74e50d194f8..e8112b0276e348f4e4dca0eb564efa822a552d54 100644
--- a/third_party/WebKit/LayoutTests/http/tests/budget/get-cost-in-service-worker.html
+++ b/third_party/WebKit/LayoutTests/http/tests/budget/reserve-in-service-worker.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>getCost succeeds from a Service Worker</title>
+ <title>reserve succeeds from a Service Worker</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../serviceworker/resources/test-helpers.js"></script>
@@ -17,25 +17,25 @@
var port;
budgetServiceMock.then(mock => {
+ mock.setReserveSuccess(true);
getActiveServiceWorkerWithMessagePort(test, script, scope)
.then(function(workerInfo) {
port = workerInfo.port;
- port.postMessage({command: 'getCost'});
+ port.postMessage({ command: 'reserve' });
port.addEventListener('message', function(event) {
if (typeof event.data != 'object' || !event.data.command)
assert_unreached('Invalid message from the service worker');
- assert_equals(event.data.command, 'getCost');
+ assert_equals(event.data.command, 'reserve');
assert_true(event.data.success,
- 'getCost should succeed. Error message: ' + event.data.errorMessage);
- assert_equals(event.data.cost, TEST_BUDGET_COST);
+ 'reserve should succeed. Error message: ' + event.data.errorMessage);
test.done();
});
})
.catch(unreached_rejection(test));
});
- }, 'getCost should succeed from Service Worker');
+ }, 'reserve should succeed from Service Worker');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698