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

Unified Diff: ash/wm/power_button_controller_unittest.cc

Issue 9428056: ash: Create new containers for PowerButtonController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update PowerButtonController Created 8 years, 10 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
Index: ash/wm/power_button_controller_unittest.cc
diff --git a/ash/wm/power_button_controller_unittest.cc b/ash/wm/power_button_controller_unittest.cc
index 11227d384c8ab0d39456b91198d353c5480888c2..ad4c496578d85aa7dffdf5619f10d30f4f527617 100644
--- a/ash/wm/power_button_controller_unittest.cc
+++ b/ash/wm/power_button_controller_unittest.cc
@@ -9,7 +9,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "ui/aura/root_window.h"
-#include "ui/aura/window.h"
namespace ash {
namespace test {
@@ -278,69 +277,6 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) {
EXPECT_FALSE(test_api_->BackgroundLayerIsVisible());
}
-// Test that we restore transformations that are non empty.
-TEST_F(PowerButtonControllerTest, LockAndUnlockTransformed) {
- controller_->set_has_legacy_power_button_for_test(false);
- controller_->OnLoginStateChange(true /*logged_in*/, false /*is_guest*/);
- controller_->OnLockStateChange(false);
-
- // Get current transformation on the containers.
- aura::Window::Windows windows;
- controller_->GetContainers(
- PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS,
- &windows);
-
- // Set a random transform to each container layer.
- ui::Transform expected_transform;
- expected_transform.ConcatTranslate(180, 180);
- for (aura::Window::Windows::iterator it = windows.begin();
- it != windows.end();
- ++it) {
- (*it)->layer()->SetTransform(expected_transform);
- }
-
- // Press the power button and check that the lock timer is started and that we
- // start scaling the non-screen-locker containers.
- controller_->OnPowerButtonEvent(true, base::TimeTicks::Now());
- EXPECT_TRUE(test_api_->lock_timer_is_running());
- EXPECT_FALSE(test_api_->shutdown_timer_is_running());
- EXPECT_TRUE(
- test_api_->ContainerGroupIsAnimated(
- PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS,
- PowerButtonController::ANIMATION_SLOW_CLOSE));
-
- // Check current transformation is different than before.
- windows.clear();
- controller_->GetContainers(
- PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS,
- &windows);
- for (aura::Window::Windows::iterator it = windows.begin();
- it != windows.end();
- ++it) {
- EXPECT_NE(expected_transform, (*it)->layer()->GetTargetTransform());
- }
-
- // Release the button before the lock timer fires.
- controller_->OnPowerButtonEvent(false, base::TimeTicks::Now());
- EXPECT_FALSE(test_api_->lock_timer_is_running());
- EXPECT_TRUE(
- test_api_->ContainerGroupIsAnimated(
- PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS,
- PowerButtonController::ANIMATION_UNDO_SLOW_CLOSE));
-
- // Get current transformation on the containers to compare,
- // it shouldn't have changed.
- windows.clear();
- controller_->GetContainers(
- PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS,
- &windows);
- for (aura::Window::Windows::iterator it = windows.begin();
- it != windows.end();
- ++it) {
- EXPECT_EQ(expected_transform, (*it)->layer()->GetTargetTransform());
- }
-}
-
// Hold the power button down from the unlocked state to eventual shutdown.
TEST_F(PowerButtonControllerTest, LockToShutdown) {
controller_->set_has_legacy_power_button_for_test(false);

Powered by Google App Engine
This is Rietveld 408576698