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

Unified Diff: content/shell/shell_browser_main.cc

Issue 10832412: [content shell] create a central WebKitTestController object that manages the test cycle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | content/shell/shell_javascript_dialog_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_browser_main.cc
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
index 386ccf6e261d4fe590f70cd55087abe081b29eb3..658dd6a9905b238eca30cb0a5bd4c94504a3c804 100644
--- a/content/shell/shell_browser_main.cc
+++ b/content/shell/shell_browser_main.cc
@@ -9,9 +9,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_main_runner.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_content_browser_client.h"
#include "content/shell/shell_switches.h"
#include "content/shell/webkit_test_runner_host.h"
#include "webkit/support/webkit_support.h"
@@ -59,11 +56,9 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree);
if (layout_test_mode) {
- char test_string[2048];
- content::ShellBrowserContext* browser_context =
- static_cast<content::ShellContentBrowserClient*>(
- content::GetContentClient()->browser())->browser_context();
+ content::WebKitTestController test_controller;
+ char test_string[2048];
#if defined(OS_ANDROID)
puts("#READY");
fflush(stdout);
@@ -80,22 +75,19 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
printf("Content-Type: text/plain\n");
std::string pixel_hash;
- content::Shell::CreateNewWindow(
- browser_context,
- GetURLForLayoutTest(test_string, &pixel_hash),
- NULL,
- MSG_ROUTING_NONE,
- NULL);
- content::WebKitTestRunnerHost::Init(pixel_hash);
+ GURL test_url = GetURLForLayoutTest(test_string, &pixel_hash);
+ content::WebKitTestController::Get()->PrepareForLayoutTest(
+ test_url, pixel_hash);
main_runner_->Run();
- content::Shell::CloseAllWindows();
-
// Test footer.
printf("#EOF\n");
fflush(stdout);
fflush(stderr);
+
+ if (!content::WebKitTestController::Get()->ResetAfterLayoutTest())
+ break;
}
exit_code = 0;
} else {
« no previous file with comments | « no previous file | content/shell/shell_javascript_dialog_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698