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

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

Issue 11795004: Continue threading context through unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/test/ash_test_base.h ('k') | ash/wm/custom_frame_view_ash_unittest.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/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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 displays.push_back(display); 91 displays.push_back(display);
92 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); 92 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays);
93 } 93 }
94 94
95 void AshTestBase::UpdateDisplay(const std::string& display_specs) { 95 void AshTestBase::UpdateDisplay(const std::string& display_specs) {
96 DisplayManagerTestApi display_manager_test_api( 96 DisplayManagerTestApi display_manager_test_api(
97 Shell::GetInstance()->display_manager()); 97 Shell::GetInstance()->display_manager());
98 display_manager_test_api.UpdateDisplay(display_specs); 98 display_manager_test_api.UpdateDisplay(display_specs);
99 } 99 }
100 100
101 aura::RootWindow* AshTestBase::CurrentContext() {
102 aura::RootWindow* root_window = Shell::GetActiveRootWindow();
103 if (!root_window)
104 root_window = Shell::GetPrimaryRootWindow();
105 DCHECK(root_window);
106 return root_window;
107 }
108
101 aura::Window* AshTestBase::CreateTestWindowInShellWithId(int id) { 109 aura::Window* AshTestBase::CreateTestWindowInShellWithId(int id) {
102 return CreateTestWindowInShellWithDelegate(NULL, id, gfx::Rect()); 110 return CreateTestWindowInShellWithDelegate(NULL, id, gfx::Rect());
103 } 111 }
104 112
105 aura::Window* AshTestBase::CreateTestWindowInShellWithBounds( 113 aura::Window* AshTestBase::CreateTestWindowInShellWithBounds(
106 const gfx::Rect& bounds) { 114 const gfx::Rect& bounds) {
107 return CreateTestWindowInShellWithDelegate(NULL, 0, bounds); 115 return CreateTestWindowInShellWithDelegate(NULL, 0, bounds);
108 } 116 }
109 117
110 aura::Window* AshTestBase::CreateTestWindowInShell(SkColor color, 118 aura::Window* AshTestBase::CreateTestWindowInShell(SkColor color,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { 180 void AshTestBase::SetUserLoggedIn(bool user_logged_in) {
173 test_shell_delegate_->SetUserLoggedIn(user_logged_in); 181 test_shell_delegate_->SetUserLoggedIn(user_logged_in);
174 } 182 }
175 183
176 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { 184 void AshTestBase::SetCanLockScreen(bool can_lock_screen) {
177 test_shell_delegate_->SetCanLockScreen(can_lock_screen); 185 test_shell_delegate_->SetCanLockScreen(can_lock_screen);
178 } 186 }
179 187
180 } // namespace test 188 } // namespace test
181 } // namespace ash 189 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.h ('k') | ash/wm/custom_frame_view_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698