OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 protected: | 334 protected: |
335 void RunApplication(const std::string& url, const CapabilityFilter& filter) { | 335 void RunApplication(const std::string& url, const CapabilityFilter& filter) { |
336 ServiceProviderPtr services; | 336 ServiceProviderPtr services; |
337 | 337 |
338 // We expose Validator to the test application via ConnectToApplication | 338 // We expose Validator to the test application via ConnectToApplication |
339 // because we don't allow the test application to connect to test:validator. | 339 // because we don't allow the test application to connect to test:validator. |
340 // Adding it to the CapabilityFilter would interfere with the test. | 340 // Adding it to the CapabilityFilter would interfere with the test. |
341 ServiceProviderPtr exposed_services; | 341 ServiceProviderPtr exposed_services; |
342 (new ServiceProviderImpl(GetProxy(&exposed_services)))-> | 342 (new ServiceProviderImpl(GetProxy(&exposed_services)))-> |
343 AddService<Validator>(validator_); | 343 AddService<Validator>(validator_); |
| 344 URLRequestPtr request(URLRequest::New()); |
| 345 request->url = String::From(url); |
| 346 |
344 scoped_ptr<ConnectToApplicationParams> params( | 347 scoped_ptr<ConnectToApplicationParams> params( |
345 new ConnectToApplicationParams); | 348 new ConnectToApplicationParams); |
346 params->SetTarget(Identity(GURL(url), std::string(), filter)); | 349 params->SetURLInfo(request.Pass()); |
347 params->set_services(GetProxy(&services)); | 350 params->set_services(GetProxy(&services)); |
348 params->set_exposed_services(exposed_services.Pass()); | 351 params->set_exposed_services(exposed_services.Pass()); |
| 352 params->set_filter(filter); |
349 params->set_on_application_end(base::MessageLoop::QuitWhenIdleClosure()); | 353 params->set_on_application_end(base::MessageLoop::QuitWhenIdleClosure()); |
350 application_manager_->ConnectToApplication(params.Pass()); | 354 application_manager_->ConnectToApplication(params.Pass()); |
351 } | 355 } |
352 | 356 |
353 void InitValidator(const std::set<std::string>& expectations) { | 357 void InitValidator(const std::set<std::string>& expectations) { |
354 validator_ = new ConnectionValidator(expectations, &loop_); | 358 validator_ = new ConnectionValidator(expectations, &loop_); |
355 application_manager()->SetLoaderForURL(make_scoped_ptr(validator_), | 359 application_manager()->SetLoaderForURL(make_scoped_ptr(validator_), |
356 GURL("test:validator")); | 360 GURL("test:validator")); |
357 } | 361 } |
358 | 362 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 RunTest(); | 546 RunTest(); |
543 } | 547 } |
544 | 548 |
545 TEST_F(CapabilityFilter_WildcardsTest, ContentHandler) { | 549 TEST_F(CapabilityFilter_WildcardsTest, ContentHandler) { |
546 RunContentHandlerTest(); | 550 RunContentHandlerTest(); |
547 } | 551 } |
548 | 552 |
549 } // namespace | 553 } // namespace |
550 } // namespace shell | 554 } // namespace shell |
551 } // namespace mojo | 555 } // namespace mojo |
OLD | NEW |