chromium/chrome/test/interaction/interactive_browser_test_browsertest.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 "chrome/test/interaction/interactive_browser_test.h"

#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/test/base/test_switches.h"
#include "components/constrained_window/constrained_window_views.h"
#include "content/public/test/browser_test.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/interaction/element_tracker.h"
#include "ui/base/interaction/expect_call_in_scope.h"
#include "ui/base/interaction/interaction_sequence.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/window/dialog_delegate.h"
#include "url/gurl.h"

namespace {
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE();
constexpr char kDocumentWithNamedElement[] =;
constexpr char kDocumentWithLinks[] =;
constexpr char kScrollableDocument[] =;
}  // namespace

class InteractiveBrowserTestBrowsertest : public InteractiveBrowserTest {};

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       EnsurePresentNotPresent) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       EnsureNotPresent_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, EnsurePresent_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, ExecuteJs) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       ExecuteJsFireAndForget) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       ExecuteJsFailsOnThrow) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, CheckJsResult) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultWithPromise) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultWithPromiseFailsOnReject) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, CheckJsResult_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResult_ThrowError_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResult_NoArgument_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, ExecuteJsAt) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       ExecuteJsAtFireAndForget) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       ExecuteJsAtFailsIfElementNotPresent) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       ExecuteJsAtFailsOnThrow) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, CheckJsResultAt) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultAtWithPromise) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultAtWithPromiseFailsOnReject) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultAt_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultAt_ThrowsError_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultAt_BadPath_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       CheckJsResultAt_NoArgument_Fails) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       InstrumentTabsAsTestSteps) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest, ScrollIntoView) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       WaitForStateChangeAcrossNavigation) {}

IN_PROC_BROWSER_TEST_F(InteractiveBrowserTestBrowsertest,
                       WaitForStateChangeWithConditionAcrossNavigation) {}

// Parameter for WebUI coverage tests.
struct CoverageConfig {};

// Test fixture to verify that when EnableWebUICodeCoverage() is called with the
// correct command-line arguments, coverage data actually gets written out. It
// also verifies that
class InteractiveBrowserTestCodeCoverageBrowsertest
    : public InteractiveBrowserTestBrowsertest,
      public testing::WithParamInterface<CoverageConfig> {};

INSTANTIATE_TEST_SUITE_P();

IN_PROC_BROWSER_TEST_P(InteractiveBrowserTestCodeCoverageBrowsertest,
                       TestCoverageEmits) {}

namespace  // namespace

class InteractiveBrowserTestDialogBrowsertest
    : public InteractiveBrowserTest,
      public testing::WithParamInterface<ui::mojom::ModalType> {};

INSTANTIATE_TEST_SUITE_P();

IN_PROC_BROWSER_TEST_P(InteractiveBrowserTestDialogBrowsertest,
                       BrowserModalDialogContext) {}