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/runner/context.h" | 7 #include "mojo/runner/context.h" |
8 #include "mojo/shell/application_manager.h" | 8 #include "mojo/shell/application_manager.h" |
9 #include "mojo/util/filename_util.h" | 9 #include "mojo/util/filename_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 TestState state_; | 85 TestState state_; |
86 }; | 86 }; |
87 | 87 |
88 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { | 88 TEST_F(NativeApplicationLoaderTest, DoesNotExist) { |
89 base::ScopedTempDir temp_dir; | 89 base::ScopedTempDir temp_dir; |
90 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 90 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
91 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); | 91 base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt")); |
92 GURL url(util::FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); | 92 GURL url(util::FilePathToFileURL(temp_dir.path().Append(nonexistent_file))); |
93 InterfaceRequest<ServiceProvider> services; | 93 InterfaceRequest<ServiceProvider> services; |
94 ServiceProviderPtr service_provider; | 94 ServiceProviderPtr service_provider; |
| 95 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 96 request->url = mojo::String::From(url.spec()); |
95 | 97 |
96 scoped_ptr<shell::ConnectToApplicationParams> params( | 98 scoped_ptr<shell::ConnectToApplicationParams> params( |
97 new shell::ConnectToApplicationParams); | 99 new shell::ConnectToApplicationParams); |
98 params->SetTargetURL(url); | 100 params->SetURLInfo(request.Pass()); |
99 params->set_services(services.Pass()); | 101 params->set_services(services.Pass()); |
100 params->set_exposed_services(service_provider.Pass()); | 102 params->set_exposed_services(service_provider.Pass()); |
| 103 params->set_filter(shell::GetPermissiveCapabilityFilter()); |
101 context_->application_manager()->ConnectToApplication(params.Pass()); | 104 context_->application_manager()->ConnectToApplication(params.Pass()); |
102 EXPECT_FALSE(state_.runner_was_created); | 105 EXPECT_FALSE(state_.runner_was_created); |
103 EXPECT_FALSE(state_.runner_was_started); | 106 EXPECT_FALSE(state_.runner_was_started); |
104 EXPECT_FALSE(state_.runner_was_destroyed); | 107 EXPECT_FALSE(state_.runner_was_destroyed); |
105 } | 108 } |
106 | 109 |
107 } // namespace | 110 } // namespace |
108 } // namespace runner | 111 } // namespace runner |
109 } // namespace mojo | 112 } // namespace mojo |
OLD | NEW |