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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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/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/display/display_controller.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 RunAllPendingInMessageLoop(); 73 RunAllPendingInMessageLoop();
74 74
75 // Tear down the shell. 75 // Tear down the shell.
76 Shell::DeleteInstance(); 76 Shell::DeleteInstance();
77 aura::Env::DeleteInstance(); 77 aura::Env::DeleteInstance();
78 ui::TextInputTestSupport::Shutdown(); 78 ui::TextInputTestSupport::Shutdown();
79 } 79 }
80 80
81 void AshTestBase::ChangeDisplayConfig(float scale, 81 void AshTestBase::ChangeDisplayConfig(float scale,
82 const gfx::Rect& bounds_in_pixel) { 82 const gfx::Rect& bounds_in_pixel) {
83 gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryDisplay().id()); 83 gfx::Display display =
84 gfx::Display(Shell::GetScreen()->GetPrimaryDisplay().id());
84 display.SetScaleAndBounds(scale, bounds_in_pixel); 85 display.SetScaleAndBounds(scale, bounds_in_pixel);
85 std::vector<gfx::Display> displays; 86 std::vector<gfx::Display> displays;
86 displays.push_back(display); 87 displays.push_back(display);
87 aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged( 88 aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged(
88 displays); 89 displays);
89 } 90 }
90 91
91 void AshTestBase::UpdateDisplay(const std::string& display_specs) { 92 void AshTestBase::UpdateDisplay(const std::string& display_specs) {
92 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); 93 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs);
93 internal::MultiDisplayManager* display_manager = 94 internal::MultiDisplayManager* display_manager =
(...skipping 28 matching lines...) Expand all
122 void AshTestBase::RunAllPendingInMessageLoop() { 123 void AshTestBase::RunAllPendingInMessageLoop() {
123 #if !defined(OS_MACOSX) 124 #if !defined(OS_MACOSX)
124 DCHECK(MessageLoopForUI::current() == &message_loop_); 125 DCHECK(MessageLoopForUI::current() == &message_loop_);
125 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); 126 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
126 run_loop.RunUntilIdle(); 127 run_loop.RunUntilIdle();
127 #endif 128 #endif
128 } 129 }
129 130
130 } // namespace test 131 } // namespace test
131 } // namespace ash 132 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | ash/tooltips/tooltip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698