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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "mojo/public/bindings/allocation_scope.h" | 6 #include "mojo/public/bindings/allocation_scope.h" |
7 #include "mojo/public/bindings/remote_ptr.h" | 7 #include "mojo/public/bindings/remote_ptr.h" |
8 #include "mojo/public/environment/environment.h" | 8 #include "mojo/public/environment/environment.h" |
9 #include "mojo/public/shell/application.h" | 9 #include "mojo/public/shell/application.h" |
10 #include "mojo/public/shell/shell.mojom.h" | 10 #include "mojo/public/shell/shell.mojom.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 class ServiceManagerTest : public testing::Test, public ServiceLoader { | 76 class ServiceManagerTest : public testing::Test, public ServiceLoader { |
77 public: | 77 public: |
78 ServiceManagerTest() {} | 78 ServiceManagerTest() {} |
79 | 79 |
80 virtual ~ServiceManagerTest() {} | 80 virtual ~ServiceManagerTest() {} |
81 | 81 |
82 virtual void SetUp() OVERRIDE { | 82 virtual void SetUp() OVERRIDE { |
83 GURL test_url(kTestURLString); | 83 GURL test_url(kTestURLString); |
84 service_manager_.reset(new ServiceManager); | 84 service_manager_.reset(new ServiceManager); |
85 service_manager_->SetLoaderForURL(this, test_url); | 85 service_manager_->SetLoaderForScheme(this, "test"); |
86 | 86 |
87 InterfacePipe<TestService, AnyInterface> pipe; | 87 InterfacePipe<TestService, AnyInterface> pipe; |
88 test_client_.reset(new TestClientImpl(pipe.handle_to_self.Pass())); | 88 test_client_.reset(new TestClientImpl(pipe.handle_to_self.Pass())); |
89 service_manager_->Connect(test_url, pipe.handle_to_peer.Pass()); | 89 service_manager_->Connect(test_url, pipe.handle_to_peer.Pass()); |
90 } | 90 } |
91 | 91 |
92 virtual void TearDown() OVERRIDE { | 92 virtual void TearDown() OVERRIDE { |
93 test_client_.reset(NULL); | 93 test_client_.reset(NULL); |
94 test_app_.reset(NULL); | 94 test_app_.reset(NULL); |
95 service_manager_.reset(NULL); | 95 service_manager_.reset(NULL); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 test_client_->Test("test"); | 134 test_client_->Test("test"); |
135 EXPECT_TRUE(HasFactoryForTestURL()); | 135 EXPECT_TRUE(HasFactoryForTestURL()); |
136 loop_.Run(); | 136 loop_.Run(); |
137 EXPECT_EQ(1, context_.num_impls); | 137 EXPECT_EQ(1, context_.num_impls); |
138 test_client_.reset(NULL); | 138 test_client_.reset(NULL); |
139 loop_.Run(); | 139 loop_.Run(); |
140 EXPECT_EQ(0, context_.num_impls); | 140 EXPECT_EQ(0, context_.num_impls); |
141 EXPECT_FALSE(HasFactoryForTestURL()); | 141 EXPECT_FALSE(HasFactoryForTestURL()); |
142 } | 142 } |
143 } // namespace mojo | 143 } // namespace mojo |
OLD | NEW |