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

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

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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
« no previous file with comments | « no previous file | ash/shell/content/client/shell_browser_main_parts.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/shelf/shelf_layout_manager.h" 5 #include "ash/common/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/aura/wm_shelf_aura.h" 7 #include "ash/aura/wm_shelf_aura.h"
8 #include "ash/aura/wm_window_aura.h" 8 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/accelerators/accelerator_table.h" 10 #include "ash/common/accelerators/accelerator_table.h"
(...skipping 14 matching lines...) Expand all
25 #include "ash/display/display_manager.h" 25 #include "ash/display/display_manager.h"
26 #include "ash/root_window_controller.h" 26 #include "ash/root_window_controller.h"
27 #include "ash/shell.h" 27 #include "ash/shell.h"
28 #include "ash/test/ash_test_base.h" 28 #include "ash/test/ash_test_base.h"
29 #include "ash/test/display_manager_test_api.h" 29 #include "ash/test/display_manager_test_api.h"
30 #include "ash/test/shelf_test_api.h" 30 #include "ash/test/shelf_test_api.h"
31 #include "ash/test/test_system_tray_item.h" 31 #include "ash/test/test_system_tray_item.h"
32 #include "ash/wm/window_state_aura.h" 32 #include "ash/wm/window_state_aura.h"
33 #include "ash/wm/window_util.h" 33 #include "ash/wm/window_util.h"
34 #include "base/command_line.h" 34 #include "base/command_line.h"
35 #include "base/run_loop.h"
35 #include "ui/aura/client/aura_constants.h" 36 #include "ui/aura/client/aura_constants.h"
36 #include "ui/aura/client/window_tree_client.h" 37 #include "ui/aura/client/window_tree_client.h"
37 #include "ui/aura/window.h" 38 #include "ui/aura/window.h"
38 #include "ui/aura/window_event_dispatcher.h" 39 #include "ui/aura/window_event_dispatcher.h"
39 #include "ui/base/ui_base_switches.h" 40 #include "ui/base/ui_base_switches.h"
40 #include "ui/compositor/layer.h" 41 #include "ui/compositor/layer.h"
41 #include "ui/compositor/layer_animator.h" 42 #include "ui/compositor/layer_animator.h"
42 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 43 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
43 #include "ui/display/display.h" 44 #include "ui/display/display.h"
44 #include "ui/display/manager/display_layout.h" 45 #include "ui/display/manager/display_layout.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 GetShelfWidget()->AddObserver(this); 83 GetShelfWidget()->AddObserver(this);
83 } 84 }
84 85
85 ~ShelfAnimationWaiter() override { GetShelfWidget()->RemoveObserver(this); } 86 ~ShelfAnimationWaiter() override { GetShelfWidget()->RemoveObserver(this); }
86 87
87 // Wait till the shelf finishes animating to its expected bounds. 88 // Wait till the shelf finishes animating to its expected bounds.
88 void WaitTillDoneAnimating() { 89 void WaitTillDoneAnimating() {
89 if (IsDoneAnimating()) 90 if (IsDoneAnimating())
90 done_waiting_ = true; 91 done_waiting_ = true;
91 else 92 else
92 base::MessageLoop::current()->Run(); 93 base::RunLoop().Run();
93 } 94 }
94 95
95 // Returns true if the animation has completed and it was valid. 96 // Returns true if the animation has completed and it was valid.
96 bool WasValidAnimation() const { 97 bool WasValidAnimation() const {
97 return done_waiting_ && animation_steps_ > 0; 98 return done_waiting_ && animation_steps_ > 0;
98 } 99 }
99 100
100 private: 101 private:
101 // Returns true if shelf has finished animating to the target size. 102 // Returns true if shelf has finished animating to the target size.
102 bool IsDoneAnimating() const { 103 bool IsDoneAnimating() const {
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 // Open keyboard in sticky mode. 2076 // Open keyboard in sticky mode.
2076 kb_controller->ShowKeyboard(true); 2077 kb_controller->ShowKeyboard(true);
2077 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); 2078 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds());
2078 2079
2079 // Work area should be changed. 2080 // Work area should be changed.
2080 EXPECT_NE(orig_work_area, 2081 EXPECT_NE(orig_work_area,
2081 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); 2082 display::Screen::GetScreen()->GetPrimaryDisplay().work_area());
2082 } 2083 }
2083 2084
2084 } // namespace ash 2085 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shell/content/client/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698