Commit 7c999321 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions Cleanup] Remove InstallBookmarkApp()

Remove ExtensionBrowserTest::InstallBookmarkApp() and
browsertest_util::InstallBookmarkApp(). Neither were used.

Bug: None
Change-Id: Ie6164c30430f4ac8ecef9d4645c01c3c72736e2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2141626Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757715}
parent 47bfc302
......@@ -21,14 +21,8 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/web_applications/components/install_manager.h"
#include "chrome/browser/web_applications/components/web_app_constants.h"
#include "chrome/browser/web_applications/components/web_app_helpers.h"
#include "chrome/browser/web_applications/components/web_app_install_utils.h"
#include "chrome/browser/web_applications/components/web_app_provider_base.h"
#include "chrome/browser/web_applications/components/web_app_tab_helper_base.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/web_application_info.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
......@@ -58,39 +52,6 @@ void CreateAndInitializeLocalCache() {
#endif
}
const Extension* InstallBookmarkApp(Profile* profile, WebApplicationInfo info) {
size_t num_extensions =
ExtensionRegistry::Get(profile)->enabled_extensions().size();
base::RunLoop run_loop;
web_app::AppId app_id;
auto* provider = web_app::WebAppProviderBase::GetProviderBase(profile);
DCHECK(provider);
provider->install_manager().InstallWebAppFromInfo(
std::make_unique<WebApplicationInfo>(info),
web_app::ForInstallableSite::kYes,
/*install_source=*/WebappInstallSource::OMNIBOX_INSTALL_ICON,
base::BindLambdaForTesting([&](const web_app::AppId& installed_app_id,
web_app::InstallResultCode code) {
DCHECK_EQ(web_app::InstallResultCode::kSuccessNewInstall, code);
app_id = installed_app_id;
run_loop.Quit();
}));
const Extension* app = nullptr;
run_loop.Run();
app = ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(app_id);
EXPECT_EQ(++num_extensions,
ExtensionRegistry::Get(profile)->enabled_extensions().size());
DCHECK(app);
extensions::SetLaunchType(profile, app->id(),
info.open_as_window
? extensions::LAUNCH_TYPE_WINDOW
: extensions::LAUNCH_TYPE_REGULAR);
return app;
}
Browser* LaunchAppBrowser(Profile* profile, const Extension* extension_app) {
EXPECT_TRUE(
apps::AppServiceProxyFactory::GetForProfile(profile)
......
......@@ -8,7 +8,6 @@
class Browser;
class GURL;
class Profile;
struct WebApplicationInfo;
namespace content {
class WebContents;
......@@ -26,9 +25,6 @@ namespace browsertest_util {
// actual production devices, but some tests need to do it manually.
void CreateAndInitializeLocalCache();
// Installs a Bookmark App into |profile| using |info|.
const Extension* InstallBookmarkApp(Profile* profile, WebApplicationInfo info);
// Launches a new app window for |app| in |profile|.
Browser* LaunchAppBrowser(Profile* profile, const Extension* app);
......
......@@ -45,10 +45,8 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/extension_message_bubble_factory.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/web_applications/extensions/web_app_extension_shortcut.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/web_application_info.h"
#include "components/crx_file/crx_verifier.h"
#include "components/sync/model/string_ordinal.h"
#include "components/version_info/version_info.h"
......@@ -519,11 +517,6 @@ const Extension* ExtensionBrowserTest::UpdateExtensionWaitForIdle(
browser(), Extension::NO_FLAGS, false, false);
}
const Extension* ExtensionBrowserTest::InstallBookmarkApp(
WebApplicationInfo info) {
return browsertest_util::InstallBookmarkApp(profile(), std::move(info));
}
const Extension* ExtensionBrowserTest::InstallExtensionFromWebstore(
const base::FilePath& path,
int expected_change) {
......
......@@ -34,7 +34,6 @@
#include "extensions/common/manifest.h"
class Profile;
struct WebApplicationInfo;
namespace extensions {
class ExtensionCacheFake;
......@@ -231,9 +230,6 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest {
Manifest::INTERNAL, browser(), Extension::NO_FLAGS, false, true);
}
// Installs bookmark app for |info|.
const Extension* InstallBookmarkApp(WebApplicationInfo info);
// Installs extension as if it came from the Chrome Webstore.
const Extension* InstallExtensionFromWebstore(const base::FilePath& path,
int expected_change);
......
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