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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |