Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html b/third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..45febb68382926a419c3d93e792b1847717b8e51 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/budget/interfaces.html |
| @@ -0,0 +1,32 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Budget API: Verifies that the right Budget API interfaces get exposed.</title> |
| + <script src="../resources/testharness.js"></script> |
| + <script src="../resources/testharnessreport.js"></script> |
| + </head> |
| + <body> |
| + <script> |
| + promise_test(function() { |
| + assert_own_property(Navigator.prototype, 'budget'); |
| + assert_own_property(Budget.prototype, 'getCost'); |
| + assert_own_property(Budget.prototype, 'getBudget'); |
| + |
|
Peter Beverloo
2016/08/05 14:33:19
nit: consider testing
assert_equals(navigator.b
harkness
2016/08/08 12:07:36
Done.
|
| + navigator.budget.getCost() |
| + .then(function(cost) { |
| + assert_unreached('getCost should have failed.'); |
| + }, function(error) { |
| + assert_equals(error.name, 'NotSupportedError'); |
| + assert_equals(error.message, 'Not yet implemented'); |
| + }); |
| + navigator.budget.getBudget() |
| + .then(function(cost) { |
| + assert_unreached('getBudget should have failed.'); |
| + }, function(error) { |
| + assert_equals(error.name, 'NotSupportedError'); |
| + assert_equals(error.message, 'Not yet implemented'); |
| + }); |
| + }, 'NavigatorBudget should be exposed and have the expected interface in a Document.'); |
| + </script> |
| + </body> |
| +</html> |