| 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/public/cpp/application/service_provider_impl.h" | 10 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 11 #include "mojo/services/public/cpp/view_manager/view.h" | 11 #include "mojo/services/public/cpp/view_manager/view.h" |
| 12 | 12 |
| 13 namespace sky { | 13 namespace sky { |
| 14 namespace tester { | 14 namespace tester { |
| 15 | 15 |
| 16 TestRunner::TestRunner(TestRunnerClient* client, mojo::View* container, | 16 TestRunner::TestRunner(TestRunnerClient* client, mojo::View* container, |
| 17 const std::string& url) | 17 const std::string& url) |
| 18 : test_observer_factory_(this), | 18 : test_harness_factory_(this), |
| 19 client_(client), | 19 client_(client), |
| 20 weak_ptr_factory_(this) { | 20 weak_ptr_factory_(this) { |
| 21 CHECK(client); | 21 CHECK(client); |
| 22 | 22 |
| 23 scoped_ptr<mojo::ServiceProviderImpl> exported_services( | 23 scoped_ptr<mojo::ServiceProviderImpl> exported_services( |
| 24 new mojo::ServiceProviderImpl()); | 24 new mojo::ServiceProviderImpl()); |
| 25 exported_services->AddService(&test_observer_factory_); | 25 exported_services->AddService(&test_harness_factory_); |
| 26 | 26 |
| 27 container->Embed(url, exported_services.Pass()); | 27 container->Embed(url, exported_services.Pass()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 TestRunner::~TestRunner() { | 30 TestRunner::~TestRunner() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 base::WeakPtr<TestRunner> TestRunner::GetWeakPtr() { | 33 base::WeakPtr<TestRunner> TestRunner::GetWeakPtr() { |
| 34 return weak_ptr_factory_.GetWeakPtr(); | 34 return weak_ptr_factory_.GetWeakPtr(); |
| 35 } | 35 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 46 std::cout << "#EOF\n"; | 46 std::cout << "#EOF\n"; |
| 47 std::cout.flush(); | 47 std::cout.flush(); |
| 48 std::cerr << "#EOF\n"; | 48 std::cerr << "#EOF\n"; |
| 49 std::cerr.flush(); | 49 std::cerr.flush(); |
| 50 | 50 |
| 51 client_->OnTestComplete(); | 51 client_->OnTestComplete(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace tester | 54 } // namespace tester |
| 55 } // namespace sky | 55 } // namespace sky |
| OLD | NEW |