| 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 promise_test(function() { |
| 11 assert_own_property(Navigator.prototype, 'budget'); | 11 assert_own_property(Navigator.prototype, 'budget'); |
| 12 assert_own_property(Budget.prototype, 'getCost'); | 12 assert_own_property(BudgetService.prototype, 'getCost'); |
| 13 assert_own_property(Budget.prototype, 'getBudget'); | 13 assert_own_property(BudgetService.prototype, 'getBudget'); |
| 14 assert_equals(navigator.budget, navigator.budget); | 14 assert_equals(navigator.budget, navigator.budget); |
| 15 | 15 |
| 16 navigator.budget.getCost() | 16 navigator.budget.getCost() |
| 17 .then(function(cost) { | 17 .then(function(cost) { |
| 18 assert_unreached('getCost should have failed.'); | 18 assert_unreached('getCost should have failed.'); |
| 19 }, function(error) { | 19 }, function(error) { |
| 20 assert_equals(error.name, 'NotSupportedError'); | 20 assert_equals(error.name, 'NotSupportedError'); |
| 21 assert_equals(error.message, 'Not yet implemented'); | 21 assert_equals(error.message, 'Not yet implemented'); |
| 22 }); | 22 }); |
| 23 navigator.budget.getBudget() | 23 navigator.budget.getBudget() |
| 24 .then(function(cost) { | 24 .then(function(cost) { |
| 25 assert_unreached('getBudget should have failed.'); | 25 assert_unreached('getBudget should have failed.'); |
| 26 }, function(error) { | 26 }, function(error) { |
| 27 assert_equals(error.name, 'NotSupportedError'); | 27 assert_equals(error.name, 'NotSupportedError'); |
| 28 assert_equals(error.message, 'Not yet implemented'); | 28 assert_equals(error.message, 'Not yet implemented'); |
| 29 }); | 29 }); |
| 30 }, 'NavigatorBudget should be exposed and have the expected interface in a
Document.'); | 30 }, 'NavigatorBudget should be exposed and have the expected interface in a
Document.'); |
| 31 </script> | 31 </script> |
| 32 </body> | 32 </body> |
| 33 </html> | 33 </html> |
| OLD | NEW |