Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Side by Side Diff: trunk/src/mojo/service_manager/service_manager_unittest.cc

Issue 299263002: Revert 272472 "Mojo: nuke EnvironmentData" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/at_exit.h"
6 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
7 #include "mojo/public/cpp/bindings/allocation_scope.h" 6 #include "mojo/public/cpp/bindings/allocation_scope.h"
7 #include "mojo/public/cpp/environment/environment.h"
8 #include "mojo/public/cpp/shell/application.h" 8 #include "mojo/public/cpp/shell/application.h"
9 #include "mojo/public/interfaces/shell/shell.mojom.h" 9 #include "mojo/public/interfaces/shell/shell.mojom.h"
10 #include "mojo/service_manager/service_loader.h" 10 #include "mojo/service_manager/service_loader.h"
11 #include "mojo/service_manager/service_manager.h" 11 #include "mojo/service_manager/service_manager.h"
12 #include "mojo/service_manager/test.mojom.h" 12 #include "mojo/service_manager/test.mojom.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace { 16 namespace {
17 17
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 test_client_.reset(NULL); 173 test_client_.reset(NULL);
174 service_manager_.reset(NULL); 174 service_manager_.reset(NULL);
175 } 175 }
176 176
177 bool HasFactoryForTestURL() { 177 bool HasFactoryForTestURL() {
178 ServiceManager::TestAPI manager_test_api(service_manager_.get()); 178 ServiceManager::TestAPI manager_test_api(service_manager_.get());
179 return manager_test_api.HasFactoryForURL(GURL(kTestURLString)); 179 return manager_test_api.HasFactoryForURL(GURL(kTestURLString));
180 } 180 }
181 181
182 protected: 182 protected:
183 base::ShadowingAtExitManager at_exit_; 183 mojo::Environment env_;
184 base::MessageLoop loop_; 184 base::MessageLoop loop_;
185 TestContext context_; 185 TestContext context_;
186 scoped_ptr<TestClientImpl> test_client_; 186 scoped_ptr<TestClientImpl> test_client_;
187 scoped_ptr<ServiceManager> service_manager_; 187 scoped_ptr<ServiceManager> service_manager_;
188 DISALLOW_COPY_AND_ASSIGN(ServiceManagerTest); 188 DISALLOW_COPY_AND_ASSIGN(ServiceManagerTest);
189 }; 189 };
190 190
191 TEST_F(ServiceManagerTest, Basic) { 191 TEST_F(ServiceManagerTest, Basic) {
192 test_client_->Test("test"); 192 test_client_->Test("test");
193 loop_.Run(); 193 loop_.Run();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 std::string url("test:test3"); 271 std::string url("test:test3");
272 MessagePipe pipe1; 272 MessagePipe pipe1;
273 sm.Connect(GURL(url), pipe1.handle0.Pass()); 273 sm.Connect(GURL(url), pipe1.handle0.Pass());
274 EXPECT_EQ(1, interceptor.call_count()); 274 EXPECT_EQ(1, interceptor.call_count());
275 EXPECT_EQ(url, interceptor.url_spec()); 275 EXPECT_EQ(url, interceptor.url_spec());
276 EXPECT_EQ(1, default_loader->num_loads()); 276 EXPECT_EQ(1, default_loader->num_loads());
277 } 277 }
278 278
279 } // namespace mojo 279 } // namespace mojo
OLDNEW
« no previous file with comments | « trunk/src/mojo/public/cpp/environment/lib/environment.cc ('k') | trunk/src/mojo/services/dbus_echo/dbus_echo_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698