Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/budget/success-query-path.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/success-query-path.html b/third_party/WebKit/LayoutTests/http/tests/budget/success-query-path.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..930e594154538e92e52aa5c36e2e38b25690a675 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/budget/success-query-path.html |
| @@ -0,0 +1,36 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Budget API: Makes basic getCost and getBudget calls.</title> |
| + <script src="../resources/testharness.js"></script> |
| + <script src="../resources/testharnessreport.js"></script> |
| + <script src="/js-test-resources/mojo-helpers.js"></script> |
| + <script src="budget-service-mock.js"></script> |
| + </head> |
| + <body> |
| + <script> |
| + if (!window.mojo) |
| + debug('This test can not run without mojo'); |
| + |
| + promise_test(function() { |
| + return budgetServiceMock.then(mock => { |
| + assert_own_property(Navigator.prototype, 'budget'); |
| + return navigator.budget.getCost("silent-push"); |
| + }).then(cost => { |
| + assert_equals(cost, TEST_BUDGET_COST); |
| + }); |
| + }, '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
|
| + |
| + promise_test(function() { |
| + return budgetServiceMock.then(mock => { |
| + assert_own_property(Navigator.prototype, 'budget'); |
| + return navigator.budget.getBudget(); |
| + }).then(budget => { |
| + assert_equals(budget.length, 1); |
| + assert_equals(budget[0].budgetAt, TEST_BUDGET_AT); |
| + assert_equals(budget[0].time, TEST_BUDGET_TIME); |
| + }); |
| + }, 'BudgetService mock for GetBudget should return correct results.'); |
| + </script> |
| + </body> |
| +</html> |