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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html

Issue 2309863002: Plumb reserve method of the BudgetAPI (Closed)
Patch Set: Rename BudgetServiceErrorType::NO_ERROR to ::NONE to avoid Windows constant name clash. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html b/third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html
index 92839ea2bd93c71e684a6b61337407037f59b58e..1b1758c4a379ab1c3eba73424f87c336d9122d5b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html
+++ b/third_party/WebKit/LayoutTests/http/tests/budget/get-budget.html
@@ -15,6 +15,7 @@
promise_test(function() {
return budgetServiceMock.then(mock => {
assert_own_property(Navigator.prototype, 'budget');
+ mock.addBudget(TEST_BUDGET_TIME, TEST_BUDGET_AT);
return navigator.budget.getBudget();
}).then(budget => {
assert_equals(budget.length, 1);
@@ -22,6 +23,19 @@
assert_equals(budget[0].time, TEST_BUDGET_TIME);
});
}, 'BudgetService.GetBudget should return correct results.');
+
+ promise_test(function() {
+ return budgetServiceMock.then(mock => {
+ assert_own_property(Navigator.prototype, 'budget');
+ mock.setError("database-error");
+ return navigator.budget.getBudget();
+ }).then(budget => {
+ assert_unreached('getBudget should have failed.');
+ }, function(error) {
+ assert_equals(error.name, 'DataError');
+ assert_equals(error.message, "Error reading the budget database.");
+ });
+ }, 'BudgetService.GetBudget should return correct results.');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698