OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/shell_browser_main.h" | 5 #include "content/shell/shell_browser_main.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
11 #include "content/public/browser/browser_main_runner.h" | 11 #include "content/public/browser/browser_main_runner.h" |
12 #include "content/shell/layout_test_controller_host.h" | |
13 #include "content/shell/shell.h" | 12 #include "content/shell/shell.h" |
14 #include "content/shell/shell_browser_context.h" | 13 #include "content/shell/shell_browser_context.h" |
15 #include "content/shell/shell_content_browser_client.h" | 14 #include "content/shell/shell_content_browser_client.h" |
16 #include "content/shell/shell_switches.h" | 15 #include "content/shell/shell_switches.h" |
| 16 #include "content/shell/webkit_test_runner_host.h" |
17 #include "webkit/support/webkit_support.h" | 17 #include "webkit/support/webkit_support.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 GURL GetURLForLayoutTest(const char* test_name, | 21 GURL GetURLForLayoutTest(const char* test_name, |
22 std::string* expected_pixel_hash) { | 22 std::string* expected_pixel_hash) { |
23 std::string path_or_url = test_name; | 23 std::string path_or_url = test_name; |
24 std::string pixel_hash; | 24 std::string pixel_hash; |
25 std::string::size_type separator_position = path_or_url.find('\''); | 25 std::string::size_type separator_position = path_or_url.find('\''); |
26 if (separator_position != std::string::npos) { | 26 if (separator_position != std::string::npos) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Test header. | 79 // Test header. |
80 printf("Content-Type: text/plain\n"); | 80 printf("Content-Type: text/plain\n"); |
81 | 81 |
82 std::string pixel_hash; | 82 std::string pixel_hash; |
83 content::Shell::CreateNewWindow( | 83 content::Shell::CreateNewWindow( |
84 browser_context, | 84 browser_context, |
85 GetURLForLayoutTest(test_string, &pixel_hash), | 85 GetURLForLayoutTest(test_string, &pixel_hash), |
86 NULL, | 86 NULL, |
87 MSG_ROUTING_NONE, | 87 MSG_ROUTING_NONE, |
88 NULL); | 88 NULL); |
89 content::LayoutTestControllerHost::Init(pixel_hash); | 89 content::WebKitTestRunnerHost::Init(pixel_hash); |
90 | 90 |
91 main_runner_->Run(); | 91 main_runner_->Run(); |
92 | 92 |
93 content::Shell::CloseAllWindows(); | 93 content::Shell::CloseAllWindows(); |
94 | 94 |
95 // Test footer. | 95 // Test footer. |
96 printf("#EOF\n"); | 96 printf("#EOF\n"); |
97 fflush(stdout); | 97 fflush(stdout); |
98 fflush(stderr); | 98 fflush(stderr); |
99 } | 99 } |
100 exit_code = 0; | 100 exit_code = 0; |
101 } else { | 101 } else { |
102 exit_code = main_runner_->Run(); | 102 exit_code = main_runner_->Run(); |
103 } | 103 } |
104 | 104 |
105 main_runner_->Shutdown(); | 105 main_runner_->Shutdown(); |
106 | 106 |
107 return exit_code; | 107 return exit_code; |
108 } | 108 } |
OLD | NEW |