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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 343 |
344 // We expose Validator to the test application via ConnectToApplication | 344 // We expose Validator to the test application via ConnectToApplication |
345 // because we don't allow the test application to connect to test:validator. | 345 // because we don't allow the test application to connect to test:validator. |
346 // Adding it to the CapabilityFilter would interfere with the test. | 346 // Adding it to the CapabilityFilter would interfere with the test. |
347 ServiceProviderPtr exposed_services; | 347 ServiceProviderPtr exposed_services; |
348 (new ServiceProviderImpl(GetProxy(&exposed_services)))-> | 348 (new ServiceProviderImpl(GetProxy(&exposed_services)))-> |
349 AddService<Validator>(validator_); | 349 AddService<Validator>(validator_); |
350 URLRequestPtr request(URLRequest::New()); | 350 URLRequestPtr request(URLRequest::New()); |
351 request->url = String::From(url); | 351 request->url = String::From(url); |
352 application_manager_->ConnectToApplication( | 352 application_manager_->ConnectToApplication( |
353 nullptr, request.Pass(), std::string(), GURL(), GetProxy(&services), | 353 nullptr, request.Pass(), std::string(), GURL(), |
| 354 ApplicationManager::kInvalidContentHandlerID, GetProxy(&services), |
354 exposed_services.Pass(), filter, | 355 exposed_services.Pass(), filter, |
355 base::MessageLoop::QuitWhenIdleClosure()); | 356 base::MessageLoop::QuitWhenIdleClosure(), EmptyConnectCallback()); |
356 } | 357 } |
357 | 358 |
358 void InitValidator(const std::set<std::string>& expectations) { | 359 void InitValidator(const std::set<std::string>& expectations) { |
359 validator_ = new ConnectionValidator(expectations, &loop_); | 360 validator_ = new ConnectionValidator(expectations, &loop_); |
360 application_manager()->SetLoaderForURL(make_scoped_ptr(validator_), | 361 application_manager()->SetLoaderForURL(make_scoped_ptr(validator_), |
361 GURL("test:validator")); | 362 GURL("test:validator")); |
362 } | 363 } |
363 | 364 |
364 template <class T> | 365 template <class T> |
365 void CreateLoader(const std::string& url) { | 366 void CreateLoader(const std::string& url) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 RunTest(); | 546 RunTest(); |
546 } | 547 } |
547 | 548 |
548 TEST_F(CapabilityFilter_WildcardsTest, ContentHandler) { | 549 TEST_F(CapabilityFilter_WildcardsTest, ContentHandler) { |
549 RunContentHandlerTest(); | 550 RunContentHandlerTest(); |
550 } | 551 } |
551 | 552 |
552 } // namespace | 553 } // namespace |
553 } // namespace shell | 554 } // namespace shell |
554 } // namespace mojo | 555 } // namespace mojo |
OLD | NEW |