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

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

Issue 23882007: Explicit initialization of aura::Env for browser shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chrome_frame_net_tests Created 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_helper.h" 5 #include "ash/test/ash_test_helper.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/display_manager_test_api.h" 9 #include "ash/test/display_manager_test_api.h"
10 #include "ash/test/shell_test_api.h" 10 #include "ash/test/shell_test_api.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER); 103 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER);
104 104
105 ui::ShutdownInputMethodForTesting(); 105 ui::ShutdownInputMethodForTesting();
106 zero_duration_mode_.reset(); 106 zero_duration_mode_.reset();
107 107
108 CHECK(!views::corewm::ScopedCaptureClient::IsActive()); 108 CHECK(!views::corewm::ScopedCaptureClient::IsActive());
109 } 109 }
110 110
111 void AshTestHelper::RunAllPendingInMessageLoop() { 111 void AshTestHelper::RunAllPendingInMessageLoop() {
112 DCHECK(base::MessageLoopForUI::current() == message_loop_); 112 DCHECK(base::MessageLoopForUI::current() == message_loop_);
113 aura::Env::CreateInstance();
113 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); 114 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
114 run_loop.RunUntilIdle(); 115 run_loop.RunUntilIdle();
115 } 116 }
116 117
117 aura::RootWindow* AshTestHelper::CurrentContext() { 118 aura::RootWindow* AshTestHelper::CurrentContext() {
118 aura::RootWindow* root_window = Shell::GetTargetRootWindow(); 119 aura::RootWindow* root_window = Shell::GetTargetRootWindow();
119 if (!root_window) 120 if (!root_window)
120 root_window = Shell::GetPrimaryRootWindow(); 121 root_window = Shell::GetPrimaryRootWindow();
121 DCHECK(root_window); 122 DCHECK(root_window);
122 return root_window; 123 return root_window;
123 } 124 }
124 125
125 } // namespace test 126 } // namespace test
126 } // namespace ash 127 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698