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

Unified Diff: content/test/content_browser_test.cc

Issue 10803026: Get content_browsertest working. I've added a simple test for now, and will convert the tests in sr… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: get it working on mac + linux, fix unittests crash, and fix unittest link error and add missing dep… Created 8 years, 5 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 | « content/test/content_browser_test.h ('k') | content/test/content_browser_test_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_browser_test.cc
===================================================================
--- content/test/content_browser_test.cc (revision 147044)
+++ content/test/content_browser_test.cc (working copy)
@@ -4,8 +4,13 @@
#include "content/test/content_browser_test.h"
+#include "base/command_line.h"
#include "base/debug/stack_trace.h"
+#include "base/file_path.h"
+#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/path_service.h"
+#include "content/public/common/content_switches.h"
#include "content/shell/shell.h"
#include "content/shell/shell_main_delegate.h"
#include "content/test/test_content_client.h"
@@ -15,16 +20,37 @@
#endif
ContentBrowserTest::ContentBrowserTest() {
+#if defined(OS_MACOSX)
+ // See comment in InProcessBrowserTest::InProcessBrowserTest().
+ FilePath content_shell_path;
+ CHECK(PathService::Get(base::FILE_EXE, &content_shell_path));
+ content_shell_path = content_shell_path.DirName();
+ content_shell_path = content_shell_path.Append(
+ FILE_PATH_LITERAL("Content Shell.app/Contents/MacOS/Content Shell"));
+ CHECK(PathService::Override(base::FILE_EXE, content_shell_path));
+#endif
}
ContentBrowserTest::~ContentBrowserTest() {
}
void ContentBrowserTest::SetUp() {
- DCHECK(!content::GetContentClient());
shell_main_delegate_.reset(new ShellMainDelegate);
shell_main_delegate_->PreSandboxStartup();
+#if defined(OS_MACOSX)
+ // See InProcessBrowserTest::PrepareTestCommandLine().
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ FilePath subprocess_path;
+ PathService::Get(base::FILE_EXE, &subprocess_path);
+ subprocess_path = subprocess_path.DirName().DirName();
+ DCHECK_EQ(subprocess_path.BaseName().value(), "Contents");
+ subprocess_path = subprocess_path.Append(
+ "Frameworks/Content Shell Helper.app/Contents/MacOS/Content Shell Helper");
+ command_line->AppendSwitchPath(switches::kBrowserSubprocessPath,
+ subprocess_path);
+#endif
+
BrowserTestBase::SetUp();
}
@@ -45,6 +71,9 @@
#endif // defined(OS_POSIX)
void ContentBrowserTest::RunTestOnMainThreadLoop() {
+ CHECK_EQ(content::Shell::windows().size(), 1u);
+ shell_ = content::Shell::windows()[0];
+
#if defined(OS_POSIX)
signal(SIGTERM, DumpStackTraceSignalHandler);
#endif // defined(OS_POSIX)
@@ -71,9 +100,4 @@
#if defined(OS_MACOSX)
pool.Recycle();
#endif
-
- MessageLoopForUI::current()->Quit();
-#if defined(OS_MACOSX)
- pool.Recycle();
-#endif
}
« no previous file with comments | « content/test/content_browser_test.h ('k') | content/test/content_browser_test_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698