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

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

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 std::string error; 763 std::string error;
764 CallSetDisplayUnitInfo( 764 CallSetDisplayUnitInfo(
765 base::Int64ToString(secondary.id()), info, &success, &error); 765 base::Int64ToString(secondary.id()), info, &success, &error);
766 766
767 ASSERT_FALSE(success); 767 ASSERT_FALSE(success);
768 ASSERT_EQ("Bounds origin not allowed for the primary display.", error); 768 ASSERT_EQ("Bounds origin not allowed for the primary display.", error);
769 769
770 EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString()); 770 EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
771 // The operation failed because the primary property would be set before 771 // The operation failed because the primary property would be set before
772 // setting bounds. The primary display shouldn't have been changed, though. 772 // setting bounds. The primary display shouldn't have been changed, though.
773 EXPECT_NE(ash::Shell::GetScreen()->GetPrimaryDisplay().id(), secondary.id()); 773 EXPECT_NE(gfx::Screen::GetScreen()->GetPrimaryDisplay().id(), secondary.id());
774 } 774 }
775 775
776 TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) { 776 TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) {
777 UpdateDisplay("1200x600,600x1000*2"); 777 UpdateDisplay("1200x600,600x1000*2");
778 778
779 const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); 779 const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
780 const gfx::Display& primary = ash::Shell::GetScreen()->GetPrimaryDisplay(); 780 const gfx::Display& primary = gfx::Screen::GetScreen()->GetPrimaryDisplay();
781 781
782 api::system_display::DisplayProperties info; 782 api::system_display::DisplayProperties info;
783 info.bounds_origin_x.reset(new int(300)); 783 info.bounds_origin_x.reset(new int(300));
784 info.mirroring_source_id.reset( 784 info.mirroring_source_id.reset(
785 new std::string(base::Int64ToString(primary.id()))); 785 new std::string(base::Int64ToString(primary.id())));
786 786
787 bool success = false; 787 bool success = false;
788 std::string error; 788 std::string error;
789 CallSetDisplayUnitInfo( 789 CallSetDisplayUnitInfo(
790 base::Int64ToString(secondary.id()), info, &success, &error); 790 base::Int64ToString(secondary.id()), info, &success, &error);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 // Switch primary display. 826 // Switch primary display.
827 info.is_primary.reset(new bool(true)); 827 info.is_primary.reset(new bool(true));
828 CallSetDisplayUnitInfo( 828 CallSetDisplayUnitInfo(
829 base::Int64ToString(secondary.id()), info, &success, &error); 829 base::Int64ToString(secondary.id()), info, &success, &error);
830 830
831 ASSERT_TRUE(success); 831 ASSERT_TRUE(success);
832 EXPECT_TRUE(error.empty()); 832 EXPECT_TRUE(error.empty());
833 833
834 EXPECT_EQ("0,0 300x500", secondary.bounds().ToString()); 834 EXPECT_EQ("0,0 300x500", secondary.bounds().ToString());
835 EXPECT_EQ(gfx::Display::ROTATE_180, secondary.rotation()); 835 EXPECT_EQ(gfx::Display::ROTATE_180, secondary.rotation());
836 EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().id(), secondary.id()); 836 EXPECT_EQ(gfx::Screen::GetScreen()->GetPrimaryDisplay().id(), secondary.id());
837 837
838 info.rotation.reset(new int(0)); 838 info.rotation.reset(new int(0));
839 CallSetDisplayUnitInfo( 839 CallSetDisplayUnitInfo(
840 base::Int64ToString(secondary.id()), info, &success, &error); 840 base::Int64ToString(secondary.id()), info, &success, &error);
841 841
842 ASSERT_TRUE(success); 842 ASSERT_TRUE(success);
843 EXPECT_TRUE(error.empty()); 843 EXPECT_TRUE(error.empty());
844 844
845 EXPECT_EQ("0,0 300x500", secondary.bounds().ToString()); 845 EXPECT_EQ("0,0 300x500", secondary.bounds().ToString());
846 EXPECT_EQ(gfx::Display::ROTATE_0, secondary.rotation()); 846 EXPECT_EQ(gfx::Display::ROTATE_0, secondary.rotation());
847 EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().id(), secondary.id()); 847 EXPECT_EQ(gfx::Screen::GetScreen()->GetPrimaryDisplay().id(), secondary.id());
848 } 848 }
849 849
850 // Tests that rotation changes made before entering maximize mode are restored 850 // Tests that rotation changes made before entering maximize mode are restored
851 // upon exiting maximize mode, and that a rotation lock is not set. 851 // upon exiting maximize mode, and that a rotation lock is not set.
852 TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) { 852 TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) {
853 ash::ScreenOrientationController* screen_orientation_controller = 853 ash::ScreenOrientationController* screen_orientation_controller =
854 ash::Shell::GetInstance()->screen_orientation_controller(); 854 ash::Shell::GetInstance()->screen_orientation_controller();
855 api::system_display::DisplayProperties info; 855 api::system_display::DisplayProperties info;
856 info.rotation.reset(new int(90)); 856 info.rotation.reset(new int(90));
857 857
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 std::string error; 1079 std::string error;
1080 CallSetDisplayUnitInfo( 1080 CallSetDisplayUnitInfo(
1081 base::Int64ToString(internal_display_id), info, &success, &error); 1081 base::Int64ToString(internal_display_id), info, &success, &error);
1082 1082
1083 ASSERT_FALSE(success); 1083 ASSERT_FALSE(success);
1084 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error); 1084 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error);
1085 } 1085 }
1086 1086
1087 } // namespace 1087 } // namespace
1088 } // namespace extensions 1088 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/display_info_provider_chromeos.cc ('k') | chrome/browser/extensions/display_info_provider_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698