diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 10:58:51 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 10:58:51 +0000 |
commit | 0799da03522c8fe06136710ea409c4e8d468f45c (patch) | |
tree | dbe61f3d30738e185f67a0cecbe43f90579c0c38 /content/shell/shell_browser_main.cc | |
parent | c91bb26fa85807df212657eb025c2c69be100b9f (diff) | |
download | chromium_src-0799da03522c8fe06136710ea409c4e8d468f45c.zip chromium_src-0799da03522c8fe06136710ea409c4e8d468f45c.tar.gz chromium_src-0799da03522c8fe06136710ea409c4e8d468f45c.tar.bz2 |
Add basic support to dump pixel results
BUG=111316
TEST="webkit/tools/layout_tests/run_webkit_tests.py --chromium --debug --driver-name=content_shell --additional-drt-flag=--dump-render-tree css3/css3-modsel-33.html" should pass
Review URL: https://chromiumcodereview.appspot.com/10656044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_browser_main.cc')
-rw-r--r-- | content/shell/shell_browser_main.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc index f56af33..597f1a0 100644 --- a/content/shell/shell_browser_main.cc +++ b/content/shell/shell_browser_main.cc @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "base/threading/thread_restrictions.h" #include "content/public/browser/browser_main_runner.h" +#include "content/shell/layout_test_controller_host.h" #include "content/shell/shell.h" #include "content/shell/shell_browser_context.h" #include "content/shell/shell_content_browser_client.h" @@ -19,7 +20,8 @@ namespace { -GURL GetURLForLayoutTest(const char* test_name) { +GURL GetURLForLayoutTest(const char* test_name, + std::string* expected_pixel_hash) { #if defined(OS_ANDROID) // DumpRenderTree is not currently supported for Android using the content // shell. @@ -28,18 +30,13 @@ GURL GetURLForLayoutTest(const char* test_name) { #else std::string path_or_url = test_name; std::string pixel_hash; - std::string timeout; - std::string::size_type separator_position = path_or_url.find(' '); + std::string::size_type separator_position = path_or_url.find('\''); if (separator_position != std::string::npos) { - timeout = path_or_url.substr(separator_position + 1); + pixel_hash = path_or_url.substr(separator_position + 1); path_or_url.erase(separator_position); - separator_position = path_or_url.find(' '); - if (separator_position != std::string::npos) { - pixel_hash = timeout.substr(separator_position + 1); - timeout.erase(separator_position); - } } - // TODO(jochen): use pixel_hash and timeout. + if (expected_pixel_hash) + *expected_pixel_hash = pixel_hash; GURL test_url = webkit_support::CreateURLForPathOrURL(path_or_url); { // We're outside of the message loop here, and this is a test. @@ -86,11 +83,15 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) { // Test header. std::cout << "Content-Type: text/plain\n"; - content::Shell::CreateNewWindow(browser_context, - GetURLForLayoutTest(test_string), - NULL, - MSG_ROUTING_NONE, - NULL); + std::string pixel_hash; + content::Shell::CreateNewWindow( + browser_context, + GetURLForLayoutTest(test_string, &pixel_hash), + NULL, + MSG_ROUTING_NONE, + NULL); + content::LayoutTestControllerHost::Init(pixel_hash); + main_runner_->Run(); content::Shell::CloseAllWindows(); |