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

Side by Side Diff: ash/test/ash_test_base.cc

Issue 10836065: Improve WorkspaceWindowResizer::CompleteDrag() so that the function moves the window to a root windo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final rebase Created 8 years, 4 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
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | ash/wm/workspace/workspace_window_resizer.h » ('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/test/ash_test_base.h" 5 #include "ash/test/ash_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/display/display_controller.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/test/test_shell_delegate.h" 12 #include "ash/test/test_shell_delegate.h"
12 #include "base/run_loop.h" 13 #include "base/run_loop.h"
13 #include "base/string_split.h" 14 #include "base/string_split.h"
14 #include "content/public/test/web_contents_tester.h" 15 #include "content/public/test/web_contents_tester.h"
15 #include "ui/aura/env.h" 16 #include "ui/aura/env.h"
16 #include "ui/aura/display_manager.h" 17 #include "ui/aura/display_manager.h"
17 #include "ui/aura/root_window.h" 18 #include "ui/aura/root_window.h"
18 #include "ui/base/ime/text_input_test_support.h" 19 #include "ui/base/ime/text_input_test_support.h"
19 #include "ui/compositor/layer_animator.h" 20 #include "ui/compositor/layer_animator.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 std::vector<gfx::Display> displays; 81 std::vector<gfx::Display> displays;
81 displays.push_back(display); 82 displays.push_back(display);
82 aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged( 83 aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged(
83 displays); 84 displays);
84 } 85 }
85 86
86 void AshTestBase::UpdateDisplay(const std::string& display_specs) { 87 void AshTestBase::UpdateDisplay(const std::string& display_specs) {
87 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); 88 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs);
88 aura::Env::GetInstance()->display_manager()-> 89 aura::Env::GetInstance()->display_manager()->
89 OnNativeDisplaysChanged(displays); 90 OnNativeDisplaysChanged(displays);
91
92 // On non-testing environment, when a secondary display is connected, a new
93 // native (i.e. X) window for the display is always created below the previous
94 // one for GPU performance reasons. Try to emulate the behavior.
95 if (internal::DisplayController::IsExtendedDesktopEnabled()) {
96 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
97 DCHECK_EQ(displays.size(), root_windows.size());
98 size_t next_y = 0;
99 for (size_t i = 0; i < root_windows.size(); ++i) {
100 const gfx::Size size = root_windows[i]->GetHostSize();
101 root_windows[i]->SetHostBounds(gfx::Rect(gfx::Point(0, next_y), size));
102 next_y += size.height();
103 }
104 }
90 } 105 }
91 106
92 void AshTestBase::RunAllPendingInMessageLoop() { 107 void AshTestBase::RunAllPendingInMessageLoop() {
93 #if !defined(OS_MACOSX) 108 #if !defined(OS_MACOSX)
94 DCHECK(MessageLoopForUI::current() == &message_loop_); 109 DCHECK(MessageLoopForUI::current() == &message_loop_);
95 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); 110 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
96 run_loop.RunUntilIdle(); 111 run_loop.RunUntilIdle();
97 #endif 112 #endif
98 } 113 }
99 114
100 } // namespace test 115 } // namespace test
101 } // namespace ash 116 } // namespace ash
OLDNEW
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698