Add Smart Lock warm welcome on Windows.
[chromium-blink-merge.git] / components / html_viewer / layout_test_html_viewer.cc
blobc932fdf73edd1d1cab5d2f56087f08e35922fd22
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/html_viewer/layout_test_html_viewer.h"
7 #include "components/html_viewer/global_state.h"
8 #include "components/html_viewer/layout_test_content_handler_impl.h"
9 #include "components/test_runner/web_test_interfaces.h"
10 #include "components/web_view/test_runner/public/interfaces/layout_test_runner.mojom.h"
12 namespace html_viewer {
14 LayoutTestHTMLViewer::LayoutTestHTMLViewer() {
17 LayoutTestHTMLViewer::~LayoutTestHTMLViewer() {
20 void LayoutTestHTMLViewer::Initialize(mojo::ApplicationImpl* app) {
21 HTMLViewer::Initialize(app);
22 global_state()->InitIfNecessary(gfx::Size(800, 600), 1.f);
23 test_interfaces_.reset(new test_runner::WebTestInterfaces);
24 test_interfaces_->ResetAll();
25 test_delegate_.set_test_interfaces(test_interfaces_.get());
26 test_delegate_.set_completion_callback(
27 base::Bind(&LayoutTestHTMLViewer::TestFinished, base::Unretained(this)));
28 test_interfaces_->SetDelegate(&test_delegate_);
31 void LayoutTestHTMLViewer::TestFinished() {
32 web_view::LayoutTestRunnerPtr test_runner_ptr;
34 mojo::URLRequestPtr request(mojo::URLRequest::New());
35 request->url = mojo::String::From("mojo:web_view_test_runner");
36 app()->ConnectToService(request.Pass(), &test_runner_ptr);
37 test_runner_ptr->TestFinished();
40 void LayoutTestHTMLViewer::Create(
41 mojo::ApplicationConnection* connection,
42 mojo::InterfaceRequest<mojo::ContentHandler> request) {
43 new LayoutTestContentHandlerImpl(global_state(), app(), request.Pass(),
44 test_interfaces_.get(),
45 &test_delegate_);
48 } // namespace html_viewer