chromium/chrome/browser/extensions/app_window_uitest.cc

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

#include "build/build_config.h"
#include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
#include "content/public/test/browser_test.h"
#include "extensions/browser/app_window/native_app_window.h"

namespace extensions {

namespace {

class AppWindowTest : public PlatformAppBrowserTest {};

}  // namespace

// Tests are flaky on Mac as transitioning to fullscreen is not instantaneous
// and throws errors when entering/exiting fullscreen too quickly.
#if BUILDFLAG(IS_MAC)
#define MAYBE_InitAlwaysOnTopToFullscreen
#else
#define MAYBE_InitAlwaysOnTopToFullscreen
#endif

// Tests a window created with always-on-top enabled and ensures that the
// property is temporarily switched off when entering fullscreen mode.
IN_PROC_BROWSER_TEST_F(AppWindowTest, MAYBE_InitAlwaysOnTopToFullscreen) {}

#if BUILDFLAG(IS_MAC)
#define MAYBE_RuntimeAlwaysOnTopToFullscreen
#else
#define MAYBE_RuntimeAlwaysOnTopToFullscreen
#endif

// Tests a window with always-on-top enabled at runtime and ensures that the
// property is temporarily switched off when entering fullscreen mode.
IN_PROC_BROWSER_TEST_F(AppWindowTest, MAYBE_RuntimeAlwaysOnTopToFullscreen) {}

#if BUILDFLAG(IS_MAC)
#define MAYBE_InitFullscreenToAlwaysOnTop
#else
#define MAYBE_InitFullscreenToAlwaysOnTop
#endif

// Tests a window created initially in fullscreen mode and ensures that the
// always-on-top property does not get applied until it exits fullscreen.
IN_PROC_BROWSER_TEST_F(AppWindowTest, MAYBE_InitFullscreenToAlwaysOnTop) {}

#if BUILDFLAG(IS_MAC)
#define MAYBE_RuntimeFullscreenToAlwaysOnTop
#else
#define MAYBE_RuntimeFullscreenToAlwaysOnTop
#endif

// Tests a window that enters fullscreen mode at runtime and ensures that the
// always-on-top property does not get applied until it exits fullscreen.
IN_PROC_BROWSER_TEST_F(AppWindowTest, MAYBE_RuntimeFullscreenToAlwaysOnTop) {}

#if BUILDFLAG(IS_MAC)
#define MAYBE_InitFullscreenAndAlwaysOnTop
#else
#define MAYBE_InitFullscreenAndAlwaysOnTop
#endif

// Tests a window created with both fullscreen and always-on-top enabled. Ensure
// that always-on-top is only applied when the window exits fullscreen.
IN_PROC_BROWSER_TEST_F(AppWindowTest, MAYBE_InitFullscreenAndAlwaysOnTop) {}

#if BUILDFLAG(IS_MAC)
#define MAYBE_DisableAlwaysOnTopInFullscreen
#else
#define MAYBE_DisableAlwaysOnTopInFullscreen
#endif

// Tests a window created with always-on-top enabled, but then disabled while
// in fullscreen mode. After exiting fullscreen, always-on-top should remain
// disabled.
IN_PROC_BROWSER_TEST_F(AppWindowTest, MAYBE_DisableAlwaysOnTopInFullscreen) {}

// Tests a window created with showInShelf property enabled is indeed marked
// as shown in shelf in AppWindow.
IN_PROC_BROWSER_TEST_F(AppWindowTest, InitShowInShelf) {}

}  // namespace extensions