chromium/chrome/browser/ui/web_applications/web_app_interactive_uitest.cc

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

#include <string>

#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/web_applications/web_app_browsertest_base.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/scoped_display_for_new_windows.h"
#include "ui/display/screen.h"
#include "ui/display/screen_base.h"
#include "ui/display/test/virtual_display_util.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/shell.h"
#include "ui/display/test/display_manager_test_api.h"
#endif

namespace web_app {
namespace {
constexpr const char kExampleURL[] =;
}

class WebAppInteractiveUiTest : public WebAppBrowserTestBase {};

// Disabled everywhere except ChromeOS, Mac and Windows because those are the
// only platforms with functional display mocking at the moment. While a partial
// solution is possible using display::Screen::SetScreenInstance on other
// platforms, window placement doesn't work right with a faked Screen
// instance. See: //docs/ui/display/multiscreen_testing.md
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_WIN)
#define MAYBE_TabOpensOnCorrectDisplayMultiScreen
#else
#define MAYBE_TabOpensOnCorrectDisplayMultiScreen
#endif
// Tests that PWAs that open in a tab open tabs on the correct display.
IN_PROC_BROWSER_TEST_F(WebAppInteractiveUiTest,
                       MAYBE_TabOpensOnCorrectDisplayMultiScreen) {}

}  // namespace web_app