| 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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "mojo/application_manager/application_loader.h" | 9 #include "mojo/application_manager/application_loader.h" |
| 10 #include "mojo/application_manager/application_manager.h" | 10 #include "mojo/application_manager/application_manager.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 scoped_ptr<ApplicationLoader> real_loader( | 438 scoped_ptr<ApplicationLoader> real_loader( |
| 439 new Tester(&tester_context_, requestor_url)); | 439 new Tester(&tester_context_, requestor_url)); |
| 440 scoped_ptr<BackgroundShellApplicationLoader> loader( | 440 scoped_ptr<BackgroundShellApplicationLoader> loader( |
| 441 new BackgroundShellApplicationLoader(real_loader.Pass(), | 441 new BackgroundShellApplicationLoader(real_loader.Pass(), |
| 442 std::string(), | 442 std::string(), |
| 443 base::MessageLoop::TYPE_DEFAULT)); | 443 base::MessageLoop::TYPE_DEFAULT)); |
| 444 return loader.Pass(); | 444 return loader.Pass(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void AddLoaderForURL(const GURL& url, const std::string& requestor_url) { | 447 void AddLoaderForURL(const GURL& url, const std::string& requestor_url) { |
| 448 application_manager_->SetLoaderForURL( | 448 application_manager_->SetLoaderForURL(MakeLoader(requestor_url), url); |
| 449 MakeLoader(requestor_url).PassAs<ApplicationLoader>(), url); | |
| 450 } | 449 } |
| 451 | 450 |
| 452 bool HasFactoryForTestURL() { | 451 bool HasFactoryForTestURL() { |
| 453 ApplicationManager::TestAPI manager_test_api(application_manager_.get()); | 452 ApplicationManager::TestAPI manager_test_api(application_manager_.get()); |
| 454 return manager_test_api.HasFactoryForURL(GURL(kTestURLString)); | 453 return manager_test_api.HasFactoryForURL(GURL(kTestURLString)); |
| 455 } | 454 } |
| 456 | 455 |
| 457 protected: | 456 protected: |
| 458 base::ShadowingAtExitManager at_exit_; | 457 base::ShadowingAtExitManager at_exit_; |
| 459 TesterContext tester_context_; | 458 TesterContext tester_context_; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 std::string url("test:test3"); | 676 std::string url("test:test3"); |
| 678 TestServicePtr test_service; | 677 TestServicePtr test_service; |
| 679 application_manager_->ConnectToService(GURL(url), &test_service); | 678 application_manager_->ConnectToService(GURL(url), &test_service); |
| 680 | 679 |
| 681 EXPECT_EQ(1, interceptor.call_count()); | 680 EXPECT_EQ(1, interceptor.call_count()); |
| 682 EXPECT_EQ(url, interceptor.url_spec()); | 681 EXPECT_EQ(url, interceptor.url_spec()); |
| 683 EXPECT_EQ(1, default_loader->num_loads()); | 682 EXPECT_EQ(1, default_loader->num_loads()); |
| 684 } | 683 } |
| 685 | 684 |
| 686 } // namespace mojo | 685 } // namespace mojo |
| OLD | NEW |