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

Side by Side Diff: ash/content/display/screen_orientation_controller_chromeos_unittest.cc

Issue 1094553002: Revert "Speculative revert by sheriff" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 "ash/ash_switches.h" 5 #include "ash/ash_switches.h"
6 #include "ash/content/display/screen_orientation_controller_chromeos.h" 6 #include "ash/content/display/screen_orientation_controller_chromeos.h"
7 #include "ash/display/display_info.h" 7 #include "ash/display/display_info.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 delegate()->Unlock(content.get()); 582 delegate()->Unlock(content.get());
583 583
584 SetRotationLocked(true); 584 SetRotationLocked(true);
585 EXPECT_TRUE(RotationLocked()); 585 EXPECT_TRUE(RotationLocked());
586 EXPECT_EQ(gfx::Display::ROTATE_0, Rotation()); 586 EXPECT_EQ(gfx::Display::ROTATE_0, Rotation());
587 587
588 TriggerLidUpdate(gfx::Vector3dF(0.0f, kMeanGravity, 0.0f)); 588 TriggerLidUpdate(gfx::Vector3dF(0.0f, kMeanGravity, 0.0f));
589 EXPECT_EQ(gfx::Display::ROTATE_0, GetInternalDisplayRotation()); 589 EXPECT_EQ(gfx::Display::ROTATE_0, GetInternalDisplayRotation());
590 } 590 }
591 591
592 // Tests that when MaximizeMode is triggered before the internal display is
593 // ready, that ScreenOrientationController still begins listening to events,
594 // which require an internal display to be acted upon.
595 TEST_F(ScreenOrientationControllerTest, InternalDisplayNotAvailableAtStartup) {
596 int64 internal_display_id = gfx::Display::InternalDisplayId();
597 gfx::Display::SetInternalDisplayId(gfx::Display::kInvalidDisplayID);
598
599 EnableMaximizeMode(true);
600
601 // Should not crash, even thought there is no internal display.
602 SetInternalDisplayRotation(gfx::Display::ROTATE_180);
603 EXPECT_FALSE(RotationLocked());
604
605 // With an internal display now available, functionality should resume.
606 gfx::Display::SetInternalDisplayId(internal_display_id);
607 SetInternalDisplayRotation(gfx::Display::ROTATE_90);
608 EXPECT_TRUE(RotationLocked());
609 }
610
592 } // namespace ash 611 } // namespace ash
OLDNEW
« no previous file with comments | « ash/content/display/screen_orientation_controller_chromeos.cc ('k') | build/android/buildbot/bb_host_steps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698