Commit 46171be2 authored by Eric Willigers's avatar Eric Willigers Committed by Chromium LUCI CQ

Revert "System web apps: Do not launch apps during shutdown"

This reverts commit 813f4fa3.

Reason for revert: Findit suspects test caused failures.

Original change's description:
> System web apps: Do not launch apps during shutdown
>
> If the browser process is shutting down, LaunchSystemWebApp now
> exits early instead of attempting to launch a system web app.
>
> Bug: 1121894
> Change-Id: I4ed8baf23e2e58d79cc097566e2b566fdef78619
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2607978
> Reviewed-by: calamity <calamity@chromium.org>
> Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#840053}

TBR=calamity@chromium.org,ericwilligers@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I885b3f75016ac816c4c4ee715b024e395e9ebf75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1121894
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610403Reviewed-by: default avatarEric Willigers <ericwilligers@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840068}
parent abd08287
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/bind.h" #include "base/test/bind.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "chrome/browser/devtools/protocol/browser_handler.h"
#include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/themes/custom_theme_supplier.h" #include "chrome/browser/themes/custom_theme_supplier.h"
#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_properties.h"
...@@ -30,7 +29,6 @@ ...@@ -30,7 +29,6 @@
#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/common/webui_url_constants.h" #include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h" #include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
...@@ -101,11 +99,8 @@ class AppBrowserControllerBrowserTest : public InProcessBrowserTest { ...@@ -101,11 +99,8 @@ class AppBrowserControllerBrowserTest : public InProcessBrowserTest {
const AppBrowserControllerBrowserTest&) = delete; const AppBrowserControllerBrowserTest&) = delete;
protected: protected:
void InstallMockSystemWebApp() { void InstallAndLaunchMockApp() {
test_system_web_app_installation_->WaitForAppInstall(); test_system_web_app_installation_->WaitForAppInstall();
}
void LaunchMockApp() {
app_browser_ = web_app::LaunchWebAppBrowser( app_browser_ = web_app::LaunchWebAppBrowser(
browser()->profile(), test_system_web_app_installation_->GetAppId()); browser()->profile(), test_system_web_app_installation_->GetAppId());
tabbed_app_url_ = test_system_web_app_installation_->GetAppUrl(); tabbed_app_url_ = test_system_web_app_installation_->GetAppUrl();
...@@ -114,7 +109,8 @@ class AppBrowserControllerBrowserTest : public InProcessBrowserTest { ...@@ -114,7 +109,8 @@ class AppBrowserControllerBrowserTest : public InProcessBrowserTest {
tabbed_app_url_)); tabbed_app_url_));
} }
void LaunchMockPopup() { void InstallAndLaunchMockPopup() {
test_system_web_app_installation_->WaitForAppInstall();
auto params = web_app::CreateSystemWebAppLaunchParams( auto params = web_app::CreateSystemWebAppLaunchParams(
browser()->profile(), test_system_web_app_installation_->GetType(), browser()->profile(), test_system_web_app_installation_->GetType(),
display::kInvalidDisplayId); display::kInvalidDisplayId);
...@@ -125,16 +121,6 @@ class AppBrowserControllerBrowserTest : public InProcessBrowserTest { ...@@ -125,16 +121,6 @@ class AppBrowserControllerBrowserTest : public InProcessBrowserTest {
test_system_web_app_installation_->GetAppUrl(), std::move(*params)); test_system_web_app_installation_->GetAppUrl(), std::move(*params));
} }
void InstallAndLaunchMockApp() {
InstallMockSystemWebApp();
LaunchMockApp();
}
void InstallAndLaunchMockPopup() {
InstallMockSystemWebApp();
LaunchMockPopup();
}
GURL GetActiveTabURL() { GURL GetActiveTabURL() {
return app_browser_->tab_strip_model() return app_browser_->tab_strip_model()
->GetActiveWebContents() ->GetActiveWebContents()
...@@ -266,17 +252,6 @@ IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest, ...@@ -266,17 +252,6 @@ IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest,
EXPECT_FALSE(app_browser_->app_controller()->GetThemeColor().has_value()); EXPECT_FALSE(app_browser_->app_controller()->GetThemeColor().has_value());
} }
IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest, Shutdown) {
InstallMockSystemWebApp();
BrowserHandler handler(nullptr, std::string());
handler.Close();
ui_test_utils::WaitForBrowserToClose();
LaunchMockPopup();
EXPECT_EQ(app_browser_, nullptr);
}
IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest, IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest,
ReuseBrowserForSystemAppPopup) { ReuseBrowserForSystemAppPopup) {
InstallAndLaunchMockPopup(); InstallAndLaunchMockPopup();
......
...@@ -158,11 +158,6 @@ Browser* LaunchSystemWebApp(Profile* profile, ...@@ -158,11 +158,6 @@ Browser* LaunchSystemWebApp(Profile* profile,
const GURL& url, const GURL& url,
base::Optional<apps::AppLaunchParams> params, base::Optional<apps::AppLaunchParams> params,
bool* did_create) { bool* did_create) {
if (Browser::GetBrowserCreationStatusForProfile(profile) !=
Browser::BrowserCreationStatus::kOk) {
return nullptr;
}
Profile* profile_for_launch = GetProfileForSystemWebAppLaunch(profile); Profile* profile_for_launch = GetProfileForSystemWebAppLaunch(profile);
if (profile_for_launch == nullptr || profile_for_launch != profile) { if (profile_for_launch == nullptr || profile_for_launch != profile) {
// The provided profile can't launch system web apps. Complain about this so // The provided profile can't launch system web apps. Complain about this so
......
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