Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: components/html_viewer/layout_test_content_handler_impl.cc

Issue 1677293002: Bye bye Mandoline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/html_viewer/layout_test_content_handler_impl.cc
diff --git a/components/html_viewer/layout_test_content_handler_impl.cc b/components/html_viewer/layout_test_content_handler_impl.cc
deleted file mode 100644
index 7683e68df3115783ebb3f8708a1c939c5525b0f8..0000000000000000000000000000000000000000
--- a/components/html_viewer/layout_test_content_handler_impl.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/html_viewer/layout_test_content_handler_impl.h"
-
-#include <utility>
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "components/html_viewer/global_state.h"
-#include "components/html_viewer/html_document_application_delegate.h"
-#include "components/html_viewer/html_widget.h"
-#include "components/html_viewer/layout_test_blink_settings_impl.h"
-#include "components/html_viewer/web_test_delegate_impl.h"
-#include "components/test_runner/web_frame_test_proxy.h"
-#include "third_party/WebKit/public/web/WebLocalFrame.h"
-#include "third_party/WebKit/public/web/WebTestingSupport.h"
-#include "third_party/WebKit/public/web/WebView.h"
-
-namespace html_viewer {
-
-class TestHTMLFrame : public HTMLFrame {
- public:
- explicit TestHTMLFrame(HTMLFrame::CreateParams* params)
- : HTMLFrame(params), test_interfaces_(nullptr) {}
-
- void set_test_interfaces(test_runner::WebTestInterfaces* test_interfaces) {
- test_interfaces_ = test_interfaces;
- }
-
- protected:
- ~TestHTMLFrame() override {}
-
- private:
- // blink::WebFrameClient::
- void didClearWindowObject(blink::WebLocalFrame* frame) override {
- HTMLFrame::didClearWindowObject(frame);
- blink::WebTestingSupport::injectInternalsObject(frame);
- DCHECK(test_interfaces_);
- test_interfaces_->BindTo(frame);
- }
-
- test_runner::WebTestInterfaces* test_interfaces_;
-
- DISALLOW_COPY_AND_ASSIGN(TestHTMLFrame);
-};
-
-LayoutTestContentHandlerImpl::LayoutTestContentHandlerImpl(
- GlobalState* global_state,
- mojo::Shell* shell,
- mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request,
- test_runner::WebTestInterfaces* test_interfaces,
- WebTestDelegateImpl* test_delegate)
- : ContentHandlerImpl(global_state, shell, std::move(request)),
- test_interfaces_(test_interfaces),
- test_delegate_(test_delegate),
- web_widget_proxy_(nullptr),
- app_refcount_(shell->CreateAppRefCount()) {}
-
-LayoutTestContentHandlerImpl::~LayoutTestContentHandlerImpl() {
-}
-
-void LayoutTestContentHandlerImpl::StartApplication(
- mojo::ApplicationRequest request,
- mojo::URLResponsePtr response,
- const mojo::Callback<void()>& destruct_callback) {
- test_interfaces_->SetTestIsRunning(true);
- test_interfaces_->ConfigureForTestWithURL(GURL(), false);
-
- // HTMLDocumentApplicationDelegate deletes itself.
- HTMLDocumentApplicationDelegate* delegate =
- new HTMLDocumentApplicationDelegate(
- std::move(request), std::move(response), global_state(),
- shell()->CreateAppRefCount(), destruct_callback);
-
- delegate->set_html_factory(this);
-}
-
-HTMLWidgetRootLocal* LayoutTestContentHandlerImpl::CreateHTMLWidgetRootLocal(
- HTMLWidgetRootLocal::CreateParams* params) {
- web_widget_proxy_ = new WebWidgetProxy(params);
- return web_widget_proxy_;
-}
-
-HTMLFrame* LayoutTestContentHandlerImpl::CreateHTMLFrame(
- HTMLFrame::CreateParams* params) {
- params->manager->global_state()->set_blink_settings(
- new LayoutTestBlinkSettingsImpl());
-
- // The test harness isn't correctly set-up for iframes yet. So return a normal
- // HTMLFrame for iframes.
- if (params->parent || !params->window || params->window->id() != params->id)
- return new HTMLFrame(params);
-
- using ProxyType =
- test_runner::WebFrameTestProxy<TestHTMLFrame, HTMLFrame::CreateParams*>;
- ProxyType* proxy = new ProxyType(params);
- proxy->set_test_interfaces(test_interfaces_);
-
- web_widget_proxy_->SetInterfaces(test_interfaces_);
- web_widget_proxy_->SetDelegate(test_delegate_);
- proxy->set_base_proxy(web_widget_proxy_);
- test_delegate_->set_test_proxy(web_widget_proxy_);
- test_interfaces_->SetWebView(web_widget_proxy_->web_view(),
- web_widget_proxy_);
- web_widget_proxy_->set_widget(web_widget_proxy_->web_view());
- test_interfaces_->BindTo(web_widget_proxy_->web_view()->mainFrame());
- return proxy;
-}
-
-} // namespace html_viewer
« no previous file with comments | « components/html_viewer/layout_test_content_handler_impl.h ('k') | components/html_viewer/layout_test_html_viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698