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

Unified Diff: extensions/browser/api_test_utils.cc

Issue 449303002: Move SocketsTcpApiTest.SocketsTcpCreateGood to app_shell_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yoyo comments. Created 6 years, 4 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 | « extensions/browser/api_test_utils.h ('k') | extensions/common/test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api_test_utils.cc
diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc
index 4c9a58b95cdbc5dc260dc6ce3d95a9410204c254..b18b249e58dd560a405d6e61a9753faae0c4e366 100644
--- a/extensions/browser/api_test_utils.cc
+++ b/extensions/browser/api_test_utils.cc
@@ -11,10 +11,24 @@
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_function_dispatcher.h"
+#include "extensions/common/extension_builder.h"
#include "testing/gtest/include/gtest/gtest.h"
+using extensions::ExtensionFunctionDispatcher;
+
namespace {
+class TestFunctionDispatcherDelegate
+ : public ExtensionFunctionDispatcher::Delegate {
+ public:
+ TestFunctionDispatcherDelegate() {}
+ virtual ~TestFunctionDispatcherDelegate() {}
+
+ // NULL implementation.
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestFunctionDispatcherDelegate);
+};
+
base::Value* ParseJSON(const std::string& data) {
return base::JSONReader::Read(data);
}
@@ -69,16 +83,16 @@ namespace extensions {
namespace api_test_utils {
-base::Value* RunFunctionAndReturnSingleResult(
+base::Value* RunFunctionWithDelegateAndReturnSingleResult(
UIThreadExtensionFunction* function,
const std::string& args,
content::BrowserContext* context,
scoped_ptr<extensions::ExtensionFunctionDispatcher> dispatcher) {
- return RunFunctionAndReturnSingleResult(
+ return RunFunctionWithDelegateAndReturnSingleResult(
function, args, context, dispatcher.Pass(), NONE);
}
-base::Value* RunFunctionAndReturnSingleResult(
+base::Value* RunFunctionWithDelegateAndReturnSingleResult(
UIThreadExtensionFunction* function,
const std::string& args,
content::BrowserContext* context,
@@ -98,6 +112,26 @@ base::Value* RunFunctionAndReturnSingleResult(
return NULL;
}
+base::Value* RunFunctionAndReturnSingleResult(
+ UIThreadExtensionFunction* function,
+ const std::string& args,
+ content::BrowserContext* context) {
+ return RunFunctionAndReturnSingleResult(function, args, context, NONE);
+}
+
+base::Value* RunFunctionAndReturnSingleResult(
+ UIThreadExtensionFunction* function,
+ const std::string& args,
+ content::BrowserContext* context,
+ RunFunctionFlags flags) {
+ TestFunctionDispatcherDelegate delegate;
+ scoped_ptr<ExtensionFunctionDispatcher> dispatcher(
+ new ExtensionFunctionDispatcher(context, &delegate));
+
+ return RunFunctionWithDelegateAndReturnSingleResult(
+ function, args, context, dispatcher.Pass(), flags);
+}
+
bool RunFunction(UIThreadExtensionFunction* function,
const std::string& args,
content::BrowserContext* context,
« no previous file with comments | « extensions/browser/api_test_utils.h ('k') | extensions/common/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698