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

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 291843012: compositor: Tick the UI animations from cc, instead of from timer callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
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 16 matching lines...) Expand all
27 #include "base/command_line.h" 27 #include "base/command_line.h"
28 #include "base/strings/utf_string_conversions.h" 28 #include "base/strings/utf_string_conversions.h"
29 #include "ui/aura/client/aura_constants.h" 29 #include "ui/aura/client/aura_constants.h"
30 #include "ui/aura/test/event_generator.h" 30 #include "ui/aura/test/event_generator.h"
31 #include "ui/aura/window.h" 31 #include "ui/aura/window.h"
32 #include "ui/aura/window_event_dispatcher.h" 32 #include "ui/aura/window_event_dispatcher.h"
33 #include "ui/compositor/layer.h" 33 #include "ui/compositor/layer.h"
34 #include "ui/compositor/layer_animator.h" 34 #include "ui/compositor/layer_animator.h"
35 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 35 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
36 #include "ui/events/gestures/gesture_configuration.h" 36 #include "ui/events/gestures/gesture_configuration.h"
37 #include "ui/gfx/animation/animation_container_element.h"
38 #include "ui/gfx/display.h" 37 #include "ui/gfx/display.h"
39 #include "ui/gfx/screen.h" 38 #include "ui/gfx/screen.h"
40 #include "ui/views/controls/label.h" 39 #include "ui/views/controls/label.h"
41 #include "ui/views/layout/fill_layout.h" 40 #include "ui/views/layout/fill_layout.h"
42 #include "ui/views/view.h" 41 #include "ui/views/view.h"
43 #include "ui/views/widget/widget.h" 42 #include "ui/views/widget/widget.h"
44 43
45 #if defined(OS_WIN) 44 #if defined(OS_WIN)
46 #include "base/win/windows_version.h" 45 #include "base/win/windows_version.h"
47 #endif 46 #endif
48 47
49 namespace ash { 48 namespace ash {
50 namespace { 49 namespace {
51 50
52 void StepWidgetLayerAnimatorToEnd(views::Widget* widget) { 51 void StepWidgetLayerAnimatorToEnd(views::Widget* widget) {
53 gfx::AnimationContainerElement* element = 52 widget->GetNativeView()->layer()->GetAnimator()->Step(
54 static_cast<gfx::AnimationContainerElement*>( 53 base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1));
55 widget->GetNativeView()->layer()->GetAnimator());
56 element->Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1));
57 } 54 }
58 55
59 ShelfWidget* GetShelfWidget() { 56 ShelfWidget* GetShelfWidget() {
60 return Shell::GetPrimaryRootWindowController()->shelf(); 57 return Shell::GetPrimaryRootWindowController()->shelf();
61 } 58 }
62 59
63 ShelfLayoutManager* GetShelfLayoutManager() { 60 ShelfLayoutManager* GetShelfLayoutManager() {
64 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); 61 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
65 } 62 }
66 63
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2118 generator.MoveMouseTo(0, 399); 2115 generator.MoveMouseTo(0, 399);
2119 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); 2116 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
2120 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 2117 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
2121 generator.ClickLeftButton(); 2118 generator.ClickLeftButton();
2122 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); 2119 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
2123 generator.ClickLeftButton(); 2120 generator.ClickLeftButton();
2124 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); 2121 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
2125 } 2122 }
2126 2123
2127 } // namespace ash 2124 } // namespace ash
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_controller_unittest.cc ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698