Commit f9175b9f authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Improve PendingAppManagerImplBrowserTest expectation

PendingAppManagerImplBrowserTest.BypassServiceWorkerCheck tests whether
the pending app installation installs the app as a PWA rather than a
shortcut app. This can be determined by the presence of a scope.
The function FindAppWithUrlInScope() uses a default scope if there isn't
one present so its return value can't be used as an indication of the app
having/not having a scope.

This CL improves the check by explicitly checking GetAppScope().

Change-Id: Ieeb0c9dfb911cf3af5657e53ed86f65b60a8f07d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732516
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Auto-Submit: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683503}
parent 30d17069
...@@ -102,7 +102,8 @@ IN_PROC_BROWSER_TEST_F(PendingAppManagerImplBrowserTest, ...@@ -102,7 +102,8 @@ IN_PROC_BROWSER_TEST_F(PendingAppManagerImplBrowserTest,
InstallApp(std::move(install_options)); InstallApp(std::move(install_options));
base::Optional<AppId> app_id = registrar().FindAppWithUrlInScope(url); base::Optional<AppId> app_id = registrar().FindAppWithUrlInScope(url);
EXPECT_TRUE(app_id.has_value()); EXPECT_TRUE(app_id.has_value());
EXPECT_EQ("Manifest test app", registrar().GetAppShortName(app_id.value())); EXPECT_TRUE(registrar().GetAppScope(*app_id).has_value());
EXPECT_EQ("Manifest test app", registrar().GetAppShortName(*app_id));
} }
IN_PROC_BROWSER_TEST_F(PendingAppManagerImplBrowserTest, IN_PROC_BROWSER_TEST_F(PendingAppManagerImplBrowserTest,
......
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