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

Unified Diff: ash/display/display_configuration_controller_unittest.cc

Issue 2728803002: Handles users rotating screen too early (Closed)
Patch Set: Rebased to commit. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_configuration_controller.cc ('k') | ash/rotator/screen_rotation_animator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_configuration_controller_unittest.cc
diff --git a/ash/display/display_configuration_controller_unittest.cc b/ash/display/display_configuration_controller_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..652b2661177438a3d1a7fc777dc54dc4e3785fa4
--- /dev/null
+++ b/ash/display/display_configuration_controller_unittest.cc
@@ -0,0 +1,46 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/common/wm_shell.h"
+#include "ash/rotator/screen_rotation_animator.h"
+#include "ash/shell.h"
+#include "ash/test/ash_test_base.h"
+#include "ash/test/display_configuration_controller_test_api.h"
+#include "base/macros.h"
+#include "ui/display/manager/display_manager.h"
+
+namespace ash {
+
+class DisplayConfigurationControllerTest : public test::AshTestBase {
+ public:
+ DisplayConfigurationControllerTest() {}
+ ~DisplayConfigurationControllerTest() override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationControllerTest);
+};
+
+TEST_F(DisplayConfigurationControllerTest, ErasesAnimatorOnAnimationEnded) {
+ // TODO(wutao): needs display_configuration_controller
+ // http://crbug.com/686839.
+ if (WmShell::Get()->IsRunningInMash())
+ return;
+
+ display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
+ test::DisplayConfigurationControllerTestApi testapi(
+ Shell::GetInstance()->display_configuration_controller());
+ ScreenRotationAnimator* screen_rotation_animator =
+ testapi.GetScreenRotationAnimatorForDisplay(display.id());
+ EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
+
+ Shell::GetInstance()->display_manager()->SetDisplayRotation(
+ display.id(), display::Display::ROTATE_0,
+ display::Display::RotationSource::ROTATION_SOURCE_USER);
+ screen_rotation_animator->Rotate(
+ display::Display::ROTATE_90,
+ display::Display::RotationSource::ROTATION_SOURCE_USER);
+ EXPECT_EQ(0, testapi.DisplayScreenRotationAnimatorMapSize());
+}
+
+} // namespace ash
« no previous file with comments | « ash/display/display_configuration_controller.cc ('k') | ash/rotator/screen_rotation_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698