| Index: content/shell/browser/layout_test/blink_test_controller.cc
|
| diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
|
| index adea7036bdee1b106509502bed8c65c038735c1f..19246e510bed1f50ae42cfae44a8e0c53440fb0f 100644
|
| --- a/content/shell/browser/layout_test/blink_test_controller.cc
|
| +++ b/content/shell/browser/layout_test/blink_test_controller.cc
|
| @@ -44,6 +44,7 @@
|
| #include "content/public/common/bindings_policy.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "content/public/common/url_constants.h"
|
| +#include "content/shell/browser/layout_test/devtools_protocol_test_bindings.h"
|
| #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h"
|
| #include "content/shell/browser/layout_test/layout_test_content_browser_client.h"
|
| #include "content/shell/browser/layout_test/layout_test_devtools_bindings.h"
|
| @@ -292,14 +293,19 @@ bool BlinkTestController::PrepareForLayoutTest(
|
| bool enable_pixel_dumping,
|
| const std::string& expected_pixel_hash) {
|
| DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
| + fprintf(stderr, "PrepareForLayoutTest: %s\n", test_url.spec().c_str());
|
| test_phase_ = DURING_TEST;
|
| current_working_directory_ = current_working_directory;
|
| enable_pixel_dumping_ = enable_pixel_dumping;
|
| expected_pixel_hash_ = expected_pixel_hash;
|
| - if (test_url.spec().find("/inspector-unit/") == std::string::npos)
|
| - test_url_ = test_url;
|
| - else
|
| + GURL devtools_protocol_test_url =
|
| + DevToolsProtocolTestBindings::GetProtocolTestURL(test_url);
|
| + if (!devtools_protocol_test_url.is_empty())
|
| + test_url_ = devtools_protocol_test_url;
|
| + else if (test_url.spec().find("/inspector-unit/") != std::string::npos)
|
| test_url_ = LayoutTestDevToolsBindings::MapJSTestURL(test_url);
|
| + else
|
| + test_url_ = test_url;
|
| did_send_initial_test_configuration_ = false;
|
| printer_->reset();
|
| frame_to_layout_dump_map_.clear();
|
| @@ -323,6 +329,10 @@ bool BlinkTestController::PrepareForLayoutTest(
|
| NULL,
|
| initial_size_);
|
| WebContentsObserver::Observe(main_window_->web_contents());
|
| + if (!devtools_protocol_test_url.is_empty()) {
|
| + devtools_protocol_test_bindings_.reset(
|
| + new DevToolsProtocolTestBindings(main_window_->web_contents()));
|
| + }
|
| current_pid_ = base::kNullProcessId;
|
| default_prefs_ =
|
| main_window_->web_contents()->GetRenderViewHost()->GetWebkitPreferences();
|
| @@ -344,6 +354,11 @@ bool BlinkTestController::PrepareForLayoutTest(
|
| RenderViewHost* render_view_host =
|
| main_window_->web_contents()->GetRenderViewHost();
|
|
|
| + if (!devtools_protocol_test_url.is_empty()) {
|
| + devtools_protocol_test_bindings_.reset(
|
| + new DevToolsProtocolTestBindings(main_window_->web_contents()));
|
| + }
|
| +
|
| // Compositing tests override the default preferences (see
|
| // BlinkTestController::OverrideWebkitPrefs) so we force them to be
|
| // calculated again to ensure is_compositing_test_ changes are picked up.
|
| @@ -604,6 +619,7 @@ void BlinkTestController::DiscardMainWindow() {
|
| // loop. Otherwise, we're already outside of the message loop, and we just
|
| // discard the main window.
|
| devtools_bindings_.reset();
|
| + devtools_protocol_test_bindings_.reset();
|
| WebContentsObserver::Observe(NULL);
|
| if (test_phase_ != BETWEEN_TESTS) {
|
| Shell::CloseAllWindows();
|
| @@ -684,6 +700,7 @@ void BlinkTestController::OnTestFinished() {
|
| RenderViewHost* render_view_host =
|
| main_window_->web_contents()->GetRenderViewHost();
|
| main_window_->web_contents()->ExitFullscreen(/*will_cause_resize=*/false);
|
| + devtools_protocol_test_bindings_.reset();
|
|
|
| ShellBrowserContext* browser_context =
|
| ShellContentBrowserClient::Get()->browser_context();
|
|
|