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

Unified Diff: chrome/renderer/resources/extensions/apitest.js

Issue 12218019: Check that callbackAdded callbacks are only called once. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/apitest.js
diff --git a/chrome/renderer/resources/extensions/apitest.js b/chrome/renderer/resources/extensions/apitest.js
index 6d8ea0ebb5ad363350e87a5ec7c6f16fd102734e..16bc078aa1a991533736a0929b3544b36a97c603 100644
--- a/chrome/renderer/resources/extensions/apitest.js
+++ b/chrome/renderer/resources/extensions/apitest.js
@@ -45,7 +45,11 @@
chrome.test.callbackAdded = function() {
pendingCallbacks++;
+ var called = false;
return function() {
+ chrome.test.assertFalse(called, 'callback has already been run');
+ called = true;
+
pendingCallbacks--;
if (pendingCallbacks == 0) {
chrome.test.succeed();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698