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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/budget/success-query-path.html

Issue 2231873002: Added budget_service.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@budget_api
Patch Set: Converted BudgetChunk dictionary to BudgetState interface and other code review updates 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Budget API: Makes basic getCost and getBudget calls.</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="/js-test-resources/mojo-helpers.js"></script>
8 <script src="budget-service-mock.js"></script>
9 </head>
10 <body>
11 <script>
12 if (!window.mojo)
13 debug('This test can not run without mojo');
14
15 promise_test(function() {
16 return budgetServiceMock.then(mock => {
17 assert_own_property(Navigator.prototype, 'budget');
18 return navigator.budget.getCost("silent-push");
19 }).then(cost => {
20 assert_equals(cost, TEST_BUDGET_COST);
21 });
22 }, 'BudgetService mock for GetCost should return correct results.');
Peter Beverloo 2016/08/22 17:57:55 nit: I would split this up to one test per functio
harkness 2016/08/23 09:38:18 Done. We no longer have success-query-path, instea
23
24 promise_test(function() {
25 return budgetServiceMock.then(mock => {
26 assert_own_property(Navigator.prototype, 'budget');
27 return navigator.budget.getBudget();
28 }).then(budget => {
29 assert_equals(budget.length, 1);
30 assert_equals(budget[0].budgetAt, TEST_BUDGET_AT);
31 assert_equals(budget[0].time, TEST_BUDGET_TIME);
32 });
33 }, 'BudgetService mock for GetBudget should return correct results.');
34 </script>
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698