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

Unified Diff: mojo/shell/application_manager_unittest.cc

Issue 1350023002: Revert of 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.cc ('k') | mojo/shell/capability_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager_unittest.cc
diff --git a/mojo/shell/application_manager_unittest.cc b/mojo/shell/application_manager_unittest.cc
index 77a959c1e98f00ae4a0bf1ae1f1805e697634ad8..644c965c2dbc9ae6f73d7de850ae63658f4e241e 100644
--- a/mojo/shell/application_manager_unittest.cc
+++ b/mojo/shell/application_manager_unittest.cc
@@ -15,11 +15,11 @@
#include "mojo/application/public/interfaces/content_handler.mojom.h"
#include "mojo/application/public/interfaces/service_provider.mojom.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/fetcher.h"
#include "mojo/shell/test.mojom.h"
-#include "mojo/shell/test_package_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
@@ -456,13 +456,13 @@
ScopedVector<TestAImpl> a_bindings_;
};
-class AMTestPackageManager : public TestPackageManager {
- public:
- AMTestPackageManager()
+class TestApplicationFetcher : public ApplicationFetcher {
+ public:
+ TestApplicationFetcher()
: create_test_fetcher_(false),
fetcher_url_("xxx"),
mime_type_(kTestMimeType) {}
- ~AMTestPackageManager() override {}
+ ~TestApplicationFetcher() override {}
void set_create_test_fetcher(bool create_test_fetcher) {
create_test_fetcher_ = create_test_fetcher;
@@ -472,7 +472,8 @@
void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; }
- // TestPackageManager:
+ // ApplicationManager::Delegate
+ void SetApplicationManager(ApplicationManager* manager) override {}
GURL ResolveURL(const GURL& url) override {
GURL resolved_url = url;
// The shell automatically map mojo URLs.
@@ -494,7 +495,7 @@
GURL fetcher_url_;
std::string mime_type_;
- DISALLOW_COPY_AND_ASSIGN(AMTestPackageManager);
+ DISALLOW_COPY_AND_ASSIGN(TestApplicationFetcher);
};
class ApplicationManagerTest : public testing::Test {
@@ -505,7 +506,7 @@
void SetUp() override {
application_manager_.reset(new ApplicationManager(
- make_scoped_ptr(new AMTestPackageManager)));
+ make_scoped_ptr(new TestApplicationFetcher)));
test_loader_ = new TestApplicationLoader;
test_loader_->set_context(&context_);
application_manager_->set_default_loader(
@@ -562,7 +563,7 @@
TEST_F(ApplicationManagerTest, Deletes) {
{
- ApplicationManager am(make_scoped_ptr(new AMTestPackageManager));
+ ApplicationManager am(make_scoped_ptr(new TestApplicationFetcher));
TestApplicationLoader* default_loader = new TestApplicationLoader;
default_loader->set_context(&context_);
TestApplicationLoader* url_loader1 = new TestApplicationLoader;
@@ -708,13 +709,13 @@
const GURL requestor_url("http://requestor.url");
TestContext test_context;
base::MessageLoop loop;
- scoped_ptr<AMTestPackageManager> test_package_manager(
- new AMTestPackageManager);
- test_package_manager->set_create_test_fetcher(true);
- test_package_manager->RegisterContentHandler(kTestMimeType,
- content_handler_url);
- ApplicationManager application_manager(test_package_manager.Pass());
+ scoped_ptr<TestApplicationFetcher> test_application_fetcher(
+ new TestApplicationFetcher);
+ test_application_fetcher->set_create_test_fetcher(true);
+ ApplicationManager application_manager(test_application_fetcher.Pass());
application_manager.set_default_loader(nullptr);
+ application_manager.RegisterContentHandler(kTestMimeType,
+ content_handler_url);
TestApplicationLoader* loader = new TestApplicationLoader;
loader->set_context(&test_context);
@@ -774,14 +775,14 @@
const GURL content_handler_url("http://test.content.handler");
const GURL requestor_url("http://requestor.url");
TestContext test_context;
- scoped_ptr<AMTestPackageManager> test_package_manager(
- new AMTestPackageManager);
- test_package_manager->set_fetcher_url(GURL("test:test"));
- test_package_manager->set_create_test_fetcher(true);
- test_package_manager->RegisterContentHandler(kTestMimeType,
- content_handler_url);
- ApplicationManager application_manager(test_package_manager.Pass());
+ scoped_ptr<TestApplicationFetcher> test_application_fetcher(
+ new TestApplicationFetcher);
+ test_application_fetcher->set_fetcher_url(GURL("test:test"));
+ test_application_fetcher->set_create_test_fetcher(true);
+ ApplicationManager application_manager(test_application_fetcher.Pass());
application_manager.set_default_loader(nullptr);
+ application_manager.RegisterContentHandler(kTestMimeType,
+ content_handler_url);
TestApplicationLoader* content_handler_loader = new TestApplicationLoader;
content_handler_loader->set_create_content_handler(true);
@@ -833,13 +834,14 @@
const GURL content_handler_url("http://test.content.handler");
const GURL requestor_url("http://requestor.url");
TestContext test_context;
- AMTestPackageManager* test_package_manager = new AMTestPackageManager;
- test_package_manager->set_fetcher_url(GURL("test:test"));
- test_package_manager->set_create_test_fetcher(true);
- test_package_manager->RegisterContentHandler(kTestMimeType,
- content_handler_url);
- ApplicationManager application_manager(make_scoped_ptr(test_package_manager));
+ TestApplicationFetcher* test_application_fetcher = new TestApplicationFetcher;
+ test_application_fetcher->set_fetcher_url(GURL("test:test"));
+ test_application_fetcher->set_create_test_fetcher(true);
+ ApplicationManager application_manager(
+ make_scoped_ptr(test_application_fetcher));
application_manager.set_default_loader(nullptr);
+ application_manager.RegisterContentHandler(kTestMimeType,
+ content_handler_url);
TestApplicationLoader* content_handler_loader = new TestApplicationLoader;
content_handler_loader->set_create_content_handler(true);
@@ -868,10 +870,9 @@
const std::string mime_type2("test/mime-type2");
const GURL content_handler_url2("http://test.content2.handler");
- test_package_manager->set_fetcher_url(GURL("test2:test2"));
- test_package_manager->set_mime_type(mime_type2);
- test_package_manager->RegisterContentHandler(mime_type2,
- content_handler_url2);
+ test_application_fetcher->set_fetcher_url(GURL("test2:test2"));
+ test_application_fetcher->set_mime_type(mime_type2);
+ application_manager.RegisterContentHandler(mime_type2, content_handler_url2);
TestApplicationLoader* content_handler_loader2 = new TestApplicationLoader;
content_handler_loader->set_create_content_handler(true);
« no previous file with comments | « mojo/shell/application_manager.cc ('k') | mojo/shell/capability_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698