#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "device/gamepad/public/cpp/gamepad_mojom_traits.h"
#include "base/test/task_environment.h"
#include "device/gamepad/public/cpp/gamepad.h"
#include "device/gamepad/public/mojom/gamepad.mojom.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace {
enum GamepadTestDataType { … };
Gamepad GetWebGamepadInstance(GamepadTestDataType type) { … }
bool isWebGamepadButtonEqual(const GamepadButton& lhs,
const GamepadButton& rhs) { … }
bool isWebGamepadVectorEqual(const GamepadVector& lhs,
const GamepadVector& rhs) { … }
bool isWebGamepadQuaternionEqual(const GamepadQuaternion& lhs,
const GamepadQuaternion& rhs) { … }
bool isWebGamepadPoseEqual(const GamepadPose& lhs, const GamepadPose& rhs) { … }
bool isWebGamepadTouchEqual(const GamepadTouch& lhs, const GamepadTouch& rhs) { … }
bool isWebGamepadEqual(const Gamepad& send, const Gamepad& echo) { … }
}
class GamepadStructTraitsTest : public testing::Test { … };
TEST_F(GamepadStructTraitsTest, GamepadCommon) { … }
TEST_F(GamepadStructTraitsTest, GamepadPose_HasOrientation) { … }
TEST_F(GamepadStructTraitsTest, GamepadPose_HasPosition) { … }
TEST_F(GamepadStructTraitsTest, GamepadPose_Null) { … }
}