| 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 "base/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "mojo/package_manager/package_manager_impl.h" | 7 #include "mojo/package_manager/package_manager_impl.h" |
| 8 #include "mojo/runner/context.h" | 8 #include "mojo/runner/context.h" |
| 9 #include "mojo/shell/application_manager.h" | 9 #include "mojo/shell/application_manager.h" |
| 10 #include "mojo/util/filename_util.h" | 10 #include "mojo/util/filename_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 class TestNativeRunner : public shell::NativeRunner { | 28 class TestNativeRunner : public shell::NativeRunner { |
| 29 public: | 29 public: |
| 30 explicit TestNativeRunner(TestState* state) : state_(state) { | 30 explicit TestNativeRunner(TestState* state) : state_(state) { |
| 31 state_->runner_was_created = true; | 31 state_->runner_was_created = true; |
| 32 } | 32 } |
| 33 ~TestNativeRunner() override { | 33 ~TestNativeRunner() override { |
| 34 state_->runner_was_destroyed = true; | 34 state_->runner_was_destroyed = true; |
| 35 if (base::MessageLoop::current()->is_running()) | 35 if (base::MessageLoop::current()->is_running()) |
| 36 base::MessageLoop::current()->Quit(); | 36 base::MessageLoop::current()->QuitWhenIdle(); |
| 37 } | 37 } |
| 38 void Start(const base::FilePath& app_path, | 38 void Start(const base::FilePath& app_path, |
| 39 bool start_sandboxed, | 39 bool start_sandboxed, |
| 40 InterfaceRequest<Application> application_request, | 40 InterfaceRequest<Application> application_request, |
| 41 const base::Closure& app_completed_callback) override { | 41 const base::Closure& app_completed_callback) override { |
| 42 state_->runner_was_started = true; | 42 state_->runner_was_started = true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 TestState* state_; | 46 TestState* state_; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 params->SetTargetURL(url); | 95 params->SetTargetURL(url); |
| 96 application_manager_->ConnectToApplication(params.Pass()); | 96 application_manager_->ConnectToApplication(params.Pass()); |
| 97 EXPECT_FALSE(state_.runner_was_created); | 97 EXPECT_FALSE(state_.runner_was_created); |
| 98 EXPECT_FALSE(state_.runner_was_started); | 98 EXPECT_FALSE(state_.runner_was_started); |
| 99 EXPECT_FALSE(state_.runner_was_destroyed); | 99 EXPECT_FALSE(state_.runner_was_destroyed); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace | 102 } // namespace |
| 103 } // namespace runner | 103 } // namespace runner |
| 104 } // namespace mojo | 104 } // namespace mojo |
| OLD | NEW |