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 "shell/application_manager/application_manager.h" | 6 #include "shell/application_manager/application_manager.h" |
7 #include "shell/context.h" | 7 #include "shell/context.h" |
8 #include "shell/filename_util.h" | 8 #include "shell/filename_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class TestNativeRunner : public NativeRunner { | 25 class TestNativeRunner : public NativeRunner { |
26 public: | 26 public: |
27 explicit TestNativeRunner(TestState* state) : state_(state) { | 27 explicit TestNativeRunner(TestState* state) : state_(state) { |
28 state_->runner_was_created = true; | 28 state_->runner_was_created = true; |
29 } | 29 } |
30 ~TestNativeRunner() override { | 30 ~TestNativeRunner() override { |
31 state_->runner_was_destroyed = true; | 31 state_->runner_was_destroyed = true; |
32 base::MessageLoop::current()->Quit(); | 32 base::MessageLoop::current()->Quit(); |
33 } | 33 } |
34 void Start(const base::FilePath& app_path, | 34 void Start(const base::FilePath& app_path, |
35 NativeApplicationCleanup cleanup, | |
36 mojo::InterfaceRequest<mojo::Application> application_request, | 35 mojo::InterfaceRequest<mojo::Application> application_request, |
37 const base::Closure& app_completed_callback) override { | 36 const base::Closure& app_completed_callback) override { |
38 state_->runner_was_started = true; | 37 state_->runner_was_started = true; |
39 } | 38 } |
40 | 39 |
41 private: | 40 private: |
42 TestState* state_; | 41 TestState* state_; |
43 }; | 42 }; |
44 | 43 |
45 class TestNativeRunnerFactory : public NativeRunnerFactory { | 44 class TestNativeRunnerFactory : public NativeRunnerFactory { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 mojo::ServiceProviderPtr service_provider; | 89 mojo::ServiceProviderPtr service_provider; |
91 application_manager_.ConnectToApplication( | 90 application_manager_.ConnectToApplication( |
92 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); | 91 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); |
93 EXPECT_FALSE(state_.runner_was_created); | 92 EXPECT_FALSE(state_.runner_was_created); |
94 EXPECT_FALSE(state_.runner_was_started); | 93 EXPECT_FALSE(state_.runner_was_started); |
95 EXPECT_FALSE(state_.runner_was_destroyed); | 94 EXPECT_FALSE(state_.runner_was_destroyed); |
96 } | 95 } |
97 | 96 |
98 } // namespace | 97 } // namespace |
99 } // namespace shell | 98 } // namespace shell |
OLD | NEW |