Commit 31a9bb81 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

WebAppWindowAshCrash uses web_app:: functions

The test BookmarkAppWindowAshCrash in
ExtensionUninstallDialogViewBrowserTest was using extensions
functions to install a bookmark app. We now use web_app::
functions so the test will continue to pass when we enable
the DesktopPWAsWithoutExtensions flag.


Bug: 1052722
Change-Id: I2745e434d12f6386f69509308bab3076efa7ad44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067785Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744110}
parent 61c84eb5
......@@ -14,6 +14,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h"
#include "chrome/common/web_application_info.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/test/browser_test_utils.h"
......@@ -134,22 +135,24 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
}
#if defined(OS_CHROMEOS)
// Test that we don't crash when uninstalling an extension from a bookmark app
// Test that we don't crash when uninstalling an extension from a web app
// window in Ash. Context: crbug.com/825554
IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
BookmarkAppWindowAshCrash) {
WebAppWindowAshCrash) {
scoped_refptr<const extensions::Extension> extension(BuildTestExtension());
extensions::ExtensionSystem::Get(browser()->profile())
->extension_service()
->AddExtension(extension.get());
WebApplicationInfo info;
info.app_url = GURL("https://test.com/");
const extensions::Extension* bookmark_app =
extensions::browsertest_util::InstallBookmarkApp(browser()->profile(),
info);
Browser* app_browser = extensions::browsertest_util::LaunchAppBrowser(
browser()->profile(), bookmark_app);
const GURL app_url = GURL("https://test.com/");
auto web_app_info = std::make_unique<WebApplicationInfo>();
web_app_info->app_url = app_url;
web_app_info->scope = app_url;
web_app_info->open_as_window = true;
web_app::AppId app_id =
web_app::InstallWebApp(browser()->profile(), std::move(web_app_info));
Browser* app_browser =
web_app::LaunchWebAppBrowser(browser()->profile(), app_id);
std::unique_ptr<extensions::ExtensionUninstallDialog> dialog;
{
......
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