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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/budget/reserve.html

Issue 2642873002: Moves mojo.define -> gin.define. (Closed)
Patch Set: rebaseline Created 3 years, 11 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
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Budget API: Make basic reserve calls.</title> 4 <title>Budget API: Make basic reserve calls.</title>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="/js-test-resources/mojo-helpers.js"></script> 7 <script src="/js-test-resources/mojo-helpers.js"></script>
8 <script src="budget-service-mock.js"></script> 8 <script src="budget-service-mock.js"></script>
9 </head> 9 </head>
10 <body> 10 <body>
11 <script> 11 <script>
12 if (!window.mojo)
13 debug('This test can not run without mojo');
14
15 promise_test(function() { 12 promise_test(function() {
16 return budgetServiceMock.then(mock => { 13 return budgetServiceMock.then(mock => {
17 assert_own_property(Navigator.prototype, 'budget'); 14 assert_own_property(Navigator.prototype, 'budget');
18 mock.setReserveSuccess(true); 15 mock.setReserveSuccess(true);
19 return navigator.budget.reserve("silent-push"); 16 return navigator.budget.reserve("silent-push");
20 }).then(success => { 17 }).then(success => {
21 assert_equals(success, true); 18 assert_equals(success, true);
22 }); 19 });
23 }, 'BudgetService.Reserve should return correct results.'); 20 }, 'BudgetService.Reserve should return correct results.');
24 21
25 promise_test(function() { 22 promise_test(function() {
26 return budgetServiceMock.then(mock => { 23 return budgetServiceMock.then(mock => {
27 assert_own_property(Navigator.prototype, 'budget'); 24 assert_own_property(Navigator.prototype, 'budget');
28 return navigator.budget.reserve("frobinator"); 25 return navigator.budget.reserve("frobinator");
29 }).then(success => { 26 }).then(success => {
30 assert_unreached('reserve should have failed with an invalid argument. '); 27 assert_unreached('reserve should have failed with an invalid argument. ');
31 }, function(error) { 28 }, function(error) {
32 assert_equals(error.name, 'TypeError'); 29 assert_equals(error.name, 'TypeError');
33 assert_equals(error.message, "Failed to execute 'reserve' on 'BudgetSe rvice': The provided value 'frobinator' is not a valid enum value of type Operat ionType."); 30 assert_equals(error.message, "Failed to execute 'reserve' on 'BudgetSe rvice': The provided value 'frobinator' is not a valid enum value of type Operat ionType.");
34 }); 31 });
35 }, 'BudgetService.Reserve should return Type Error if an invalid argument is provided.'); 32 }, 'BudgetService.Reserve should return Type Error if an invalid argument is provided.');
36 </script> 33 </script>
37 </body> 34 </body>
38 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698