OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sky/tools/tester/test_runner.h" | 5 #include "sky/tools/tester/test_runner.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "mojo/public/cpp/application/connect.h" | 9 #include "mojo/public/cpp/application/connect.h" |
10 #include "mojo/services/view_manager/public/cpp/view.h" | 10 #include "mojo/services/view_manager/public/cpp/view.h" |
11 | 11 |
12 namespace sky { | 12 namespace sky { |
13 namespace tester { | 13 namespace tester { |
14 | 14 |
15 TestRunnerClient::~TestRunnerClient() { | 15 TestRunnerClient::~TestRunnerClient() { |
16 } | 16 } |
17 | 17 |
18 TestRunner::TestRunner(TestRunnerClient* client, | 18 TestRunner::TestRunner(TestRunnerClient* client, |
19 mojo::View* container, | 19 mojo::View* container, |
20 const std::string& url, | 20 const std::string& url, |
21 bool enable_pixel_dumping) | 21 bool enable_pixel_dumping) |
22 : client_(client), | 22 : client_(client), |
23 weak_ptr_factory_(this), | 23 enable_pixel_dumping_(enable_pixel_dumping), |
24 enable_pixel_dumping_(enable_pixel_dumping) { | 24 weak_ptr_factory_(this) { |
25 CHECK(client); | 25 CHECK(client); |
26 | 26 |
27 mojo::ServiceProviderPtr test_harness_provider; | 27 mojo::ServiceProviderPtr test_harness_provider; |
28 test_harness_provider_impl_.AddService(this); | 28 test_harness_provider_impl_.AddService(this); |
29 test_harness_provider_impl_.Bind(GetProxy(&test_harness_provider)); | 29 test_harness_provider_impl_.Bind(GetProxy(&test_harness_provider)); |
30 | 30 |
31 container->Embed(url, nullptr, test_harness_provider.Pass()); | 31 container->Embed(url, nullptr, test_harness_provider.Pass()); |
32 } | 32 } |
33 | 33 |
34 TestRunner::~TestRunner() { | 34 TestRunner::~TestRunner() { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 client_->OnTestComplete(); | 68 client_->OnTestComplete(); |
69 } | 69 } |
70 | 70 |
71 void TestRunner::Create(mojo::ApplicationConnection* app, | 71 void TestRunner::Create(mojo::ApplicationConnection* app, |
72 mojo::InterfaceRequest<TestHarness> request) { | 72 mojo::InterfaceRequest<TestHarness> request) { |
73 new TestHarnessImpl(this, request.Pass()); | 73 new TestHarnessImpl(this, request.Pass()); |
74 } | 74 } |
75 | 75 |
76 } // namespace tester | 76 } // namespace tester |
77 } // namespace sky | 77 } // namespace sky |
OLD | NEW |