diff options
author | ben <ben@chromium.org> | 2016-03-08 20:08:17 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-09 04:09:07 +0000 |
commit | c18f9cc14a916cf131b6cb8f001e469d0a26de43 (patch) | |
tree | 9d2b0e50d2c344ac144818357ae9a5136c59dd5a /mojo/shell/background | |
parent | f7a51f72543e18c667a45178d97cbab5337bcc45 (diff) | |
download | chromium_src-c18f9cc14a916cf131b6cb8f001e469d0a26de43.zip chromium_src-c18f9cc14a916cf131b6cb8f001e469d0a26de43.tar.gz chromium_src-c18f9cc14a916cf131b6cb8f001e469d0a26de43.tar.bz2 |
Rename PackageManager->Catalog.
TBR=sky@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1775243002
Cr-Commit-Position: refs/heads/master@{#380062}
Diffstat (limited to 'mojo/shell/background')
-rw-r--r-- | mojo/shell/background/BUILD.gn | 2 | ||||
-rw-r--r-- | mojo/shell/background/background_shell.cc | 5 | ||||
-rw-r--r-- | mojo/shell/background/background_shell.h | 8 | ||||
-rw-r--r-- | mojo/shell/background/tests/BUILD.gn | 6 | ||||
-rw-r--r-- | mojo/shell/background/tests/background_shell_unittest.cc | 13 | ||||
-rw-r--r-- | mojo/shell/background/tests/test_catalog_store.cc (renamed from mojo/shell/background/tests/test_application_catalog_store.cc) | 19 | ||||
-rw-r--r-- | mojo/shell/background/tests/test_catalog_store.h (renamed from mojo/shell/background/tests/test_application_catalog_store.h) | 17 |
7 files changed, 34 insertions, 36 deletions
diff --git a/mojo/shell/background/BUILD.gn b/mojo/shell/background/BUILD.gn index fa83fae..75eb28f 100644 --- a/mojo/shell/background/BUILD.gn +++ b/mojo/shell/background/BUILD.gn @@ -18,7 +18,7 @@ source_set("lib") { deps = [ "//base", "//mojo/message_pump", - "//mojo/services/package_manager:lib", + "//mojo/services/catalog:lib", "//mojo/shell", "//mojo/shell/public/cpp:sources", "//mojo/shell/runner:init", diff --git a/mojo/shell/background/background_shell.cc b/mojo/shell/background/background_shell.cc index 24ec075..e336e2c 100644 --- a/mojo/shell/background/background_shell.cc +++ b/mojo/shell/background/background_shell.cc @@ -12,7 +12,7 @@ #include "base/synchronization/waitable_event.h" #include "base/threading/simple_thread.h" #include "mojo/message_pump/message_pump_mojo.h" -#include "mojo/services/package_manager/package_manager.h" +#include "mojo/services/catalog/catalog.h" #include "mojo/shell/connect_params.h" #include "mojo/shell/loader.h" #include "mojo/shell/public/cpp/shell_client.h" @@ -122,7 +122,8 @@ class BackgroundShell::MojoThread : public base::SimpleThread { scoped_ptr<mojo::shell::Context::InitParams> context_init_params( new mojo::shell::Context::InitParams); if (init_params_) { - context_init_params->app_catalog = std::move(init_params_->app_catalog); + context_init_params->catalog_store = + std::move(init_params_->catalog_store); context_init_params->native_runner_delegate = init_params_->native_runner_delegate; } diff --git a/mojo/shell/background/background_shell.h b/mojo/shell/background/background_shell.h index 95248b1..3aa16b9 100644 --- a/mojo/shell/background/background_shell.h +++ b/mojo/shell/background/background_shell.h @@ -10,11 +10,11 @@ #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "mojo/public/cpp/bindings/interface_request.h" -#include "mojo/services/package_manager/package_manager.h" +#include "mojo/services/catalog/catalog.h" #include "mojo/shell/public/interfaces/shell_client.mojom.h" -namespace package_manager { -class ApplicationCatalogStore; +namespace catalog { +class Store; } namespace mojo { @@ -33,7 +33,7 @@ class BackgroundShell { ~InitParams(); NativeRunnerDelegate* native_runner_delegate = nullptr; - scoped_ptr<package_manager::ApplicationCatalogStore> app_catalog; + scoped_ptr<catalog::Store> catalog_store; }; BackgroundShell(); diff --git a/mojo/shell/background/tests/BUILD.gn b/mojo/shell/background/tests/BUILD.gn index b6037522..d3b8b19 100644 --- a/mojo/shell/background/tests/BUILD.gn +++ b/mojo/shell/background/tests/BUILD.gn @@ -9,13 +9,13 @@ import("//testing/test.gni") source_set("test_support") { sources = [ - "test_application_catalog_store.cc", - "test_application_catalog_store.h", + "test_catalog_store.cc", + "test_catalog_store.h", ] deps = [ "//base", - "//mojo/services/package_manager:lib", + "//mojo/services/catalog:lib", "//url", ] } diff --git a/mojo/shell/background/tests/background_shell_unittest.cc b/mojo/shell/background/tests/background_shell_unittest.cc index ccaf3ea..82b36b1 100644 --- a/mojo/shell/background/tests/background_shell_unittest.cc +++ b/mojo/shell/background/tests/background_shell_unittest.cc @@ -6,7 +6,7 @@ #include "base/run_loop.h" #include "mojo/shell/background/tests/test.mojom.h" -#include "mojo/shell/background/tests/test_application_catalog_store.h" +#include "mojo/shell/background/tests/test_catalog_store.h" #include "mojo/shell/public/cpp/connector.h" #include "mojo/shell/public/cpp/shell_client.h" #include "mojo/shell/public/cpp/shell_connection.h" @@ -27,10 +27,10 @@ class ShellClientImpl : public ShellClient { DISALLOW_COPY_AND_ASSIGN(ShellClientImpl); }; -scoped_ptr<TestApplicationCatalogStore> BuildTestApplicationCatalogStore() { +scoped_ptr<TestCatalogStore> BuildTestCatalogStore() { scoped_ptr<base::ListValue> apps(new base::ListValue); apps->Append(BuildPermissiveSerializedAppInfo(kTestName, "test")); - return make_scoped_ptr(new TestApplicationCatalogStore(std::move(apps))); + return make_scoped_ptr(new TestCatalogStore(std::move(apps))); } } // namespace @@ -50,10 +50,9 @@ TEST(BackgroundShellTest, MAYBE_Basic) { BackgroundShell background_shell; scoped_ptr<BackgroundShell::InitParams> init_params( new BackgroundShell::InitParams); - scoped_ptr<TestApplicationCatalogStore> store_ptr = - BuildTestApplicationCatalogStore(); - TestApplicationCatalogStore* store = store_ptr.get(); - init_params->app_catalog = std::move(store_ptr); + scoped_ptr<TestCatalogStore> store_ptr = BuildTestCatalogStore(); + TestCatalogStore* store = store_ptr.get(); + init_params->catalog_store = std::move(store_ptr); background_shell.Init(std::move(init_params)); ShellClientImpl shell_client; ShellConnection shell_connection( diff --git a/mojo/shell/background/tests/test_application_catalog_store.cc b/mojo/shell/background/tests/test_catalog_store.cc index d5de582..32a1aa4 100644 --- a/mojo/shell/background/tests/test_application_catalog_store.cc +++ b/mojo/shell/background/tests/test_catalog_store.cc @@ -2,40 +2,39 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "mojo/shell/background/tests/test_application_catalog_store.h" +#include "mojo/shell/background/tests/test_catalog_store.h" -using package_manager::ApplicationCatalogStore; +using catalog::Store; namespace mojo { namespace shell { -TestApplicationCatalogStore::TestApplicationCatalogStore( - scoped_ptr<base::ListValue> store) +TestCatalogStore::TestCatalogStore(scoped_ptr<base::ListValue> store) : store_(std::move(store)) {} -TestApplicationCatalogStore::~TestApplicationCatalogStore() {} +TestCatalogStore::~TestCatalogStore() {} -const base::ListValue* TestApplicationCatalogStore::GetStore() { +const base::ListValue* TestCatalogStore::GetStore() { get_store_called_ = true; return store_.get(); } -void TestApplicationCatalogStore::UpdateStore( +void TestCatalogStore::UpdateStore( scoped_ptr<base::ListValue> store) {} scoped_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( const std::string& name, const std::string& display_name) { scoped_ptr<base::DictionaryValue> app(new base::DictionaryValue); - app->SetString(ApplicationCatalogStore::kNameKey, name); - app->SetString(ApplicationCatalogStore::kDisplayNameKey, display_name); + app->SetString(Store::kNameKey, name); + app->SetString(Store::kDisplayNameKey, display_name); scoped_ptr<base::DictionaryValue> capabilities(new base::DictionaryValue); scoped_ptr<base::ListValue> interfaces(new base::ListValue); interfaces->AppendString("*"); capabilities->Set("*", std::move(interfaces)); - app->Set(ApplicationCatalogStore::kCapabilitiesKey, std::move(capabilities)); + app->Set(Store::kCapabilitiesKey, std::move(capabilities)); return app; } diff --git a/mojo/shell/background/tests/test_application_catalog_store.h b/mojo/shell/background/tests/test_catalog_store.h index 5b2cf96..9793798 100644 --- a/mojo/shell/background/tests/test_application_catalog_store.h +++ b/mojo/shell/background/tests/test_catalog_store.h @@ -2,25 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MOJO_SHELL_BACKGROUND_TESTS_TEST_APPLICATION_CATALOG_STORE_H_ -#define MOJO_SHELL_BACKGROUND_TESTS_TEST_APPLICATION_CATALOG_STORE_H_ +#ifndef MOJO_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ +#define MOJO_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ #include <string> #include "base/memory/scoped_ptr.h" #include "base/values.h" -#include "mojo/services/package_manager/package_manager.h" +#include "mojo/services/catalog/catalog.h" namespace mojo { namespace shell { // ApplicationCatalogStore implementation that takes the ListValue to return // as store. -class TestApplicationCatalogStore - : public package_manager::ApplicationCatalogStore { +class TestCatalogStore : public catalog::Store { public: - explicit TestApplicationCatalogStore(scoped_ptr<base::ListValue> store); - ~TestApplicationCatalogStore() override; + explicit TestCatalogStore(scoped_ptr<base::ListValue> store); + ~TestCatalogStore() override; bool get_store_called() const { return get_store_called_; } @@ -32,7 +31,7 @@ class TestApplicationCatalogStore bool get_store_called_ = false; scoped_ptr<base::ListValue> store_; - DISALLOW_COPY_AND_ASSIGN(TestApplicationCatalogStore); + DISALLOW_COPY_AND_ASSIGN(TestCatalogStore); }; // Returns a dictionary for an app with the specified name, display name and a @@ -44,4 +43,4 @@ scoped_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( } // namespace shell } // namespace mojo -#endif // MOJO_SHELL_BACKGROUND_TESTS_TEST_APPLICATION_CATALOG_STORE_H_ +#endif // MOJO_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |