chromium/ui/events/mojom/mojom_traits_unittest.cc

// Copyright 2016 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/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <utility>

#include "build/build_config.h"
#include "mojo/public/cpp/base/time_mojom_traits.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event.h"
#include "ui/events/ipc/ui_events_param_traits_macros.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/mojom/event.mojom.h"
#include "ui/events/mojom/event_mojom_traits.h"
#include "ui/events/test/keyboard_layout.h"
#include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
#include "ui/latency/mojom/latency_info_mojom_traits.h"

#if BUILDFLAG(IS_OZONE)
#include "ui/events/ozone/layout/scoped_keyboard_layout_engine.h"  // nogncheck
#include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"  // nogncheck
#endif

namespace ui {

namespace {

void ExpectTouchEventsEqual(const TouchEvent& expected,
                            const TouchEvent& actual) {}

void ExpectLocatedEventsEqual(const LocatedEvent& expected,
                              const LocatedEvent& actual) {}

void ExpectMouseEventsEqual(const MouseEvent& expected,
                            const MouseEvent& actual) {}

void ExpectMouseWheelEventsEqual(const MouseWheelEvent& expected,
                                 const MouseWheelEvent& actual) {}

void ExpectKeyEventsEqual(const KeyEvent& expected, const KeyEvent& actual) {}

void ExpectEventsEqual(const Event& expected, const Event& actual) {}

}  // namespace

TEST(StructTraitsTest, KeyEvent) {}

TEST(StructTraitsTest, MouseEvent) {}

TEST(StructTraitsTest, MouseWheelEvent) {}

TEST(StructTraitsTest, FloatingPointLocations) {}

TEST(StructTraitsTest, KeyEventPropertiesSerialized) {}

TEST(StructTraitsTest, GestureEvent) {}

TEST(StructTraitsTest, ScrollEvent) {}

TEST(StructTraitsTest, PointerDetails) {}

TEST(StructTraitsTest, TouchEvent) {}

TEST(StructTraitsTest, UnserializedTouchEventFields) {}

#if BUILDFLAG(IS_OZONE)

// Test KeyboardLayoutEngine implementation that always returns 'x'.
class FixedKeyboardLayoutEngine : public StubKeyboardLayoutEngine {};

TEST(StructTraitsTest, DifferentKeyboardLayout) {}

#endif

}  // namespace ui