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

Unified Diff: content/test/content_test_launcher.cc

Issue 10912070: Makes it possible to run content_browsertests with --as-browser and fake WebRTC devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: content/test/content_test_launcher.cc
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc
index 5ab191055bde98f4dab0f44d7fdd21f7914f5d53..c57ef5eb78978a10a93110521fcde55a45b0741a 100644
--- a/content/test/content_test_launcher.cc
+++ b/content/test/content_test_launcher.cc
@@ -9,7 +9,8 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/test/test_suite.h"
-#include "content/public/app/content_main.h"
+#include "content/browser/browser_main_loop.h"
+#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/content_test_suite_base.h"
#include "content/shell/shell_content_browser_client.h"
@@ -94,28 +95,6 @@ class ContentTestLauncherDelegate : public test_launcher::TestLauncherDelegate {
return std::string();
}
- virtual bool Run(int argc, char** argv, int* return_code) OVERRIDE {
-#if defined(OS_WIN) || defined(OS_LINUX)
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kProcessType)) {
- ShellMainDelegate delegate;
-#if defined(OS_WIN)
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
- InitializeSandboxInfo(&sandbox_info);
- *return_code =
- ContentMain(GetModuleHandle(NULL), &sandbox_info, &delegate);
-#elif defined(OS_LINUX)
- *return_code = ContentMain(argc,
- const_cast<const char**>(argv),
- &delegate);
-#endif // defined(OS_WIN)
- return true;
- }
-#endif // defined(OS_WIN) || defined(OS_LINUX)
-
- return false;
- }
-
virtual int RunTestSuite(int argc, char** argv) OVERRIDE {
return ContentBrowserTestSuite(argc, argv).Run();
}
@@ -127,6 +106,11 @@ class ContentTestLauncherDelegate : public test_launcher::TestLauncherDelegate {
return true;
}
+ protected:
+ virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE {
+ return new ShellMainDelegate();
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate);
};
@@ -135,5 +119,6 @@ class ContentTestLauncherDelegate : public test_launcher::TestLauncherDelegate {
int main(int argc, char** argv) {
content::ContentTestLauncherDelegate launcher_delegate;
+ content::BrowserMainLoop::UseFakeMediaStreamDevice();
return test_launcher::LaunchTests(&launcher_delegate, argc, argv);
}
« content/public/test/test_launcher.cc ('K') | « content/public/test/test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698