chromium/ui/base/interaction/interaction_test_util.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "ui/base/interaction/interaction_test_util.h"
#include <functional>

namespace ui::test {

namespace {

template <typename... Args>
ActionResult Simulate(
    const std::vector<std::unique_ptr<InteractionTestUtil::Simulator>>&
        simulators,
    ActionResult (InteractionTestUtil::Simulator::*method)(Args...),
    Args... args) {}

}  // namespace

ActionResult InteractionTestUtil::Simulator::PressButton(TrackedElement*,
                                                         InputType) {}

ActionResult InteractionTestUtil::Simulator::SelectMenuItem(TrackedElement*,
                                                            InputType) {}

ActionResult InteractionTestUtil::Simulator::DoDefaultAction(TrackedElement*,
                                                             InputType) {}

ActionResult InteractionTestUtil::Simulator::SelectTab(TrackedElement*,
                                                       size_t,
                                                       InputType) {}

ActionResult InteractionTestUtil::Simulator::SelectDropdownItem(TrackedElement*,
                                                                size_t,
                                                                InputType) {}

ActionResult InteractionTestUtil::Simulator::EnterText(TrackedElement* element,
                                                       std::u16string text,
                                                       TextEntryMode mode) {}

ActionResult InteractionTestUtil::Simulator::ActivateSurface(
    TrackedElement* element) {}

#if !BUILDFLAG(IS_IOS)
ActionResult InteractionTestUtil::Simulator::SendAccelerator(
    TrackedElement* element,
    Accelerator accelerator) {}
#endif

ActionResult InteractionTestUtil::Simulator::Confirm(TrackedElement* element) {}

InteractionTestUtil::InteractionTestUtil() = default;
InteractionTestUtil::~InteractionTestUtil() = default;

ActionResult InteractionTestUtil::PressButton(TrackedElement* element,
                                              InputType input_type) {}

ActionResult InteractionTestUtil::SelectMenuItem(TrackedElement* element,
                                                 InputType input_type) {}

ActionResult InteractionTestUtil::DoDefaultAction(TrackedElement* element,
                                                  InputType input_type) {}

ActionResult InteractionTestUtil::SelectTab(TrackedElement* tab_collection,
                                            size_t index,
                                            InputType input_type) {}

ActionResult InteractionTestUtil::SelectDropdownItem(TrackedElement* dropdown,
                                                     size_t index,
                                                     InputType input_type) {}

ActionResult InteractionTestUtil::EnterText(TrackedElement* element,
                                            std::u16string text,
                                            TextEntryMode mode) {}

ActionResult InteractionTestUtil::ActivateSurface(TrackedElement* element) {}

#if !BUILDFLAG(IS_IOS)
ActionResult InteractionTestUtil::SendAccelerator(TrackedElement* element,
                                                  Accelerator accelerator) {}
#endif

ActionResult InteractionTestUtil::Confirm(TrackedElement* element) {}

void PrintTo(InteractionTestUtil::InputType input_type, std::ostream* os) {}

std::ostream& operator<<(std::ostream& os,
                         InteractionTestUtil::InputType input_type) {}

}  // namespace ui::test