| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return scoped_ptr<NativeRunner>(new TestNativeRunner(state_)); | 49 return scoped_ptr<NativeRunner>(new TestNativeRunner(state_)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 TestState* state_; | 53 TestState* state_; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class NativeApplicationLoaderTest : public testing::Test, | 56 class NativeApplicationLoaderTest : public testing::Test, |
| 57 public ApplicationManager::Delegate { | 57 public ApplicationManager::Delegate { |
| 58 public: | 58 public: |
| 59 NativeApplicationLoaderTest() : application_manager_(this) {} | 59 NativeApplicationLoaderTest() |
| 60 : application_manager_(ApplicationManager::Options(), this) {} |
| 60 ~NativeApplicationLoaderTest() override {} | 61 ~NativeApplicationLoaderTest() override {} |
| 61 void SetUp() override { | 62 void SetUp() override { |
| 62 context_.Init(); | 63 context_.Init(); |
| 63 scoped_ptr<NativeRunnerFactory> factory( | 64 scoped_ptr<NativeRunnerFactory> factory( |
| 64 new TestNativeRunnerFactory(&state_)); | 65 new TestNativeRunnerFactory(&state_)); |
| 65 application_manager_.set_native_runner_factory(factory.Pass()); | 66 application_manager_.set_native_runner_factory(factory.Pass()); |
| 66 application_manager_.set_blocking_pool( | 67 application_manager_.set_blocking_pool( |
| 67 context_.task_runners()->blocking_pool()); | 68 context_.task_runners()->blocking_pool()); |
| 68 } | 69 } |
| 69 void TearDown() override { context_.Shutdown(); } | 70 void TearDown() override { context_.Shutdown(); } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 89 mojo::ServiceProviderPtr service_provider; | 90 mojo::ServiceProviderPtr service_provider; |
| 90 application_manager_.ConnectToApplication( | 91 application_manager_.ConnectToApplication( |
| 91 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); | 92 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); |
| 92 EXPECT_FALSE(state_.runner_was_created); | 93 EXPECT_FALSE(state_.runner_was_created); |
| 93 EXPECT_FALSE(state_.runner_was_started); | 94 EXPECT_FALSE(state_.runner_was_started); |
| 94 EXPECT_FALSE(state_.runner_was_destroyed); | 95 EXPECT_FALSE(state_.runner_was_destroyed); |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace | 98 } // namespace |
| 98 } // namespace shell | 99 } // namespace shell |
| OLD | NEW |