| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Budget API: Verifies that the right Budget API interfaces get exposed
.</title> | 4 <title>Budget API: Verifies that the right Budget API interfaces get exposed
.</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 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 promise_test(function() { | 10 test(function() { |
| 11 assert_own_property(Navigator.prototype, 'budget'); | 11 assert_own_property(Navigator.prototype, 'budget'); |
| 12 assert_own_property(BudgetService.prototype, 'getCost'); | 12 assert_own_property(BudgetService.prototype, 'getCost'); |
| 13 assert_own_property(BudgetService.prototype, 'getBudget'); | 13 assert_own_property(BudgetService.prototype, 'getBudget'); |
| 14 assert_own_property(BudgetService.prototype, 'reserve'); | 14 assert_own_property(BudgetService.prototype, 'reserve'); |
| 15 assert_equals(navigator.budget, navigator.budget); | 15 assert_equals(navigator.budget, navigator.budget); |
| 16 | |
| 17 navigator.budget.getCost() | |
| 18 .then(function(cost) { | |
| 19 assert_unreached('getCost should have failed.'); | |
| 20 }, function(error) { | |
| 21 assert_equals(error.name, 'NotSupportedError'); | |
| 22 assert_equals(error.message, 'Not yet implemented'); | |
| 23 }); | |
| 24 navigator.budget.getBudget() | |
| 25 .then(function(cost) { | |
| 26 assert_unreached('getBudget should have failed.'); | |
| 27 }, function(error) { | |
| 28 assert_equals(error.name, 'NotSupportedError'); | |
| 29 assert_equals(error.message, 'Not yet implemented'); | |
| 30 }); | |
| 31 navigator.budget.reserve() | |
| 32 .then(function(cost) { | |
| 33 assert_unreached('reserve should have failed.'); | |
| 34 }, function(error) { | |
| 35 assert_equals(error.name, 'NotSupportedError'); | |
| 36 assert_equals(error.message, 'Not yet implemented'); | |
| 37 }); | |
| 38 }, 'NavigatorBudget should be exposed and have the expected interface in a
Document.'); | 16 }, 'NavigatorBudget should be exposed and have the expected interface in a
Document.'); |
| 39 </script> | 17 </script> |
| 40 </body> | 18 </body> |
| 41 </html> | 19 </html> |
| OLD | NEW |