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

Unified Diff: chrome/browser/extensions/extension_function_test_utils.h

Issue 8588067: Refactor to allow same code to test both sync and async functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial 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
Index: chrome/browser/extensions/extension_function_test_utils.h
diff --git a/chrome/browser/extensions/extension_function_test_utils.h b/chrome/browser/extensions/extension_function_test_utils.h
index ef005a4dd3b277a340db28037ab7918d99ff1168..6ec21fa18ac1971517b2529412565428e9c6c08b 100644
--- a/chrome/browser/extensions/extension_function_test_utils.h
+++ b/chrome/browser/extensions/extension_function_test_utils.h
@@ -51,6 +51,9 @@ enum RunFunctionFlags {
// Run |function| with |args| and return the resulting error. Adds an error to
// the current test if |function| returns a result. The caller releases
// ownership of |function|.
asargent_no_longer_on_chrome 2011/11/18 23:08:18 nit: remove this line about caller releasing owner
+//
+// For these and all Run* methods, the caller must hold a reference to
+// the function during the lifetime of the method.
std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function,
const std::string& args,
Browser* browser,
@@ -87,7 +90,9 @@ void RunFunction(UIThreadExtensionFunction* function,
// Similar to RunFunction, but doesn't return until |function| calls
// SendResponse. Returns the value |function| passed to SendResponse.
-bool RunAsyncFunction(AsyncExtensionFunction* function,
+//
+// See above re holding reference.
+bool RunAsyncFunction(UIThreadExtensionFunction* function,
asargent_no_longer_on_chrome 2011/11/18 23:08:18 I thought Aaron's idea was that we want to get rid
const std::string& args,
Browser* browser,
RunFunctionFlags flags);
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/extension_function_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698