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/webkit_test_controller.h" | 5 #include "content/shell/webkit_test_controller.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/shell/shell_content_browser_client.h" | 31 #include "content/shell/shell_content_browser_client.h" |
32 #include "webkit/glue/glue_serialize.h" | 32 #include "webkit/glue/glue_serialize.h" |
33 #include "webkit/support/webkit_support_gfx.h" | 33 #include "webkit/support/webkit_support_gfx.h" |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 | 36 |
37 const int kTestTimeoutMilliseconds = 30 * 1000; | 37 const int kTestTimeoutMilliseconds = 30 * 1000; |
38 // 0x20000000ms is big enough for the purpose to avoid timeout in debugging. | 38 // 0x20000000ms is big enough for the purpose to avoid timeout in debugging. |
39 const int kCloseEnoughToInfinity = 0x20000000; | 39 const int kCloseEnoughToInfinity = 0x20000000; |
40 | 40 |
41 const int kTestWindowWidthDip = 800; | |
42 const int kTestWindowHeightDip = 600; | |
43 | |
44 const int kTestSVGWindowWidthDip = 480; | 41 const int kTestSVGWindowWidthDip = 480; |
45 const int kTestSVGWindowHeightDip = 360; | 42 const int kTestSVGWindowHeightDip = 360; |
46 | 43 |
47 // WebKitTestResultPrinter ---------------------------------------------------- | 44 // WebKitTestResultPrinter ---------------------------------------------------- |
48 | 45 |
49 WebKitTestResultPrinter::WebKitTestResultPrinter( | 46 WebKitTestResultPrinter::WebKitTestResultPrinter( |
50 std::ostream* output, std::ostream* error) | 47 std::ostream* output, std::ostream* error) |
51 : state_(DURING_TEST), | 48 : state_(DURING_TEST), |
52 capture_text_only_(false), | 49 capture_text_only_(false), |
53 output_(output), | 50 output_(output), |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 is_running_test_ = true; | 200 is_running_test_ = true; |
204 current_working_directory_ = current_working_directory; | 201 current_working_directory_ = current_working_directory; |
205 enable_pixel_dumping_ = enable_pixel_dumping; | 202 enable_pixel_dumping_ = enable_pixel_dumping; |
206 expected_pixel_hash_ = expected_pixel_hash; | 203 expected_pixel_hash_ = expected_pixel_hash; |
207 test_url_ = test_url; | 204 test_url_ = test_url; |
208 printer_->reset(); | 205 printer_->reset(); |
209 ShellBrowserContext* browser_context = | 206 ShellBrowserContext* browser_context = |
210 ShellContentBrowserClient::Get()->browser_context(); | 207 ShellContentBrowserClient::Get()->browser_context(); |
211 if (test_url.spec().find("compositing/") != std::string::npos) | 208 if (test_url.spec().find("compositing/") != std::string::npos) |
212 is_compositing_test_ = true; | 209 is_compositing_test_ = true; |
213 initial_size_ = gfx::Size(kTestWindowWidthDip, kTestWindowHeightDip); | 210 initial_size_ = gfx::Size( |
| 211 Shell::kDefaultTestWindowWidthDip, Shell::kDefaultTestWindowHeightDip); |
214 // The W3C SVG layout tests use a different size than the other layout tests. | 212 // The W3C SVG layout tests use a different size than the other layout tests. |
215 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) | 213 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) |
216 initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip); | 214 initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip); |
217 if (!main_window_) { | 215 if (!main_window_) { |
218 main_window_ = content::Shell::CreateNewWindow( | 216 main_window_ = content::Shell::CreateNewWindow( |
219 browser_context, | 217 browser_context, |
220 GURL(), | 218 GURL(), |
221 NULL, | 219 NULL, |
222 MSG_ROUTING_NONE, | 220 MSG_ROUTING_NONE, |
223 initial_size_); | 221 initial_size_); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 614 } |
617 base::MessageLoop::current()->RunUntilIdle(); | 615 base::MessageLoop::current()->RunUntilIdle(); |
618 } | 616 } |
619 | 617 |
620 void WebKitTestController::OnResetDone() { | 618 void WebKitTestController::OnResetDone() { |
621 base::MessageLoop::current()->PostTask(FROM_HERE, | 619 base::MessageLoop::current()->PostTask(FROM_HERE, |
622 base::MessageLoop::QuitClosure()); | 620 base::MessageLoop::QuitClosure()); |
623 } | 621 } |
624 | 622 |
625 } // namespace content | 623 } // namespace content |
OLD | NEW |