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

Unified Diff: chrome/test/data/extensions/api_test/tabs/basics/muted.js

Issue 1233263002: Clean up error handling logic for extension tab muting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues from #4. Also use tab_constants for error strings." Created 5 years, 5 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: chrome/test/data/extensions/api_test/tabs/basics/muted.js
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/muted.js b/chrome/test/data/extensions/api_test/tabs/basics/muted.js
index 6487325f95811273a99361c1bd3ae46b0da954c8..1dcfd213484f39597ba52a4a38162debccf81dc1 100644
--- a/chrome/test/data/extensions/api_test/tabs/basics/muted.js
+++ b/chrome/test/data/extensions/api_test/tabs/basics/muted.js
@@ -30,8 +30,7 @@ chrome.test.runTests([
},
function testStaysMutedAfterChangingWindow() {
- chrome.windows.create({}, pass(function(window)
- {
+ chrome.windows.create({}, pass(function(window) {
chrome.tabs.move(testTabId_, {windowId: window.id, index: -1},
pass(function(tab) {
assertEq(true, tab.muted);
@@ -42,5 +41,16 @@ chrome.test.runTests([
function makeNotMuted() {
onUpdatedExpect("muted", false, {mutedCause: chrome.runtime.id});
chrome.tabs.update(testTabId_, {muted: false}, pass());
+ },
+
+ // Prior tests in this file have already toggled the muted state twice.
+ // We update a third (and final) time before rate limiting kicks in.
+ function frequentRequestsRateLimited() {
+ chrome.tabs.update(testTabId_, {muted: true}, pass());
+ chrome.tabs.update(testTabId_, {muted: false}, function(tab) {
+ var errMsg = "Rate limit exceeded when updating mute state for tab " +
+ testTabId_ + ".";
+ chrome.test.assertLastError(errMsg);
miu 2015/07/18 00:42:42 To answer your question: Yes, this is better than
Jared Sohn 2015/07/18 23:57:24 I have added a new test case to show that setting
+ });
}
]);
« chrome/browser/ui/tabs/tab_utils.cc ('K') | « chrome/common/extensions/api/tabs.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698