1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
// Copyright 2023 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/ui/browser.h"
#include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h"
#include "chrome/browser/ui/web_applications/web_app_browsertest_base.h"
#include "chrome/browser/web_applications/test/web_app_test_utils.h"
#include "content/public/test/browser_test.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
namespace web_app {
namespace {
using WebAppStatusBarTest = WebAppBrowserTestBase;
IN_PROC_BROWSER_TEST_F(WebAppStatusBarTest, NoStatusBar) {
NavigateViaLinkClickToURLAndWait(
browser(), https_server()->GetURL("/web_apps/basic.html"));
const webapps::AppId app_id = test::InstallPwaForCurrentUrl(browser());
Browser* const app_browser =
::web_app::LaunchWebAppBrowserAndWait(profile(), app_id);
EXPECT_EQ(0u, app_browser->GetStatusBubblesForTesting().size());
}
IN_PROC_BROWSER_TEST_F(WebAppStatusBarTest, DisplayBrowserHasStatusBar) {
NavigateViaLinkClickToURLAndWait(
browser(), https_server()->GetURL("/web_apps/display_browser.html"));
const webapps::AppId app_id = test::InstallPwaForCurrentUrl(browser());
Browser* const app_browser =
::web_app::LaunchWebAppBrowserAndWait(profile(), app_id);
EXPECT_LT(0u, app_browser->GetStatusBubblesForTesting().size());
}
IN_PROC_BROWSER_TEST_F(WebAppStatusBarTest, NoManifestHasStatusBar) {
NavigateViaLinkClickToURLAndWait(
browser(), https_server()->GetURL("/banners/no_manifest_test_page.html"));
const webapps::AppId app_id = test::InstallPwaForCurrentUrl(browser());
Browser* const app_browser =
::web_app::LaunchWebAppBrowserAndWait(profile(), app_id);
EXPECT_LT(0u, app_browser->GetStatusBubblesForTesting().size());
}
IN_PROC_BROWSER_TEST_F(WebAppStatusBarTest, DisplayMinimalUiHasStatusBar) {
NavigateViaLinkClickToURLAndWait(
browser(), https_server()->GetURL("/web_apps/minimal_ui/basic.html"));
const webapps::AppId app_id = test::InstallPwaForCurrentUrl(browser());
Browser* const app_browser =
::web_app::LaunchWebAppBrowserAndWait(profile(), app_id);
EXPECT_LT(0u, app_browser->GetStatusBubblesForTesting().size());
}
} // namespace
} // namespace web_app
|