// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/desktop_display_info.h" #include "base/location.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" namespace remoting { // Depending on the platform the origin of the desktop is calculated relative to // the primary display, or relative to the upper-left of the entire desktop // region. See comment at DesktopDisplayInfo::CalcDisplayOffset() for more // information. #define OS_USES_PRIMARY_DISPLAY_AS_ORIGIN … class DesktopDisplayInfoTest : public testing::Test { … }; // o---------+ // | 0 | // | 300x200 | // +---------+ // o = desktop origin TEST_F(DesktopDisplayInfoTest, SingleDisplay) { … } // o---------+------------+ // | 0 | 1 | // | 300x200 | 500x400 | // +---------+ | // +------------+ TEST_F(DesktopDisplayInfoTest, DualDisplayRight) { … } // o---------+------------+ // | 1 | 0 | // | 300x200 | 500x400 | // +---------+ | // +------------+ TEST_F(DesktopDisplayInfoTest, DualDisplayRight_ReverseOrder) { … } // +---------o------------+ // | 1 | 0 | // | 300x200 | 500x400 | // +---------+ | // +------------+ TEST_F(DesktopDisplayInfoTest, DualDisplayLeft) { … } // +---------o------------+ // | 0 | 1 | // | 300x200 | 500x400 | // +---------+ | // +------------+ TEST_F(DesktopDisplayInfoTest, DualDisplayLeft_ReverseOrder) { … } // +---------o------------+ // | 0 | 1 +---------+ // | 300x200 | 500x400 | 2 | // +---------+ | 400x350 | // +------------+---------+ TEST_F(DesktopDisplayInfoTest, TripleDisplayMiddle) { … } // x o-----------+ - 0 // | 0 | // +---------+ 500x400 | - 350 // | 2 +-------+---+-------+ - 400 // | 300x200 | | 1 | // +---------+ | 600x450 | - 550 // +-----------+ - 950 // | | | | | // -300 0 300 500 900 TEST_F(DesktopDisplayInfoTest, Multimon3) { … } // x +-------+ -- -50 // | 1 | // +-------+ | 60x40 | -- -20 // | 4 | +---+---+-----+ -- -10 // | 40x70 o---------+ 0 | -- 0 // +-------+ | 6 | 70x60 | -- 40 // | 2 +-------+ 80x55 +------+--+-----+ -- 50 // | 30x60 | +---------+ | 3 | -- 55 // | | | 55x65 | // +-------+ +--------+ | -- 100 // | 5 +--------+ -- 115 // | 65x20 | // +--------+ -- 120 // | | | | | | | | | | // - - 0 6 7 8 1 1 1 1 // 7 4 0 0 0 2 3 5 9 // 0 0 0 5 0 0 TEST_F(DesktopDisplayInfoTest, Multimon7) { … } } // namespace remoting