| Index: mojo/shell/capability_filter_unittest.cc
|
| diff --git a/mojo/shell/capability_filter_unittest.cc b/mojo/shell/capability_filter_unittest.cc
|
| index 0c33a8fbadc076c5c94cc4e40aa14a79e6e05bbf..a659d42b45dddcaeadba7c5da99fc6c82efb3058 100644
|
| --- a/mojo/shell/capability_filter_unittest.cc
|
| +++ b/mojo/shell/capability_filter_unittest.cc
|
| @@ -18,10 +18,10 @@
|
| #include "mojo/application/public/interfaces/content_handler.mojom.h"
|
| #include "mojo/common/weak_binding_set.h"
|
| #include "mojo/public/cpp/bindings/strong_binding.h"
|
| +#include "mojo/shell/application_fetcher.h"
|
| #include "mojo/shell/application_loader.h"
|
| #include "mojo/shell/application_manager.h"
|
| #include "mojo/shell/capability_filter_unittest.mojom.h"
|
| -#include "mojo/shell/test_package_manager.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace mojo {
|
| @@ -285,17 +285,21 @@
|
| DISALLOW_COPY_AND_ASSIGN(TestFetcher);
|
| };
|
|
|
| -class CFTestPackageManager : public TestPackageManager {
|
| - public:
|
| - CFTestPackageManager() {}
|
| - ~CFTestPackageManager() override {}
|
| +class TestApplicationFetcher : public ApplicationFetcher {
|
| + public:
|
| + TestApplicationFetcher() {}
|
| + ~TestApplicationFetcher() override {}
|
|
|
| void set_use_test_fetcher(bool use_test_fetcher) {
|
| use_test_fetcher_ = use_test_fetcher;
|
| }
|
|
|
| private:
|
| - // Overridden from TestPackageManager:
|
| + // Overridden from ApplicationFetcher:
|
| + void SetApplicationManager(ApplicationManager* manager) override {}
|
| + GURL ResolveURL(const GURL& url) override {
|
| + return url;
|
| + }
|
| void FetchRequest(URLRequestPtr request,
|
| const Fetcher::FetchCallback& loader_callback) override {
|
| if (use_test_fetcher_)
|
| @@ -304,7 +308,7 @@
|
|
|
| bool use_test_fetcher_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(CFTestPackageManager);
|
| + DISALLOW_COPY_AND_ASSIGN(TestApplicationFetcher);
|
| };
|
|
|
| class TestLoader : public ApplicationLoader {
|
| @@ -327,7 +331,7 @@
|
| class CapabilityFilterTest : public testing::Test {
|
| public:
|
| CapabilityFilterTest()
|
| - : test_package_manager_(nullptr),
|
| + : test_application_fetcher_(nullptr),
|
| validator_(nullptr) {}
|
| ~CapabilityFilterTest() override {}
|
|
|
| @@ -372,7 +376,7 @@
|
| set_use_test_fetcher();
|
|
|
| GURL content_handler_url("test:content_handler");
|
| - test_package_manager_->RegisterContentHandler(kTestMimeType,
|
| + application_manager()->RegisterContentHandler(kTestMimeType,
|
| content_handler_url);
|
|
|
| CreateLoader<TestContentHandler>(content_handler_url.spec());
|
| @@ -385,20 +389,20 @@
|
| }
|
| ConnectionValidator* validator() { return validator_; }
|
| void set_use_test_fetcher() {
|
| - test_package_manager_->set_use_test_fetcher(true);
|
| + test_application_fetcher_->set_use_test_fetcher(true);
|
| }
|
|
|
| // Overridden from testing::Test:
|
| void SetUp() override {
|
| - test_package_manager_ = new CFTestPackageManager;
|
| + test_application_fetcher_ = new TestApplicationFetcher;
|
| application_manager_.reset(
|
| - new ApplicationManager(make_scoped_ptr(test_package_manager_)));
|
| + new ApplicationManager(make_scoped_ptr(test_application_fetcher_)));
|
| CreateLoader<ServiceApplication>("test:service");
|
| CreateLoader<ServiceApplication>("test:service2");
|
| }
|
| void TearDown() override {
|
| application_manager_.reset();
|
| - test_package_manager_->set_use_test_fetcher(false);
|
| + test_application_fetcher_->set_use_test_fetcher(false);
|
| }
|
|
|
| private:
|
| @@ -407,7 +411,7 @@
|
| return scoped_ptr<ApplicationDelegate>(new T);
|
| }
|
|
|
| - CFTestPackageManager* test_package_manager_;
|
| + TestApplicationFetcher* test_application_fetcher_;
|
| base::ShadowingAtExitManager at_exit_;
|
| base::MessageLoop loop_;
|
| scoped_ptr<ApplicationManager> application_manager_;
|
|
|