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

Unified Diff: mojo/runner/native_runner_unittest.cc

Issue 1358533004: Move more of ContentHandler handling 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/runner/context.cc ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/native_runner_unittest.cc
diff --git a/mojo/runner/native_runner_unittest.cc b/mojo/runner/native_runner_unittest.cc
index 25f01a6208556c7886654d79f1dc34c070f1f4f2..d75373841c8fdbbb05f28595b6e8d295db55cbb5 100644
--- a/mojo/runner/native_runner_unittest.cc
+++ b/mojo/runner/native_runner_unittest.cc
@@ -4,6 +4,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
+#include "mojo/package_manager/package_manager_impl.h"
#include "mojo/runner/context.h"
#include "mojo/shell/application_manager.h"
#include "mojo/util/filename_util.h"
@@ -60,28 +61,26 @@ class TestNativeRunnerFactory : public shell::NativeRunnerFactory {
class NativeApplicationLoaderTest : public testing::Test {
public:
NativeApplicationLoaderTest() {
- base::FilePath shell_dir;
- PathService::Get(base::DIR_MODULE, &shell_dir);
- context_.reset(new Context(shell_dir));
loop_.reset(new base::MessageLoop);
}
~NativeApplicationLoaderTest() override {
loop_.reset();
- context_.reset();
}
void SetUp() override {
- context_->Init();
+ base::FilePath shell_dir;
+ PathService::Get(base::DIR_MODULE, &shell_dir);
+ scoped_ptr<package_manager::PackageManagerImpl> package_manager(
+ new package_manager::PackageManagerImpl(shell_dir, nullptr));
scoped_ptr<shell::NativeRunnerFactory> factory(
new TestNativeRunnerFactory(&state_));
- context_->application_manager()->set_native_runner_factory(factory.Pass());
- context_->application_manager()->set_blocking_pool(
- context_->task_runners()->blocking_pool());
+ application_manager_.reset(new shell::ApplicationManager(
+ package_manager.Pass(), factory.Pass(), nullptr));
}
- void TearDown() override { context_->Shutdown(); }
+ void TearDown() override { application_manager_.reset(); }
protected:
scoped_ptr<base::MessageLoop> loop_;
- scoped_ptr<Context> context_;
+ scoped_ptr<shell::ApplicationManager> application_manager_;
TestState state_;
};
@@ -90,15 +89,11 @@ TEST_F(NativeApplicationLoaderTest, DoesNotExist) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::FilePath nonexistent_file(FILE_PATH_LITERAL("nonexistent.txt"));
GURL url(util::FilePathToFileURL(temp_dir.path().Append(nonexistent_file)));
- InterfaceRequest<ServiceProvider> services;
- ServiceProviderPtr service_provider;
scoped_ptr<shell::ConnectToApplicationParams> params(
new shell::ConnectToApplicationParams);
params->SetTargetURL(url);
- params->set_services(services.Pass());
- params->set_exposed_services(service_provider.Pass());
- context_->application_manager()->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(params.Pass());
EXPECT_FALSE(state_.runner_was_created);
EXPECT_FALSE(state_.runner_was_started);
EXPECT_FALSE(state_.runner_was_destroyed);
« no previous file with comments | « mojo/runner/context.cc ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698