OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/layout_test/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <set> | 10 #include <set> |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 test_url_ = test_url; | 271 test_url_ = test_url; |
272 did_send_initial_test_configuration_ = false; | 272 did_send_initial_test_configuration_ = false; |
273 printer_->reset(); | 273 printer_->reset(); |
274 frame_to_layout_dump_map_.clear(); | 274 frame_to_layout_dump_map_.clear(); |
275 render_process_host_observer_.RemoveAll(); | 275 render_process_host_observer_.RemoveAll(); |
276 all_observed_render_process_hosts_.clear(); | 276 all_observed_render_process_hosts_.clear(); |
277 main_window_render_process_hosts_.clear(); | 277 main_window_render_process_hosts_.clear(); |
278 accumulated_layout_test_runtime_flags_changes_.Clear(); | 278 accumulated_layout_test_runtime_flags_changes_.Clear(); |
279 ShellBrowserContext* browser_context = | 279 ShellBrowserContext* browser_context = |
280 ShellContentBrowserClient::Get()->browser_context(); | 280 ShellContentBrowserClient::Get()->browser_context(); |
281 if (test_url.spec().find("compositing/") != std::string::npos) | 281 is_compositing_test_ = |
282 is_compositing_test_ = true; | 282 test_url.spec().find("compositing/") != std::string::npos; |
283 initial_size_ = Shell::GetShellDefaultSize(); | 283 initial_size_ = Shell::GetShellDefaultSize(); |
284 // The W3C SVG layout tests use a different size than the other layout tests. | 284 // The W3C SVG layout tests use a different size than the other layout tests. |
285 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) | 285 if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) |
286 initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip); | 286 initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip); |
287 if (!main_window_) { | 287 if (!main_window_) { |
288 main_window_ = content::Shell::CreateNewWindow( | 288 main_window_ = content::Shell::CreateNewWindow( |
289 browser_context, | 289 browser_context, |
290 GURL(), | 290 GURL(), |
291 NULL, | 291 NULL, |
292 initial_size_); | 292 initial_size_); |
(...skipping 11 matching lines...) Expand all Loading... |
304 ->GetRenderViewHost() | 304 ->GetRenderViewHost() |
305 ->GetWidget() | 305 ->GetWidget() |
306 ->GetView() | 306 ->GetView() |
307 ->SetSize(initial_size_); | 307 ->SetSize(initial_size_); |
308 main_window_->web_contents() | 308 main_window_->web_contents() |
309 ->GetRenderViewHost() | 309 ->GetRenderViewHost() |
310 ->GetWidget() | 310 ->GetWidget() |
311 ->WasResized(); | 311 ->WasResized(); |
312 RenderViewHost* render_view_host = | 312 RenderViewHost* render_view_host = |
313 main_window_->web_contents()->GetRenderViewHost(); | 313 main_window_->web_contents()->GetRenderViewHost(); |
| 314 |
| 315 // Compositing tests override the default preferences (see |
| 316 // BlinkTestController::OverrideWebkitPrefs) so we force them to be |
| 317 // calculated again to ensure is_compositing_test_ changes are picked up. |
| 318 default_prefs_ = render_view_host->GetWebkitPreferences(); |
| 319 OverrideWebkitPrefs(&default_prefs_); |
| 320 |
314 render_view_host->UpdateWebkitPreferences(default_prefs_); | 321 render_view_host->UpdateWebkitPreferences(default_prefs_); |
315 HandleNewRenderFrameHost(render_view_host->GetMainFrame()); | 322 HandleNewRenderFrameHost(render_view_host->GetMainFrame()); |
316 | 323 |
317 NavigationController::LoadURLParams params(test_url); | 324 NavigationController::LoadURLParams params(test_url); |
318 params.transition_type = ui::PageTransitionFromInt( | 325 params.transition_type = ui::PageTransitionFromInt( |
319 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); | 326 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); |
320 params.should_clear_history_list = true; | 327 params.should_clear_history_list = true; |
321 main_window_->web_contents()->GetController().LoadURLWithParams(params); | 328 main_window_->web_contents()->GetController().LoadURLWithParams(params); |
322 main_window_->web_contents()->Focus(); | 329 main_window_->web_contents()->Focus(); |
323 } | 330 } |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 } else { | 944 } else { |
938 printer_->AddErrorMessage(base::StringPrintf( | 945 printer_->AddErrorMessage(base::StringPrintf( |
939 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 946 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
940 event_name.c_str())); | 947 event_name.c_str())); |
941 return; | 948 return; |
942 } | 949 } |
943 bluetooth_chooser_factory_->SendEvent(event, argument); | 950 bluetooth_chooser_factory_->SendEvent(event, argument); |
944 } | 951 } |
945 | 952 |
946 } // namespace content | 953 } // namespace content |
OLD | NEW |