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 "mojo/runner/context.h" | 6 #include "mojo/runner/context.h" |
7 #include "mojo/runner/filename_util.h" | |
8 #include "mojo/shell/application_manager.h" | 7 #include "mojo/shell/application_manager.h" |
| 8 #include "mojo/util/filename_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 namespace shell { | 12 namespace shell { |
13 namespace { | 13 namespace { |
14 | 14 |
15 struct TestState { | 15 struct TestState { |
16 TestState() | 16 TestState() |
17 : runner_was_created(false), | 17 : runner_was_created(false), |
18 runner_was_started(false), | 18 runner_was_started(false), |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 private: | 79 private: |
80 // ApplicationManager::Delegate | 80 // ApplicationManager::Delegate |
81 GURL ResolveMappings(const GURL& url) override { return url; } | 81 GURL ResolveMappings(const GURL& url) override { return url; } |
82 GURL ResolveMojoURL(const GURL& url) override { return url; } | 82 GURL ResolveMojoURL(const GURL& url) override { return url; } |
83 }; | 83 }; |
84 | 84 |
85 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { | 85 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { |
86 base::ScopedTempDir temp_dir; | 86 base::ScopedTempDir temp_dir; |
87 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 87 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
88 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); | 88 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); |
89 GURL url(FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); | 89 GURL url(util::FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); |
90 InterfaceRequest<ServiceProvider> services; | 90 InterfaceRequest<ServiceProvider> services; |
91 ServiceProviderPtr service_provider; | 91 ServiceProviderPtr service_provider; |
92 application_manager_.ConnectToApplication( | 92 application_manager_.ConnectToApplication( |
93 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); | 93 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); |
94 EXPECT_FALSE(state_.runner_was_created); | 94 EXPECT_FALSE(state_.runner_was_created); |
95 EXPECT_FALSE(state_.runner_was_started); | 95 EXPECT_FALSE(state_.runner_was_started); |
96 EXPECT_FALSE(state_.runner_was_destroyed); | 96 EXPECT_FALSE(state_.runner_was_destroyed); |
97 } | 97 } |
98 | 98 |
99 } // namespace | 99 } // namespace |
100 } // namespace shell | 100 } // namespace shell |
101 } // namespace mojo | 101 } // namespace mojo |
OLD | NEW |