chromium/remoting/host/resizing_host_observer_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.

#include "remoting/host/resizing_host_observer.h"

#include <list>
#include <utility>

#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/task_environment.h"
#include "remoting/host/base/screen_resolution.h"
#include "remoting/host/desktop_display_info.h"
#include "remoting/host/desktop_resizer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"

namespace remoting {

using Monitors = std::map<webrtc::ScreenId, ScreenResolution>;

std::ostream& operator<<(std::ostream& os, const ScreenResolution& resolution) {}

bool operator==(const ScreenResolution& a, const ScreenResolution& b) {}

const int kDefaultDPI =;

ScreenResolution MakeResolution(int width, int height) {}

// Converts a monitor-list to an object suitable for passing to
// ResizingHostObserver::OnDisplayInfoChanged().
DesktopDisplayInfo ToDisplayInfo(const Monitors& monitors) {}

class FakeDesktopResizer : public DesktopResizer {};

class ResizingHostObserverTest : public testing::Test {};

// Check that the resolution isn't restored if it wasn't changed by this class.
TEST_F(ResizingHostObserverTest, NoRestoreResolution) {}

// Check that the host is not resized if GetSupportedSizes returns an empty
// list (even if GetCurrentSize is supported).
TEST_F(ResizingHostObserverTest, EmptyGetSupportedSizes) {}

// Check that the restore flag is respected.
TEST_F(ResizingHostObserverTest, RestoreFlag) {}

// Check that the size is restored if an empty ClientResolution is received.
TEST_F(ResizingHostObserverTest, RestoreOnEmptyClientResolution) {}

// Check that if the implementation supports exact size matching, it is used.
TEST_F(ResizingHostObserverTest, SelectExactSize) {}

// Check that if the implementation supports a size that is no larger than
// the requested size, then the largest such size is used.
TEST_F(ResizingHostObserverTest, SelectBestSmallerSize) {}

// Check that if the implementation supports only sizes that are larger than
// the requested size, then the one that requires the least down-scaling.
TEST_F(ResizingHostObserverTest, SelectBestScaleFactor) {}

// Check that if the implementation supports two sizes that have the same
// resultant scale factor, then the widest one is selected.
TEST_F(ResizingHostObserverTest, SelectWidest) {}

// Check that if the best match for the client size doesn't change, then we
// don't call SetSize.
TEST_F(ResizingHostObserverTest, NoSetSizeForSameSize) {}

// Check that desktop resizes are rate-limited, and that if multiple resize
// requests are received in the time-out period, the most recent is respected.
TEST_F(ResizingHostObserverTest, RateLimited) {}

TEST_F(ResizingHostObserverTest, PendingResolutionAppliedToFirstMonitor) {}

TEST_F(ResizingHostObserverTest, AnonymousRequestDroppedIfMultipleMonitors) {}

TEST_F(ResizingHostObserverTest, RequestDroppedForUnknownMonitor) {}

TEST_F(ResizingHostObserverTest, MultipleMonitorSizesRestored) {}

}  // namespace remoting