Commit ea2b05e6 authored by nancy's avatar nancy Committed by Commit Bot

Remove SetAppServiceProxyForTesting and CreateForTesting.

AppServiceProxy.CreateForTesting and
AppServiceAppModelBuilder.SetAppServiceProxyForTesting can be removed,
as proxy can use ReInitializeForTesting to reset the connector for test
cases. So those two functions are no longer used.

BUG=998004

Change-Id: I98b190e294493461b5af0d0aa0f3b64bc25c2e85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797830
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarNigel Tao <nigeltao@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695879}
parent 46a57310
......@@ -70,13 +70,6 @@ AppServiceProxy::InnerIconLoader::LoadIconFromIconKey(
return nullptr;
}
// static
AppServiceProxy* AppServiceProxy::CreateForTesting(
Profile* profile,
service_manager::Connector* connector) {
return new AppServiceProxy(profile, connector);
}
AppServiceProxy::AppServiceProxy(Profile* profile)
: AppServiceProxy(profile, nullptr) {}
......
......@@ -39,10 +39,6 @@ class AppServiceProxy : public KeyedService,
public apps::IconLoader,
public apps::mojom::Subscriber {
public:
static AppServiceProxy* CreateForTesting(
Profile* profile,
service_manager::Connector* connector);
explicit AppServiceProxy(Profile* profile);
~AppServiceProxy() override;
......
......@@ -29,10 +29,6 @@ bool ShouldShowInLauncher(const apps::AppUpdate& update) {
} // namespace
// static
apps::AppServiceProxy*
AppServiceAppModelBuilder::app_service_proxy_for_testing_ = nullptr;
// Folder items are created by the Ash process and their existence is
// communicated to chrome via the AppListClient. Therefore, Crostini has an
// observer that listens for the creation of its folder, and updates the
......@@ -78,19 +74,9 @@ AppServiceAppModelBuilder::~AppServiceAppModelBuilder() {
}
}
// static
apps::AppServiceProxy* AppServiceAppModelBuilder::SetAppServiceProxyForTesting(
apps::AppServiceProxy* proxy) {
apps::AppServiceProxy* old = app_service_proxy_for_testing_;
app_service_proxy_for_testing_ = proxy;
return old;
}
void AppServiceAppModelBuilder::BuildModel() {
apps::AppServiceProxy* proxy =
app_service_proxy_for_testing_
? app_service_proxy_for_testing_
: apps::AppServiceProxyFactory::GetForProfile(profile());
apps::AppServiceProxyFactory::GetForProfile(profile());
if (proxy) {
proxy->AppRegistryCache().ForEachApp(
[this](const apps::AppUpdate& update) { OnAppUpdate(update); });
......
......@@ -11,10 +11,6 @@
class AppListControllerDelegate;
namespace apps {
class AppServiceProxy;
}
class AppServiceAppModelBuilder : public AppListModelBuilder,
public apps::AppRegistryCache::Observer {
public:
......@@ -22,14 +18,9 @@ class AppServiceAppModelBuilder : public AppListModelBuilder,
~AppServiceAppModelBuilder() override;
static apps::AppServiceProxy* SetAppServiceProxyForTesting(
apps::AppServiceProxy* proxy);
private:
class CrostiniFolderObserver;
static apps::AppServiceProxy* app_service_proxy_for_testing_;
// AppListModelBuilder overrides:
void BuildModel() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment