1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_TEST_DISPLAY_MANAGER_TEST_API_H_
6 #define ASH_TEST_DISPLAY_MANAGER_TEST_API_H_
11 #include "base/basictypes.h"
12 #include "ui/display/types/display_constants.h"
30 class DisplayManagerTestApi
{
32 // Test if moving a mouse to |point_in_screen| warps it to another
34 static bool TestIfMouseWarpsAt(ui::test::EventGenerator
& event_generator
,
35 const gfx::Point
& point_in_screen
);
37 DisplayManagerTestApi();
38 virtual ~DisplayManagerTestApi();
40 // Update the display configuration as given in |display_specs|. The format of
41 // |display_spec| is a list of comma separated spec for each displays. Please
42 // refer to the comment in |ash::DisplayInfo::CreateFromSpec| for the format
43 // of the display spec.
44 void UpdateDisplay(const std::string
& display_specs
);
46 // Set the 1st display as an internal display and returns the display Id for
47 // the internal display.
48 int64
SetFirstDisplayAsInternalDisplay();
50 // Don't update the display when the root window's size was changed.
51 void DisableChangeDisplayUponHostResize();
53 // Sets the available color profiles for |display_id|.
54 void SetAvailableColorProfiles(
56 const std::vector
<ui::ColorCalibrationProfile
>& profiles
);
59 friend class ScopedSetInternalDisplayId
;
60 // Sets the display id for internal display and
61 // update the display mode list if necessary.
62 void SetInternalDisplayId(int64 id
);
64 DisplayManager
* display_manager_
; // not owned
66 DISALLOW_COPY_AND_ASSIGN(DisplayManagerTestApi
);
69 class ScopedDisable125DSFForUIScaling
{
71 ScopedDisable125DSFForUIScaling();
72 ~ScopedDisable125DSFForUIScaling();
75 DISALLOW_COPY_AND_ASSIGN(ScopedDisable125DSFForUIScaling
);
78 class ScopedSetInternalDisplayId
{
80 ScopedSetInternalDisplayId(int64 id
);
81 ~ScopedSetInternalDisplayId();
84 DISALLOW_COPY_AND_ASSIGN(ScopedSetInternalDisplayId
);
87 // Sets the display mode that matches the |resolution| for |display_id|.
88 bool SetDisplayResolution(int64 display_id
, const gfx::Size
& resolution
);
93 #endif // ASH_TEST_DISPLAY_MANAGER_TEST_API_H_