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

Side by Side Diff: ui/views/focus/focus_manager_test.cc

Issue 11416251: Desktop aura: Continue threading context through views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix erroneously removed line from NWWin tests. Created 8 years 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 "ui/views/focus/focus_manager_test.h" 5 #include "ui/views/focus/focus_manager_test.h"
6 6
7 #include "ui/views/focus/focus_manager.h" 7 #include "ui/views/focus/focus_manager.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 12 matching lines...) Expand all
23 23
24 FocusManager* FocusManagerTest::GetFocusManager() { 24 FocusManager* FocusManagerTest::GetFocusManager() {
25 return GetWidget()->GetFocusManager(); 25 return GetWidget()->GetFocusManager();
26 } 26 }
27 27
28 //////////////////////////////////////////////////////////////////////////////// 28 ////////////////////////////////////////////////////////////////////////////////
29 // FocusManagerTest, ViewTestBase overrides: 29 // FocusManagerTest, ViewTestBase overrides:
30 30
31 void FocusManagerTest::SetUp() { 31 void FocusManagerTest::SetUp() {
32 ViewsTestBase::SetUp(); 32 ViewsTestBase::SetUp();
33 Widget* widget = 33
34 Widget::CreateWindowWithBounds(this, gfx::Rect(0, 0, 1024, 768)); 34 Widget* widget = new Widget;
35 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
36 params.delegate = this;
37 params.bounds = gfx::Rect(0, 0, 1024, 768);
38 widget->Init(params);
39
35 InitContentView(); 40 InitContentView();
36 widget->Show(); 41 widget->Show();
37 } 42 }
38 43
39 void FocusManagerTest::TearDown() { 44 void FocusManagerTest::TearDown() {
40 if (focus_change_listener_) 45 if (focus_change_listener_)
41 GetFocusManager()->RemoveFocusChangeListener(focus_change_listener_); 46 GetFocusManager()->RemoveFocusChangeListener(focus_change_listener_);
42 if (widget_focus_change_listener_) { 47 if (widget_focus_change_listener_) {
43 WidgetFocusManager::GetInstance()->RemoveFocusChangeListener( 48 WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(
44 widget_focus_change_listener_); 49 widget_focus_change_listener_);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 focus_changes_.clear(); 141 focus_changes_.clear();
137 } 142 }
138 143
139 void TestWidgetFocusChangeListener::OnNativeFocusChange( 144 void TestWidgetFocusChangeListener::OnNativeFocusChange(
140 gfx::NativeView focused_before, 145 gfx::NativeView focused_before,
141 gfx::NativeView focused_now) { 146 gfx::NativeView focused_now) {
142 focus_changes_.push_back(NativeViewPair(focused_before, focused_now)); 147 focus_changes_.push_back(NativeViewPair(focused_before, focused_now));
143 } 148 }
144 149
145 } // namespace views 150 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views_unittest.cc ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698