chromium/chrome/browser/ui/exclusive_access/fullscreen_interactive_browsertest.cc

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

#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/run_until.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/test/fullscreen_test_util.h"
#include "chrome/browser/ui/test/popup_test_base.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/metrics/content/subprocess_metrics_provider.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/site_isolation_policy.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"

namespace {

// UMA Key for tracking duration of fullscreen requests.
static constexpr char kFullscreenDurationMetricKeyRequestFullscreen[] =;

class FullscreenWebContentsObserver : public content::WebContentsObserver {};

}  // namespace

class FullscreenInteractiveBrowserTest : public InProcessBrowserTest {};

// https://crbug.com/1087875: Flaky on Linux, Mac and Windows.
// TODO(crbug.com/40810181): Flaky on Chrome OS.
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
    BUILDFLAG(IS_WIN)
#define MAYBE_NotifyFullscreenAcquired
#else
#define MAYBE_NotifyFullscreenAcquired
#endif
IN_PROC_BROWSER_TEST_F(FullscreenInteractiveBrowserTest,
                       MAYBE_NotifyFullscreenAcquired) {}

IN_PROC_BROWSER_TEST_F(FullscreenInteractiveBrowserTest,
                       NotifyFullscreenAcquired_SameOrigin) {}

IN_PROC_BROWSER_TEST_F(FullscreenInteractiveBrowserTest,
                       FullscreenDurationUmaLogged) {}

// TODO(crbug.com/40810181): Flaky on Chrome OS.
// TODO(crbug.com/40133132): Flaky on Linux.
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
#define MAYBE_FullscreenDurationUmaLoggedCrossProcess
#else
#define MAYBE_FullscreenDurationUmaLoggedCrossProcess
#endif
IN_PROC_BROWSER_TEST_F(FullscreenInteractiveBrowserTest,
                       MAYBE_FullscreenDurationUmaLoggedCrossProcess) {}