chromium/remoting/protocol/mouse_input_filter_unittest.cc

// Copyright 2012 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 "remoting/protocol/mouse_input_filter.h"

#include "remoting/proto/event.pb.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "remoting/protocol/test_event_matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"

_;
InSequence;

namespace remoting::protocol {

EqualsMouseMoveEvent;

static MouseEvent MouseMoveEvent(int x, int y) {}

struct Point {};

class MouseInputFilterTest : public testing::Test {};

// Verify that no events get through if we don't set either dimensions.
TEST_F(MouseInputFilterTest, NoDimensionsSet) {}

// Verify that no events get through if there's no input size.
TEST_F(MouseInputFilterTest, InputDimensionsZero) {}

// Verify that no events get through if there's no output size.
TEST_F(MouseInputFilterTest, OutputDimensionsZero) {}

// Verify that no events get through when input and output are both set to zero.
TEST_F(MouseInputFilterTest, BothDimensionsZero) {}

// Verify that no events get through if the input and output are both set to
// one.  This is an edge case as a 1x1 desktop is nonsensical but it's good to
// have a test to exercise the code path in case of errant values being set.
TEST_F(MouseInputFilterTest, BothDimensionsOne) {}

// Verify that a min-size desktop (2x2) is handled. This is an edge case test,
// not something we'd expect to need to handle in the real world.
TEST_F(MouseInputFilterTest, BothDimensionsTwo) {}

// Verify that no events get through if negative dimensions are provided.
TEST_F(MouseInputFilterTest, NegativeDimensionsHandled) {}

// Verify that all events get through, clamped to the output.
TEST_F(MouseInputFilterTest, NoScalingOrClipping) {}

// Verify that we can up-scale with clamping.
TEST_F(MouseInputFilterTest, UpScalingAndClamping) {}

// Verify that we can down-scale with clamping.
TEST_F(MouseInputFilterTest, DownScalingAndClamping) {}

// Multimon tests

// Default display = Left (A)
// o-------------+-----------------+
// | A           | B               |
// | 2560x1440   | 3840x2160       |
// |             |                 |
// |-------------+                 |
//               +-----------------+
// o = desktop origin

TEST_F(MouseInputFilterTest, MultimonLeftDefault_FullDesktop) {}

TEST_F(MouseInputFilterTest, MultimonLeftDefault_ShowLeftDisplay) {}

TEST_F(MouseInputFilterTest, MultimonLeftDefault_ShowRightDisplay) {}

// Default display = Right (A)
// +-----------------o-------------+
// | B               | A           |
// | 3840x2160       | 2560x1440   |
// |                 |             |
// |                 |-------------+
// +-----------------+
// o = desktop origin

TEST_F(MouseInputFilterTest, MultimonRightDefault_ShowLeftDisplay) {}

TEST_F(MouseInputFilterTest, MultimonRightDefault_ShowRightDisplay) {}

}  // namespace remoting::protocol