chromium/chrome/browser/sync/test/integration/two_client_web_apps_integration_test_win.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/sync/test/integration/two_client_web_apps_integration_test_base.h"
#include "content/public/test/browser_test.h"

namespace web_app::integration_tests {
namespace {

// This test is a part of the web app integration test suite, which is
// documented in //chrome/browser/ui/views/web_apps/README.md. For information
// about diagnosing, debugging and/or disabling tests, please look to the
// README file.

using WebAppIntegration = TwoClientWebAppsIntegrationTestBase;

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_31Standalone_79StandaloneStandaloneOriginal_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_87Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.InstallOmniboxIcon(InstallableSite::kStandalone);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.CheckWindowControlsOverlayToggle(Site::kStandalone,
                                           IsShown::kNotShown);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient1);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.ApplyRunOnOsLoginPolicyRunWindowed(Site::kStandalone);
  helper_.CheckRunOnOsLoginDisabled(Site::kStandalone);
  helper_.InstallLocally(Site::kStandalone);
  helper_.CheckRunOnOsLoginEnabled(Site::kStandalone);
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_31Standalone_79StandaloneStandaloneOriginal_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_87Standalone_42_45Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.InstallOmniboxIcon(InstallableSite::kStandalone);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.CheckWindowControlsOverlayToggle(Site::kStandalone,
                                           IsShown::kNotShown);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SyncTurnOn();
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_47Standalone_79StandaloneStandaloneOriginal_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_87Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.InstallMenuOption(InstallableSite::kStandalone);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.CheckWindowControlsOverlayToggle(Site::kStandalone,
                                           IsShown::kNotShown);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient1);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.ApplyRunOnOsLoginPolicyRunWindowed(Site::kStandalone);
  helper_.CheckRunOnOsLoginDisabled(Site::kStandalone);
  helper_.InstallLocally(Site::kStandalone);
  helper_.CheckRunOnOsLoginEnabled(Site::kStandalone);
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_47Standalone_79StandaloneStandaloneOriginal_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_87Standalone_42_45Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.InstallMenuOption(InstallableSite::kStandalone);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.CheckWindowControlsOverlayToggle(Site::kStandalone,
                                           IsShown::kNotShown);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SyncTurnOn();
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_29StandaloneWindowed_79StandaloneStandaloneOriginal_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_87Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.CreateShortcut(Site::kStandalone, WindowOptions::kWindowed);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.CheckWindowControlsOverlayToggle(Site::kStandalone,
                                           IsShown::kNotShown);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient1);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.ApplyRunOnOsLoginPolicyRunWindowed(Site::kStandalone);
  helper_.CheckRunOnOsLoginDisabled(Site::kStandalone);
  helper_.InstallLocally(Site::kStandalone);
  helper_.CheckRunOnOsLoginEnabled(Site::kStandalone);
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_29StandaloneWindowed_79StandaloneStandaloneOriginal_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_87Standalone_42_45Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.CreateShortcut(Site::kStandalone, WindowOptions::kWindowed);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckWindowCreated();
  helper_.CheckAppInListWindowed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.CheckWindowControlsOverlayToggle(Site::kStandalone,
                                           IsShown::kNotShown);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SyncTurnOn();
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
}

IN_PROC_BROWSER_TEST_F(
    WebAppIntegration,
    WAI_29StandaloneBrowser_79StandaloneStandaloneOriginal_11Standalone_7Standalone_40Client2_45Standalone_41_87Standalone_42_45Standalone) {
  // Test contents are generated by script. Please do not modify!
  // See `docs/webapps/why-is-this-test-failing.md` or
  // `docs/webapps/integration-testing-framework` for more info.
  // Gardeners: Disabling this test is supported.
  helper_.CreateShortcut(Site::kStandalone, WindowOptions::kBrowser);
  helper_.CheckAppTitle(Site::kStandalone, Title::kStandaloneOriginal);
  helper_.CheckAppInListTabbed(Site::kStandalone);
  helper_.CheckPlatformShortcutAndIcon(Site::kStandalone);
  helper_.SwitchProfileClients(ProfileClient::kClient2);
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
  helper_.SyncTurnOff();
  helper_.UninstallFromOs(Site::kStandalone);
  helper_.SyncTurnOn();
  helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone);
}

}  // namespace
}  // namespace web_app::integration_tests