Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1150)

Unified Diff: mojo/shell/capability_filter_unittest.cc

Issue 1352663002: Extract some stuff into PackageManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/application_manager_unittest.cc ('k') | mojo/shell/package_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/capability_filter_unittest.cc
diff --git a/mojo/shell/capability_filter_unittest.cc b/mojo/shell/capability_filter_unittest.cc
index a659d42b45dddcaeadba7c5da99fc6c82efb3058..0c33a8fbadc076c5c94cc4e40aa14a79e6e05bbf 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,21 +285,17 @@ class TestFetcher : public Fetcher {
DISALLOW_COPY_AND_ASSIGN(TestFetcher);
};
-class TestApplicationFetcher : public ApplicationFetcher {
+class CFTestPackageManager : public TestPackageManager {
public:
- TestApplicationFetcher() {}
- ~TestApplicationFetcher() override {}
+ CFTestPackageManager() {}
+ ~CFTestPackageManager() override {}
void set_use_test_fetcher(bool use_test_fetcher) {
use_test_fetcher_ = use_test_fetcher;
}
private:
- // Overridden from ApplicationFetcher:
- void SetApplicationManager(ApplicationManager* manager) override {}
- GURL ResolveURL(const GURL& url) override {
- return url;
- }
+ // Overridden from TestPackageManager:
void FetchRequest(URLRequestPtr request,
const Fetcher::FetchCallback& loader_callback) override {
if (use_test_fetcher_)
@@ -308,7 +304,7 @@ class TestApplicationFetcher : public ApplicationFetcher {
bool use_test_fetcher_;
- DISALLOW_COPY_AND_ASSIGN(TestApplicationFetcher);
+ DISALLOW_COPY_AND_ASSIGN(CFTestPackageManager);
};
class TestLoader : public ApplicationLoader {
@@ -331,7 +327,7 @@ class TestLoader : public ApplicationLoader {
class CapabilityFilterTest : public testing::Test {
public:
CapabilityFilterTest()
- : test_application_fetcher_(nullptr),
+ : test_package_manager_(nullptr),
validator_(nullptr) {}
~CapabilityFilterTest() override {}
@@ -376,7 +372,7 @@ class CapabilityFilterTest : public testing::Test {
set_use_test_fetcher();
GURL content_handler_url("test:content_handler");
- application_manager()->RegisterContentHandler(kTestMimeType,
+ test_package_manager_->RegisterContentHandler(kTestMimeType,
content_handler_url);
CreateLoader<TestContentHandler>(content_handler_url.spec());
@@ -389,20 +385,20 @@ class CapabilityFilterTest : public testing::Test {
}
ConnectionValidator* validator() { return validator_; }
void set_use_test_fetcher() {
- test_application_fetcher_->set_use_test_fetcher(true);
+ test_package_manager_->set_use_test_fetcher(true);
}
// Overridden from testing::Test:
void SetUp() override {
- test_application_fetcher_ = new TestApplicationFetcher;
+ test_package_manager_ = new CFTestPackageManager;
application_manager_.reset(
- new ApplicationManager(make_scoped_ptr(test_application_fetcher_)));
+ new ApplicationManager(make_scoped_ptr(test_package_manager_)));
CreateLoader<ServiceApplication>("test:service");
CreateLoader<ServiceApplication>("test:service2");
}
void TearDown() override {
application_manager_.reset();
- test_application_fetcher_->set_use_test_fetcher(false);
+ test_package_manager_->set_use_test_fetcher(false);
}
private:
@@ -411,7 +407,7 @@ class CapabilityFilterTest : public testing::Test {
return scoped_ptr<ApplicationDelegate>(new T);
}
- TestApplicationFetcher* test_application_fetcher_;
+ CFTestPackageManager* test_package_manager_;
base::ShadowingAtExitManager at_exit_;
base::MessageLoop loop_;
scoped_ptr<ApplicationManager> application_manager_;
« no previous file with comments | « mojo/shell/application_manager_unittest.cc ('k') | mojo/shell/package_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698