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

Side by Side Diff: mojo/shell/application_manager_unittest.cc

Issue 1455833005: Convert ConnectToApplication to take a params class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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
« no previous file with comments | « mojo/shell/application_manager_apptest_driver.cc ('k') | mojo/shell/capability_filter_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 base::MessageLoop* loop_; 239 base::MessageLoop* loop_;
240 }; 240 };
241 241
242 // Used to test that the requestor url will be correctly passed. 242 // Used to test that the requestor url will be correctly passed.
243 class TestAImpl : public TestA { 243 class TestAImpl : public TestA {
244 public: 244 public:
245 TestAImpl(ApplicationImpl* app_impl, 245 TestAImpl(ApplicationImpl* app_impl,
246 TesterContext* test_context, 246 TesterContext* test_context,
247 InterfaceRequest<TestA> request) 247 InterfaceRequest<TestA> request)
248 : test_context_(test_context), binding_(this, request.Pass()) { 248 : test_context_(test_context), binding_(this, request.Pass()) {
249 mojo::URLRequestPtr request2(mojo::URLRequest::New()); 249 connection_ = app_impl->ConnectToApplication(kTestBURLString);
250 request2->url = mojo::String::From(kTestBURLString);
251 connection_ = app_impl->ConnectToApplication(request2.Pass());
252 connection_->ConnectToService(&b_); 250 connection_->ConnectToService(&b_);
253 } 251 }
254 252
255 ~TestAImpl() override { 253 ~TestAImpl() override {
256 test_context_->IncrementNumADeletes(); 254 test_context_->IncrementNumADeletes();
257 if (base::MessageLoop::current()->is_running()) 255 if (base::MessageLoop::current()->is_running())
258 Quit(); 256 Quit();
259 } 257 }
260 258
261 private: 259 private:
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 622
625 // A different identity because the domain is different. 623 // A different identity because the domain is different.
626 ConnectToService(application_manager_.get(), 624 ConnectToService(application_manager_.get(),
627 GURL("http://www.another_domain.org/abc"), &test_service); 625 GURL("http://www.another_domain.org/abc"), &test_service);
628 EXPECT_EQ(4, test_loader_->num_loads()); 626 EXPECT_EQ(4, test_loader_->num_loads());
629 } 627 }
630 628
631 } // namespace test 629 } // namespace test
632 } // namespace shell 630 } // namespace shell
633 } // namespace mojo 631 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/application_manager_apptest_driver.cc ('k') | mojo/shell/capability_filter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698