Commit 21eb53d6 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

SystemWebAppIntegrationTest tests bookmark and web apps

All tests using SystemWebAppIntegrationTest are now parameterized,
and run with both bookmark and web app backend implementations.


Bug: 1058274
Change-Id: Iffd8f1bf1242bab126de70d36fb4683981915ff9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2086461Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746684}
parent f6e5e968
......@@ -25,16 +25,22 @@ class HelpAppIntegrationTest : public SystemWebAppIntegrationTest {
// Test that the Help App installs and launches correctly. Runs some spot
// checks on the manifest.
IN_PROC_BROWSER_TEST_F(HelpAppIntegrationTest, HelpAppV2) {
IN_PROC_BROWSER_TEST_P(HelpAppIntegrationTest, HelpAppV2) {
const GURL url(chromeos::kChromeUIHelpAppURL);
EXPECT_NO_FATAL_FAILURE(
ExpectSystemWebAppValid(web_app::SystemAppType::HELP, url, "Discover"));
}
// Test that the Help App is searchable by additional strings.
IN_PROC_BROWSER_TEST_F(HelpAppIntegrationTest, HelpAppV2SearchInLauncher) {
IN_PROC_BROWSER_TEST_P(HelpAppIntegrationTest, HelpAppV2SearchInLauncher) {
WaitForSystemAppInstallAndLaunch(web_app::SystemAppType::HELP);
EXPECT_EQ(
std::vector<std::string>({"Get Help", "Perks", "Offers"}),
GetManager().GetAdditionalSearchTerms(web_app::SystemAppType::HELP));
}
INSTANTIATE_TEST_SUITE_P(All,
HelpAppIntegrationTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
......@@ -161,7 +161,7 @@ content::EvalJsResult ClearOpenedImage(content::WebContents* web_ui) {
// Test that the Media App installs and launches correctly. Runs some spot
// checks on the manifest.
IN_PROC_BROWSER_TEST_F(MediaAppIntegrationTest, MediaApp) {
IN_PROC_BROWSER_TEST_P(MediaAppIntegrationTest, MediaApp) {
const GURL url(chromeos::kChromeUIMediaAppURL);
EXPECT_NO_FATAL_FAILURE(
ExpectSystemWebAppValid(web_app::SystemAppType::MEDIA, url, "Media App"));
......@@ -169,7 +169,7 @@ IN_PROC_BROWSER_TEST_F(MediaAppIntegrationTest, MediaApp) {
// Test that the MediaApp successfully loads a file passed in on its launch
// params.
IN_PROC_BROWSER_TEST_F(MediaAppIntegrationTest, MediaAppLaunchWithFile) {
IN_PROC_BROWSER_TEST_P(MediaAppIntegrationTest, MediaAppLaunchWithFile) {
WaitForTestSystemAppInstall();
auto params = LaunchParamsForApp(web_app::SystemAppType::MEDIA);
......@@ -193,7 +193,7 @@ IN_PROC_BROWSER_TEST_F(MediaAppIntegrationTest, MediaAppLaunchWithFile) {
// Ensures that chrome://media-app is available as a file task for the ChromeOS
// file manager and eligible for opening appropriate files / mime types.
IN_PROC_BROWSER_TEST_F(MediaAppIntegrationTest, MediaAppEligibleOpenTask) {
IN_PROC_BROWSER_TEST_P(MediaAppIntegrationTest, MediaAppEligibleOpenTask) {
constexpr bool kIsDirectory = false;
const extensions::EntryInfo image_entry(TestFile(kFilePng800x600),
"image/png", kIsDirectory);
......@@ -226,7 +226,7 @@ IN_PROC_BROWSER_TEST_F(MediaAppIntegrationTest, MediaAppEligibleOpenTask) {
// End-to-end test to ensure that the MediaApp successfully registers as a file
// handler with the ChromeOS file manager on startup and acts as the default
// handler for a given file.
IN_PROC_BROWSER_TEST_F(MediaAppIntegrationWithFilesAppTest,
IN_PROC_BROWSER_TEST_P(MediaAppIntegrationWithFilesAppTest,
FileOpenUsesMediaApp) {
WaitForTestSystemAppInstall();
Browser* test_browser = chrome::FindBrowserWithActiveWindow();
......@@ -255,7 +255,7 @@ IN_PROC_BROWSER_TEST_F(MediaAppIntegrationWithFilesAppTest,
// Test that the MediaApp can navigate other files in the directory of a file
// that was opened.
IN_PROC_BROWSER_TEST_F(MediaAppIntegrationWithFilesAppTest,
IN_PROC_BROWSER_TEST_P(MediaAppIntegrationWithFilesAppTest,
FileOpenCanTraverseDirectory) {
WaitForTestSystemAppInstall();
......@@ -310,3 +310,15 @@ IN_PROC_BROWSER_TEST_F(MediaAppIntegrationWithFilesAppTest,
EXPECT_EQ(true, ExecuteScript(web_ui, "advance(1)"));
EXPECT_EQ("800x600", WaitForOpenedImage(web_ui));
}
INSTANTIATE_TEST_SUITE_P(All,
MediaAppIntegrationTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
INSTANTIATE_TEST_SUITE_P(All,
MediaAppIntegrationWithFilesAppTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
......@@ -11,8 +11,14 @@ using SampleSystemWebAppIntegrationTest = SystemWebAppIntegrationTest;
// Test that the Sample System Web App installs and launches correctly. Runs
// some spot checks on the manifest.
IN_PROC_BROWSER_TEST_F(SampleSystemWebAppIntegrationTest, SampleSystemWebApp) {
IN_PROC_BROWSER_TEST_P(SampleSystemWebAppIntegrationTest, SampleSystemWebApp) {
const GURL url(chromeos::kChromeUISampleSystemWebAppURL);
EXPECT_NO_FATAL_FAILURE(ExpectSystemWebAppValid(
web_app::SystemAppType::SAMPLE, url, "Sample System Web App"));
}
INSTANTIATE_TEST_SUITE_P(All,
SampleSystemWebAppIntegrationTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
......@@ -17,7 +17,7 @@
#include "ui/aura/window.h"
SystemWebAppIntegrationTest::SystemWebAppIntegrationTest()
: SystemWebAppManagerBrowserTestBase(false /* install_mock */) {}
: SystemWebAppManagerBrowserTest(false /* install_mock */) {}
SystemWebAppIntegrationTest::~SystemWebAppIntegrationTest() = default;
......
......@@ -18,9 +18,8 @@ class Profile;
// Test harness for how ChromeOS System Web Apps integrate with the System Web
// App platform.
// TODO(crbug.com/1058274): Inherit from SystemWebAppManagerBrowserTest.
class SystemWebAppIntegrationTest
: public web_app::SystemWebAppManagerBrowserTestBase {
: public web_app::SystemWebAppManagerBrowserTest {
public:
SystemWebAppIntegrationTest();
~SystemWebAppIntegrationTest() 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