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

Side by Side Diff: ui/aura/test/aura_test_helper.cc

Issue 262883011: Makes PlatformEventSource creation in Env conditional (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/examples/content_client/examples_browser_main_parts.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 AuraTestHelper::~AuraTestHelper() { 48 AuraTestHelper::~AuraTestHelper() {
49 CHECK(setup_called_) 49 CHECK(setup_called_)
50 << "AuraTestHelper::SetUp() never called."; 50 << "AuraTestHelper::SetUp() never called.";
51 CHECK(teardown_called_) 51 CHECK(teardown_called_)
52 << "AuraTestHelper::TearDown() never called."; 52 << "AuraTestHelper::TearDown() never called.";
53 } 53 }
54 54
55 void AuraTestHelper::SetUp() { 55 void AuraTestHelper::SetUp() {
56 setup_called_ = true; 56 setup_called_ = true;
57 57
58 Env::CreateInstance(); 58 Env::CreateInstance(true);
59 // Unit tests generally don't want to query the system, rather use the state 59 // Unit tests generally don't want to query the system, rather use the state
60 // from RootWindow. 60 // from RootWindow.
61 EnvTestHelper(Env::GetInstance()).SetInputStateLookup( 61 EnvTestHelper(Env::GetInstance()).SetInputStateLookup(
62 scoped_ptr<InputStateLookup>()); 62 scoped_ptr<InputStateLookup>());
63 63
64 ui::InitializeInputMethodForTesting(); 64 ui::InitializeInputMethodForTesting();
65 65
66 test_screen_.reset(TestScreen::Create()); 66 test_screen_.reset(TestScreen::Create());
67 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); 67 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get());
68 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); 68 host_.reset(test_screen_->CreateHostForPrimaryDisplay());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 void AuraTestHelper::RunAllPendingInMessageLoop() { 105 void AuraTestHelper::RunAllPendingInMessageLoop() {
106 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them 106 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them
107 // use run_loop.QuitClosure(). 107 // use run_loop.QuitClosure().
108 base::RunLoop run_loop; 108 base::RunLoop run_loop;
109 run_loop.RunUntilIdle(); 109 run_loop.RunUntilIdle();
110 } 110 }
111 111
112 } // namespace test 112 } // namespace test
113 } // namespace aura 113 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/env.cc ('k') | ui/views/examples/content_client/examples_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698