Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/browser/extensions/display_info_provider_chromeos_unittest.cc

Issue 2314853003: Move ash::DisplayManager switches to ui::display (Closed)
Patch Set: rebased again Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/system_display/display_info_provider.h" 5 #include "extensions/browser/api/system_display/display_info_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "ash/common/ash_switches.h"
10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
11 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
12 #include "ash/display/display_manager.h" 11 #include "ash/display/display_manager.h"
13 #include "ash/display/screen_orientation_controller_chromeos.h" 12 #include "ash/display/screen_orientation_controller_chromeos.h"
14 #include "ash/screen_util.h" 13 #include "ash/screen_util.h"
15 #include "ash/shell.h" 14 #include "ash/shell.h"
16 #include "ash/test/ash_test_base.h" 15 #include "ash/test/ash_test_base.h"
17 #include "ash/test/display_manager_test_api.h" 16 #include "ash/test/display_manager_test_api.h"
18 #include "base/command_line.h" 17 #include "base/command_line.h"
19 #include "base/macros.h" 18 #include "base/macros.h"
20 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
21 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
22 #include "extensions/common/api/system_display.h" 21 #include "extensions/common/api/system_display.h"
23 #include "ui/display/display.h" 22 #include "ui/display/display.h"
23 #include "ui/display/display_switches.h"
24 #include "ui/display/manager/display_layout.h" 24 #include "ui/display/manager/display_layout.h"
25 #include "ui/gfx/geometry/rect.h" 25 #include "ui/gfx/geometry/rect.h"
26 26
27 namespace extensions { 27 namespace extensions {
28 namespace { 28 namespace {
29 29
30 using DisplayUnitInfoList = DisplayInfoProvider::DisplayUnitInfoList; 30 using DisplayUnitInfoList = DisplayInfoProvider::DisplayUnitInfoList;
31 using DisplayLayoutList = DisplayInfoProvider::DisplayLayoutList; 31 using DisplayLayoutList = DisplayInfoProvider::DisplayLayoutList;
32 32
33 class DisplayInfoProviderChromeosTest : public ash::test::AshTestBase { 33 class DisplayInfoProviderChromeosTest : public ash::test::AshTestBase {
34 public: 34 public:
35 DisplayInfoProviderChromeosTest() {} 35 DisplayInfoProviderChromeosTest() {}
36 36
37 ~DisplayInfoProviderChromeosTest() override {} 37 ~DisplayInfoProviderChromeosTest() override {}
38 38
39 void SetUp() override { 39 void SetUp() override {
40 base::CommandLine::ForCurrentProcess()->AppendSwitch( 40 base::CommandLine::ForCurrentProcess()->AppendSwitch(
41 ash::switches::kAshUseFirstDisplayAsInternal); 41 switches::kUseFirstDisplayAsInternal);
42 ash::test::AshTestBase::SetUp(); 42 ash::test::AshTestBase::SetUp();
43 } 43 }
44 44
45 protected: 45 protected:
46 void CallSetDisplayUnitInfo( 46 void CallSetDisplayUnitInfo(
47 const std::string& display_id, 47 const std::string& display_id,
48 const api::system_display::DisplayProperties& info, 48 const api::system_display::DisplayProperties& info,
49 bool* success, 49 bool* success,
50 std::string* error) { 50 std::string* error) {
51 // Reset error messsage. 51 // Reset error messsage.
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 CallSetDisplayUnitInfo(base::Int64ToString(id), info, &success, &error); 1186 CallSetDisplayUnitInfo(base::Int64ToString(id), info, &success, &error);
1187 ASSERT_TRUE(success); 1187 ASSERT_TRUE(success);
1188 1188
1189 // Verify that other_mode now matches the active mode. 1189 // Verify that other_mode now matches the active mode.
1190 active_mode = GetDisplayManager()->GetActiveModeForDisplayId(id); 1190 active_mode = GetDisplayManager()->GetActiveModeForDisplayId(id);
1191 EXPECT_TRUE(active_mode->IsEquivalent(other_mode_ash)); 1191 EXPECT_TRUE(active_mode->IsEquivalent(other_mode_ash));
1192 } 1192 }
1193 1193
1194 } // namespace 1194 } // namespace
1195 } // namespace extensions 1195 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/prefs/command_line_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698