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

Unified Diff: chrome/renderer/resources/extension_apitest.js

Issue 199074: Don't allow updating tabs to javascript URLs without host (Closed)
Patch Set: Remove unchanged file Created 11 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: chrome/renderer/resources/extension_apitest.js
diff --git a/chrome/renderer/resources/extension_apitest.js b/chrome/renderer/resources/extension_apitest.js
index 9e4ed5e2a257c148ed627a4ef337e9fd185fb769..7b2d5837871861f38eb99939f84522f37d7eae46 100644
--- a/chrome/renderer/resources/extension_apitest.js
+++ b/chrome/renderer/resources/extension_apitest.js
@@ -151,8 +151,12 @@ var chrome = chrome || {};
// Wrapper for generating test functions, that takes care of calling
// assertNoLastError() and (optionally) succeed() for you.
chrome.test.callback = function(func, expectedError) {
- chrome.test.assertEq(typeof(func), 'function');
+ if (func) {
+ chrome.test.assertEq(typeof(func), 'function');
+ }
+
callbackAdded();
+
return function() {
if (expectedError == null) {
chrome.test.assertNoLastError();
@@ -160,7 +164,11 @@ var chrome = chrome || {};
chrome.test.assertEq(typeof(expectedError), 'string');
chrome.test.assertEq(expectedError, chrome.extension.lastError.message);
}
- safeFunctionApply(func, arguments);
+
+ if (func) {
+ safeFunctionApply(func, arguments);
+ }
+
callbackCompleted();
};
};
@@ -179,8 +187,8 @@ var chrome = chrome || {};
return chrome.test.callback(func);
};
- chrome.test.callbackFail = function(func, expectedError) {
- return chrome.test.callback(func, expectedError);
+ chrome.test.callbackFail = function(expectedError) {
+ return chrome.test.callback(null, expectedError);
};
// TODO(erikkay) This is deprecated and should be removed.

Powered by Google App Engine
This is Rietveld 408576698