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

Side by Side Diff: ui/aura/test/aura_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: Rebased no-op 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
« no previous file with comments | « ui/aura/env.cc ('k') | ui/views/bubble/bubble_delegate_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 "ui/aura/test/aura_test_helper.h" 5 #include "ui/aura/test/aura_test_helper.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/default_capture_client.h" 10 #include "ui/aura/client/default_capture_client.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 << "AuraTestHelper::TearDown() never called."; 58 << "AuraTestHelper::TearDown() never called.";
59 } 59 }
60 60
61 void AuraTestHelper::SetUp() { 61 void AuraTestHelper::SetUp() {
62 setup_called_ = true; 62 setup_called_ = true;
63 63
64 // The ContextFactory must exist before any Compositors are created. 64 // The ContextFactory must exist before any Compositors are created.
65 bool allow_test_contexts = true; 65 bool allow_test_contexts = true;
66 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); 66 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts);
67 67
68 Env::GetInstance(); 68 Env::CreateInstance();
69 test_screen_.reset(TestScreen::Create()); 69 test_screen_.reset(TestScreen::Create());
70 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); 70 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get());
71 root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay()); 71 root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay());
72 72
73 focus_client_.reset(new FocusManager); 73 focus_client_.reset(new FocusManager);
74 client::SetFocusClient(root_window_.get(), focus_client_.get()); 74 client::SetFocusClient(root_window_.get(), focus_client_.get());
75 stacking_client_.reset(new TestStackingClient(root_window_.get())); 75 stacking_client_.reset(new TestStackingClient(root_window_.get()));
76 test_activation_client_.reset( 76 test_activation_client_.reset(
77 new test::TestActivationClient(root_window_.get())); 77 new test::TestActivationClient(root_window_.get()));
78 capture_client_.reset(new client::DefaultCaptureClient(root_window_.get())); 78 capture_client_.reset(new client::DefaultCaptureClient(root_window_.get()));
(...skipping 27 matching lines...) Expand all
106 106
107 void AuraTestHelper::RunAllPendingInMessageLoop() { 107 void AuraTestHelper::RunAllPendingInMessageLoop() {
108 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them 108 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them
109 // use run_loop.QuitClosure(). 109 // use run_loop.QuitClosure().
110 base::RunLoop run_loop(Env::GetInstance()->GetDispatcher()); 110 base::RunLoop run_loop(Env::GetInstance()->GetDispatcher());
111 run_loop.RunUntilIdle(); 111 run_loop.RunUntilIdle();
112 } 112 }
113 113
114 } // namespace test 114 } // namespace test
115 } // namespace aura 115 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/env.cc ('k') | ui/views/bubble/bubble_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698