diff options
author | vollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-01 17:37:47 +0000 |
---|---|---|
committer | vollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-01 17:37:47 +0000 |
commit | 83502cddd203d8971ce3883960afca6cfac9fdb1 (patch) | |
tree | 952b84d47b9d883457b7c337325335794c0badfc /ash | |
parent | c3287f6e7f7c23c1f20729d4729ffdd84658c4b7 (diff) | |
download | chromium_src-83502cddd203d8971ce3883960afca6cfac9fdb1.zip chromium_src-83502cddd203d8971ce3883960afca6cfac9fdb1.tar.gz chromium_src-83502cddd203d8971ce3883960afca6cfac9fdb1.tar.bz2 |
Revert 120074 - Disable animations during aura tests.
This causes all animations scheduled during a test to complete immediately.
After making this change, I noticed some code assumed that animations would not complete synchronously. Some of this code used animation observers, and I while fixing the code I have updated it to use the preferred ImplicitAnimationObserver.
BUG=None
TEST=aura_shell_unittests,aura_unittests,compositor_unittests
Review URL: https://chromiumcodereview.appspot.com/9222018
TBR=vollick@google.com
Review URL: https://chromiumcodereview.appspot.com/9316039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/app_list/app_list.cc | 20 | ||||
-rw-r--r-- | ash/app_list/app_list.h | 11 | ||||
-rw-r--r-- | ash/drag_drop/drag_drop_controller.cc | 22 | ||||
-rw-r--r-- | ash/drag_drop/drag_drop_controller.h | 13 | ||||
-rw-r--r-- | ash/test/aura_shell_test_base.cc | 6 | ||||
-rw-r--r-- | ash/wm/compact_layout_manager.cc | 11 | ||||
-rw-r--r-- | ash/wm/compact_layout_manager.h | 11 | ||||
-rw-r--r-- | ash/wm/shelf_layout_manager.cc | 56 | ||||
-rw-r--r-- | ash/wm/shelf_layout_manager.h | 21 | ||||
-rw-r--r-- | ash/wm/system_modal_container_layout_manager.cc | 24 | ||||
-rw-r--r-- | ash/wm/system_modal_container_layout_manager.h | 11 | ||||
-rw-r--r-- | ash/wm/system_modal_container_layout_manager_unittest.cc | 6 | ||||
-rw-r--r-- | ash/wm/visibility_controller_unittest.cc | 4 | ||||
-rw-r--r-- | ash/wm/window_animations.cc | 3 |
14 files changed, 134 insertions, 85 deletions
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc index ad9fd01..c439bbb 100644 --- a/ash/app_list/app_list.cc +++ b/ash/app_list/app_list.cc @@ -87,6 +87,7 @@ void AppList::SetWidget(views::Widget* widget) { if (is_visible_) { widget_ = widget; + widget_->AddObserver(this); GetLayer(widget_)->GetAnimator()->AddObserver(this); Shell::GetInstance()->AddRootWindowEventFilter(this); @@ -118,19 +119,13 @@ void AppList::ScheduleAnimation() { return; ui::Layer* layer = GetLayer(widget_); - - // Stop observing previous animation. - StopObservingImplicitAnimations(); - ui::ScopedLayerAnimationSettings app_list_animation(layer->GetAnimator()); - app_list_animation.AddObserver(this); layer->SetBounds(GetPreferredBounds(is_visible_)); layer->SetOpacity(is_visible_ ? 1.0 : 0.0); ui::Layer* default_container_layer = default_container->layer(); ui::ScopedLayerAnimationSettings default_container_animation( default_container_layer->GetAnimator()); - app_list_animation.AddObserver(this); default_container_layer->SetOpacity(is_visible_ ? 0.0 : 1.0); } @@ -164,13 +159,22 @@ ui::GestureStatus AppList::PreHandleGestureEvent( } //////////////////////////////////////////////////////////////////////////////// -// AppList, ui::ImplicitAnimationObserver implementation: +// AppList, ui::LayerAnimationObserver implementation: -void AppList::OnImplicitAnimationsCompleted() { +void AppList::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) { if (!is_visible_ ) widget_->Close(); } +void AppList::OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) { +} + +void AppList::OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) { +} + //////////////////////////////////////////////////////////////////////////////// // AppList, views::Widget::Observer implementation: diff --git a/ash/app_list/app_list.h b/ash/app_list/app_list.h index b499498..77b2ecd 100644 --- a/ash/app_list/app_list.h +++ b/ash/app_list/app_list.h @@ -20,7 +20,7 @@ namespace internal { // While the UI is visible, it monitors things such as app list widget's // activation state and desktop mouse click to auto dismiss the UI. class AppList : public aura::EventFilter, - public ui::ImplicitAnimationObserver, + public ui::LayerAnimationObserver, public views::Widget::Observer { public: AppList(); @@ -54,8 +54,13 @@ class AppList : public aura::EventFilter, aura::Window* target, aura::GestureEvent* event) OVERRIDE; - // ui::ImplicitAnimationObserver overrides: - virtual void OnImplicitAnimationsCompleted() OVERRIDE; + // ui::LayerAnimationObserver overrides: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) OVERRIDE; // views::Widget::Observer overrides: virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index c3ca96a..2e43ea3 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -28,7 +28,7 @@ namespace { const gfx::Point kDragDropWidgetOffset(0, 0); const base::TimeDelta kDragDropAnimationDuration = base::TimeDelta::FromMilliseconds(250); -} // namespace +} //////////////////////////////////////////////////////////////////////////////// // DragDropController, public: @@ -47,8 +47,11 @@ DragDropController::DragDropController() DragDropController::~DragDropController() { Shell::GetInstance()->RemoveRootWindowEventFilter(this); Cleanup(); - if (drag_image_.get()) + if (drag_image_.get()) { + aura::Window* window = drag_image_->GetWidget()->GetNativeView(); + window->layer()->GetAnimator()->RemoveObserver(this); drag_image_.reset(); + } } int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data, @@ -203,7 +206,14 @@ ui::GestureStatus DragDropController::PreHandleGestureEvent( //////////////////////////////////////////////////////////////////////////////// // DragDropController, private: -void DragDropController::OnImplicitAnimationsCompleted() OVERRIDE { +void DragDropController::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) { + DCHECK(drag_image_.get()); + drag_image_.reset(); +} + +void DragDropController::OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) { DCHECK(drag_image_.get()); drag_image_.reset(); } @@ -213,13 +223,9 @@ void DragDropController::StartCanceledAnimation() { ui::LayerAnimator* animator = window->layer()->GetAnimator(); animator->set_preemption_strategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); - - // Stop waiting for any as yet unfinished implicit animations. - StopObservingImplicitAnimations(); - + animator->AddObserver(this); ui::ScopedLayerAnimationSettings animation_setter(animator); animation_setter.SetTransitionDuration(kDragDropAnimationDuration); - animation_setter.AddObserver(this); window->SetBounds(gfx::Rect(drag_start_location_, window->bounds().size())); } diff --git a/ash/drag_drop/drag_drop_controller.h b/ash/drag_drop/drag_drop_controller.h index 9272257..0f9b257 100644 --- a/ash/drag_drop/drag_drop_controller.h +++ b/ash/drag_drop/drag_drop_controller.h @@ -36,8 +36,8 @@ class DragImageView; class ASH_EXPORT DragDropController : public aura::client::DragDropClient, public aura::EventFilter, - public ui::ImplicitAnimationObserver { -public: + public ui::LayerAnimationObserver { + public: DragDropController(); virtual ~DragDropController(); @@ -69,8 +69,13 @@ public: private: friend class ash::test::DragDropControllerTest; - // Implementation of ImplicitAnimationObserver - virtual void OnImplicitAnimationsCompleted() OVERRIDE; + // Overridden from ui::LayerAnimationObserver: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) OVERRIDE {} // Helper method to start drag widget flying back animation. void StartCanceledAnimation(); diff --git a/ash/test/aura_shell_test_base.cc b/ash/test/aura_shell_test_base.cc index 1486f1c..b6011de 100644 --- a/ash/test/aura_shell_test_base.cc +++ b/ash/test/aura_shell_test_base.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -6,7 +6,6 @@ #include "ash/shell.h" #include "ash/test/test_shell_delegate.h" -#include "ui/gfx/compositor/layer_animator.h" namespace ash { namespace test { @@ -22,9 +21,6 @@ void AuraShellTestBase::SetUp() { // Creates Shell and hook with Desktop. ash::Shell::CreateInstance(new TestShellDelegate); - - // Disable animations during tests. - ui::LayerAnimator::set_disable_animations_for_test(true); } void AuraShellTestBase::TearDown() { diff --git a/ash/wm/compact_layout_manager.cc b/ash/wm/compact_layout_manager.cc index 2be9525..105d04c 100644 --- a/ash/wm/compact_layout_manager.cc +++ b/ash/wm/compact_layout_manager.cc @@ -140,11 +140,20 @@ void CompactLayoutManager::OnWindowStackingChanged(aura::Window* window) { ///////////////////////////////////////////////////////////////////////////// // CompactLayoutManager, AnimationDelegate overrides: -void CompactLayoutManager::OnImplicitAnimationsCompleted() { +void CompactLayoutManager::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* animation) { if (!GetDefaultContainerLayer()->GetAnimator()->is_animating()) HideWindows(); } +void CompactLayoutManager::OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* animation) { +} + +void CompactLayoutManager::OnLayerAnimationAborted( + const ui::LayerAnimationSequence* animation) { +} + ////////////////////////////////////////////////////////////////////////////// // CompactLayoutManager, private: diff --git a/ash/wm/compact_layout_manager.h b/ash/wm/compact_layout_manager.h index 9f9843a..8b4f241 100644 --- a/ash/wm/compact_layout_manager.h +++ b/ash/wm/compact_layout_manager.h @@ -25,7 +25,7 @@ namespace internal { // maximized, fill the screen, and only one tabbed browser window is visible at // a time. The status area appears in the top-right corner of the screen. class ASH_EXPORT CompactLayoutManager : public BaseLayoutManager, - public ui::ImplicitAnimationObserver { + public ui::LayerAnimationObserver { public: CompactLayoutManager(); virtual ~CompactLayoutManager(); @@ -48,8 +48,13 @@ class ASH_EXPORT CompactLayoutManager : public BaseLayoutManager, void* old) OVERRIDE; virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE; - // ui::OnImplicitAnimationsCompleted: - virtual void OnImplicitAnimationsCompleted() OVERRIDE; + // ui::LayerAnimationObserver: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* animation) OVERRIDE; + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* animation) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* animation) OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(CompactLayoutManagerTransitionTest, diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc index c747c0f..1283fe5 100644 --- a/ash/wm/shelf_layout_manager.cc +++ b/ash/wm/shelf_layout_manager.cc @@ -10,7 +10,6 @@ #include "ui/aura/root_window.h" #include "ui/aura/screen_aura.h" #include "ui/gfx/compositor/layer.h" -#include "ui/gfx/compositor/layer_animation_observer.h" #include "ui/gfx/compositor/layer_animator.h" #include "ui/gfx/compositor/scoped_layer_animation_settings.h" #include "ui/views/widget/widget.h" @@ -31,7 +30,8 @@ ui::Layer* GetLayer(views::Widget* widget) { ShelfLayoutManager::ShelfLayoutManager(views::Widget* launcher, views::Widget* status) - : in_layout_(false), + : animating_(false), + in_layout_(false), visible_(true), max_height_(-1), launcher_(launcher), @@ -39,9 +39,11 @@ ShelfLayoutManager::ShelfLayoutManager(views::Widget* launcher, gfx::Rect launcher_bounds = launcher->GetWindowScreenBounds(); gfx::Rect status_bounds = status->GetWindowScreenBounds(); max_height_ = std::max(launcher_bounds.height(), status_bounds.height()); + GetLayer(launcher)->GetAnimator()->AddObserver(this); } ShelfLayoutManager::~ShelfLayoutManager() { + GetLayer(launcher_)->GetAnimator()->RemoveObserver(this); // Without a shelf we don't need special insets anymore. aura::RootWindow::GetInstance()-> screen()->set_work_area_insets(gfx::Insets()); @@ -64,36 +66,19 @@ void ShelfLayoutManager::LayoutShelf() { } void ShelfLayoutManager::SetVisible(bool visible) { - ui::Layer* launcher_layer = GetLayer(launcher_); - ui::Layer* status_layer = GetLayer(status_); - - // TODO(vollick): once visibility is animatable, use GetTargetVisibility. - bool current_visibility = visible_ && - launcher_layer->GetTargetOpacity() > 0.0f && - status_layer->GetTargetOpacity() > 0.0f; - + bool current_visibility = animating_ ? !visible_ : visible_; if (visible == current_visibility) return; // Nothing changed. StopAnimating(); - visible_ = visible; TargetBounds target_bounds; float target_opacity = visible ? 1.0f : 0.0f; CalculateTargetBounds(visible, &target_bounds); - - ui::ScopedLayerAnimationSettings launcher_animation_setter( - launcher_layer->GetAnimator()); - ui::ScopedLayerAnimationSettings status_animation_setter( - status_layer->GetAnimator()); - - launcher_animation_setter.AddObserver(this); - status_animation_setter.AddObserver(this); - - launcher_layer->SetBounds(target_bounds.launcher_bounds); - launcher_layer->SetOpacity(target_opacity); - status_layer->SetBounds(target_bounds.status_bounds); - status_layer->SetOpacity(target_opacity); + AnimateWidgetTo(launcher_, target_bounds.launcher_bounds, target_opacity); + AnimateWidgetTo(status_, target_bounds.status_bounds, target_opacity); + animating_ = true; + // |visible_| is updated once the animation completes. } //////////////////////////////////////////////////////////////////////////////// @@ -124,7 +109,10 @@ void ShelfLayoutManager::SetChildBounds(aura::Window* child, // ShelfLayoutManager, private: void ShelfLayoutManager::StopAnimating() { - StopObservingImplicitAnimations(); + if (animating_) { + animating_ = false; + visible_ = !visible_; + } GetLayer(launcher_)->GetAnimator()->StopAnimating(); GetLayer(status_)->GetAnimator()->StopAnimating(); } @@ -147,7 +135,23 @@ void ShelfLayoutManager::CalculateTargetBounds(bool visible, target_bounds->work_area_insets = gfx::Insets(0, 0, max_height_, 0); } -void ShelfLayoutManager::OnImplicitAnimationsCompleted() { +void ShelfLayoutManager::AnimateWidgetTo(views::Widget* widget, + const gfx::Rect& target_bounds, + float target_opacity) { + ui::Layer* layer = GetLayer(widget); + ui::ScopedLayerAnimationSettings animation_setter(layer->GetAnimator()); + // Don't go through the widget, otherwise we end up back in SetChildBounds and + // cancel the animation/layout. + layer->SetBounds(target_bounds); + layer->SetOpacity(target_opacity); +} + +void ShelfLayoutManager::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) { + if (!animating_) + return; + animating_ = false; + visible_ = !visible_; TargetBounds target_bounds; CalculateTargetBounds(visible_, &target_bounds); aura::RootWindow::GetInstance()->screen()->set_work_area_insets( diff --git a/ash/wm/shelf_layout_manager.h b/ash/wm/shelf_layout_manager.h index 8d69cc6..3c35389 100644 --- a/ash/wm/shelf_layout_manager.h +++ b/ash/wm/shelf_layout_manager.h @@ -28,7 +28,7 @@ namespace internal { // To respond to bounds changes in the status area StatusAreaLayoutManager works // closely with ShelfLayoutManager. class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager, - public ui::ImplicitAnimationObserver { + public ui::LayerAnimationObserver { public: ShelfLayoutManager(views::Widget* launcher, views::Widget* status); virtual ~ShelfLayoutManager(); @@ -41,7 +41,7 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager, // Sets the visibility of the shelf to |visible|. void SetVisible(bool visible); - bool visible() const { return visible_; } + bool visible() const { return animating_ ? !visible_ : visible_; } views::Widget* launcher() { return launcher_; } views::Widget* status() { return status_; } @@ -72,8 +72,21 @@ class ASH_EXPORT ShelfLayoutManager : public aura::LayoutManager, void CalculateTargetBounds(bool visible, TargetBounds* target_bounds); - // Implementation of ImplicitAnimationObserver - virtual void OnImplicitAnimationsCompleted() OVERRIDE; + // Animates |widget| to the specified bounds and opacity. + void AnimateWidgetTo(views::Widget* widget, + const gfx::Rect& target_bounds, + float target_opacity); + + // LayerAnimationObserver overrides: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) OVERRIDE {} + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) OVERRIDE {} + + // Are we animating? + bool animating_; // True when inside LayoutShelf method. Used to prevent calling LayoutShelf // again from SetChildBounds(). diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc index e337a57..6fdd910 100644 --- a/ash/wm/system_modal_container_layout_manager.cc +++ b/ash/wm/system_modal_container_layout_manager.cc @@ -122,14 +122,22 @@ void SystemModalContainerLayoutManager::OnWindowPropertyChanged( } //////////////////////////////////////////////////////////////////////////////// -// SystemModalContainerLayoutManager, -// ui::ImplicitAnimationObserver implementation: +// SystemModalContainerLayoutManager, ui::LayerAnimationObserver implementation: -void SystemModalContainerLayoutManager::OnImplicitAnimationsCompleted() { +void SystemModalContainerLayoutManager::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) { if (modal_screen_ && !modal_screen_->GetNativeView()->layer()->ShouldDraw()) DestroyModalScreen(); } +void SystemModalContainerLayoutManager::OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) { +} + +void SystemModalContainerLayoutManager::OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) { +} + //////////////////////////////////////////////////////////////////////////////// // SystemModalContainerLayoutManager, // SystemModalContainerEventFilter::Delegate implementation: @@ -178,33 +186,27 @@ void SystemModalContainerLayoutManager::CreateModalScreen() { "SystemModalContainerLayoutManager.ModalScreen"); modal_screen_->SetContentsView(new ScreenView); modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); + modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this); Shell::GetInstance()->AddRootWindowEventFilter(modality_filter_.get()); - StopObservingImplicitAnimations(); - ui::ScopedLayerAnimationSettings settings( modal_screen_->GetNativeView()->layer()->GetAnimator()); - settings.AddObserver(this); modal_screen_->Show(); modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f); container_->StackChildAtTop(modal_screen_->GetNativeView()); } void SystemModalContainerLayoutManager::DestroyModalScreen() { - // Stop observing the modal screen's animations. - StopObservingImplicitAnimations(); + modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this); modal_screen_->Close(); modal_screen_ = NULL; } void SystemModalContainerLayoutManager::HideModalScreen() { - StopObservingImplicitAnimations(); - Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get()); ui::ScopedLayerAnimationSettings settings( modal_screen_->GetNativeView()->layer()->GetAnimator()); - settings.AddObserver(this); modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); } diff --git a/ash/wm/system_modal_container_layout_manager.h b/ash/wm/system_modal_container_layout_manager.h index 309d0f07..c713500 100644 --- a/ash/wm/system_modal_container_layout_manager.h +++ b/ash/wm/system_modal_container_layout_manager.h @@ -35,7 +35,7 @@ namespace internal { class ASH_EXPORT SystemModalContainerLayoutManager : public aura::LayoutManager, public aura::WindowObserver, - public ui::ImplicitAnimationObserver, + public ui::LayerAnimationObserver, public SystemModalContainerEventFilterDelegate { public: explicit SystemModalContainerLayoutManager(aura::Window* container); @@ -55,8 +55,13 @@ class ASH_EXPORT SystemModalContainerLayoutManager const char* key, void* old) OVERRIDE; - // Overridden from ui::ImplicitAnimationObserver: - virtual void OnImplicitAnimationsCompleted() OVERRIDE; + // Overridden from ui::LayerAnimationObserver: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) OVERRIDE; // Overridden from SystemModalContainerEventFilterDelegate: virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE; diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index e3be65d..04198ea 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc @@ -168,8 +168,10 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalTransient) { // Tests that we can activate an unrelated window after a modal window is closed // for a window. +// TODO(beng): This test is disabled pending a solution re: visibility & target +// visibility. TEST_F(SystemModalContainerLayoutManagerTest, - CanActivateAfterEndModalSession) { + DISABLED_CanActivateAfterEndModalSession) { scoped_ptr<aura::Window> unrelated(TestWindow::OpenTestWindow(NULL, false)); unrelated->SetBounds(gfx::Rect(100, 100, 50, 50)); scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false)); @@ -189,8 +191,6 @@ TEST_F(SystemModalContainerLayoutManagerTest, // Now close the transient. transient.reset(); - MessageLoopForUI::current()->RunAllPending(); - // parent should now be active again. EXPECT_TRUE(IsActiveWindow(parent.get())); diff --git a/ash/wm/visibility_controller_unittest.cc b/ash/wm/visibility_controller_unittest.cc index 9fb1024..aaa15a5 100644 --- a/ash/wm/visibility_controller_unittest.cc +++ b/ash/wm/visibility_controller_unittest.cc @@ -8,7 +8,6 @@ #include "ui/aura/test/test_windows.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" -#include "ui/gfx/compositor/layer_animator.h" namespace ash { namespace internal { @@ -18,9 +17,6 @@ typedef test::AuraShellTestBase VisibilityControllerTest; // Hiding a window in an animatable container should not hide the window's layer // immediately. TEST_F(VisibilityControllerTest, AnimateHideDoesntHideWindowLayer) { - // We cannot disable animations for this test. - ui::LayerAnimator::set_disable_animations_for_test(false); - scoped_ptr<aura::Window> container( aura::test::CreateTestWindowWithId(-1, NULL)); SetChildWindowVisibilityChangesAnimated(container.get()); diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index 5c4c3a4..8b8c0b1 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc @@ -171,8 +171,7 @@ void AnimateHideWindowCommon(aura::Window* window, // Property sets within this scope will be implicitly animated. ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); - settings.AddObserver(new HidingWindowAnimationObserver(window)); - + settings.AddImplicitObserver(new HidingWindowAnimationObserver(window)); int duration = window->GetIntProperty(internal::kWindowVisibilityAnimationDurationKey); if (duration > 0) { |