| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void TearDown() override { context_.Shutdown(); } | 71 void TearDown() override { context_.Shutdown(); } |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 shell::Context context_; | 74 shell::Context context_; |
| 75 base::MessageLoop loop_; | 75 base::MessageLoop loop_; |
| 76 ApplicationManager application_manager_; | 76 ApplicationManager application_manager_; |
| 77 TestState state_; | 77 TestState state_; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 // ApplicationManager::Delegate | 80 // ApplicationManager::Delegate |
| 81 void OnApplicationError(const GURL& url) override {} | |
| 82 | |
| 83 GURL ResolveURL(const GURL& url) override { return url; } | 81 GURL ResolveURL(const GURL& url) override { return url; } |
| 84 | 82 |
| 85 GURL ResolveMappings(const GURL& url) override { return url; } | 83 GURL ResolveMappings(const GURL& url) override { return url; } |
| 86 }; | 84 }; |
| 87 | 85 |
| 88 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { | 86 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { |
| 89 base::ScopedTempDir temp_dir; | 87 base::ScopedTempDir temp_dir; |
| 90 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 88 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 91 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); | 89 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); |
| 92 GURL url(FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); | 90 GURL url(FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); |
| 93 InterfaceRequest<ServiceProvider> services; | 91 InterfaceRequest<ServiceProvider> services; |
| 94 ServiceProviderPtr service_provider; | 92 ServiceProviderPtr service_provider; |
| 95 application_manager_.ConnectToApplication(url, GURL(), services.Pass(), | 93 application_manager_.ConnectToApplication( |
| 96 service_provider.Pass()); | 94 url, GURL(), services.Pass(), service_provider.Pass(), base::Closure()); |
| 97 EXPECT_FALSE(state_.runner_was_created); | 95 EXPECT_FALSE(state_.runner_was_created); |
| 98 EXPECT_FALSE(state_.runner_was_started); | 96 EXPECT_FALSE(state_.runner_was_started); |
| 99 EXPECT_FALSE(state_.runner_was_destroyed); | 97 EXPECT_FALSE(state_.runner_was_destroyed); |
| 100 } | 98 } |
| 101 | 99 |
| 102 } // namespace | 100 } // namespace |
| 103 } // namespace shell | 101 } // namespace shell |
| 104 } // namespace mojo | 102 } // namespace mojo |
| OLD | NEW |