summaryrefslogtreecommitdiffstats
path: root/content/shell/shell_browser_main.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 18:36:44 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 18:36:44 +0000
commitaece7a51e9536b3711a93e284f6ebb04a4dfb460 (patch)
treedb22236d2a11e50a29aa168f9cd6fcedbea7f596 /content/shell/shell_browser_main.cc
parenta55056d5c08e8789d47083447726cdac35534118 (diff)
downloadchromium_src-aece7a51e9536b3711a93e284f6ebb04a4dfb460.zip
chromium_src-aece7a51e9536b3711a93e284f6ebb04a4dfb460.tar.gz
chromium_src-aece7a51e9536b3711a93e284f6ebb04a4dfb460.tar.bz2
[content shell] create a central WebKitTestController object that manages the test cycle
Also, this introduces the concept of a main window which is reused across tests Before, each window had it's own test runner (which now merely forwards to the controller), which could result into the wrong window being dumped, or a setting being set on one window, but queried from another window BUG=111316 TEST=manually Review URL: https://chromiumcodereview.appspot.com/10832412 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_browser_main.cc')
-rw-r--r--content/shell/shell_browser_main.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
index 386ccf6..658dd6a 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 {