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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const std::string& expected_pixel_hash) { | 156 const std::string& expected_pixel_hash) { |
157 DCHECK(CalledOnValidThread()); | 157 DCHECK(CalledOnValidThread()); |
158 current_working_directory_ = current_working_directory; | 158 current_working_directory_ = current_working_directory; |
159 enable_pixel_dumping_ = enable_pixel_dumping; | 159 enable_pixel_dumping_ = enable_pixel_dumping; |
160 expected_pixel_hash_ = expected_pixel_hash; | 160 expected_pixel_hash_ = expected_pixel_hash; |
161 printer_->reset(); | 161 printer_->reset(); |
162 printer_->PrintTextHeader(); | 162 printer_->PrintTextHeader(); |
163 content::ShellBrowserContext* browser_context = | 163 content::ShellBrowserContext* browser_context = |
164 static_cast<content::ShellContentBrowserClient*>( | 164 static_cast<content::ShellContentBrowserClient*>( |
165 content::GetContentClient()->browser())->browser_context(); | 165 content::GetContentClient()->browser())->browser_context(); |
| 166 gfx::Size initial_size; |
| 167 // The W3C SVG layout tests use a different size than the other layout tests. |
| 168 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) |
| 169 initial_size = gfx::Size(480, 360); |
166 main_window_ = content::Shell::CreateNewWindow( | 170 main_window_ = content::Shell::CreateNewWindow( |
167 browser_context, | 171 browser_context, |
168 GURL(), | 172 GURL(), |
169 NULL, | 173 NULL, |
170 MSG_ROUTING_NONE, | 174 MSG_ROUTING_NONE, |
171 NULL); | 175 initial_size); |
172 WebContentsObserver::Observe(main_window_->web_contents()); | 176 WebContentsObserver::Observe(main_window_->web_contents()); |
173 main_window_->LoadURL(test_url); | 177 main_window_->LoadURL(test_url); |
174 if (test_url.spec().find("/dumpAsText/") != std::string::npos || | 178 if (test_url.spec().find("/dumpAsText/") != std::string::npos || |
175 test_url.spec().find("\\dumpAsText\\") != std::string::npos) { | 179 test_url.spec().find("\\dumpAsText\\") != std::string::npos) { |
176 dump_as_text_ = true; | 180 dump_as_text_ = true; |
177 enable_pixel_dumping_ = false; | 181 enable_pixel_dumping_ = false; |
178 } | 182 } |
179 if (test_url.spec().find("/inspector/") != std::string::npos || | 183 if (test_url.spec().find("/inspector/") != std::string::npos || |
180 test_url.spec().find("\\inspector\\") != std::string::npos) { | 184 test_url.spec().find("\\inspector\\") != std::string::npos) { |
181 main_window_->ShowDevTools(); | 185 main_window_->ShowDevTools(); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 500 |
497 void WebKitTestController::OnNotImplemented( | 501 void WebKitTestController::OnNotImplemented( |
498 const std::string& object_name, | 502 const std::string& object_name, |
499 const std::string& property_name) { | 503 const std::string& property_name) { |
500 printer_->AddErrorMessage( | 504 printer_->AddErrorMessage( |
501 std::string("FAIL: NOT IMPLEMENTED: ") + | 505 std::string("FAIL: NOT IMPLEMENTED: ") + |
502 object_name + "." + property_name); | 506 object_name + "." + property_name); |
503 } | 507 } |
504 | 508 |
505 } // namespace content | 509 } // namespace content |
OLD | NEW |