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

Unified Diff: chrome/test/data/extensions/api_test/settings/simple_test/background.html

Issue 8491033: Extension Settings API: throttle the API in the same way that the Bookmarks API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/settings/settings_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/settings/simple_test/background.html
diff --git a/chrome/test/data/extensions/api_test/settings/simple_test/background.html b/chrome/test/data/extensions/api_test/settings/simple_test/background.html
index fd42fe602cc0567fd113ee57081df6e9ee22e0be..8bb3c15d2ae227d2675630847dfefe847648c892 100644
--- a/chrome/test/data/extensions/api_test/settings/simple_test/background.html
+++ b/chrome/test/data/extensions/api_test/settings/simple_test/background.html
@@ -285,6 +285,21 @@ chrome.test.runTests([
succeed();
}
stage0();
+ },
+
+ function throttling() {
+ // Should get throttled after 1000 calls.
+ var maxRequests = 1001;
+ function next() {
+ chrome.experimental.settings.clear((--maxRequests > 0) ? next : done);
+ }
+ function done() {
+ chrome.test.assertEq(
+ "This request exceeds available quota.",
+ chrome.extension.lastError.message);
+ succeed();
+ }
+ chrome.experimental.settings.clear(next);
}
]);
</script>
« no previous file with comments | « chrome/browser/extensions/settings/settings_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698