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

Side by Side Diff: ui/views/controls/combobox/native_combobox_views_unittest.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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "ui/base/events/event.h" 6 #include "ui/base/events/event.h"
7 #include "ui/base/keycodes/keyboard_codes.h" 7 #include "ui/base/keycodes/keyboard_codes.h"
8 #include "ui/base/models/combobox_model.h" 8 #include "ui/base/models/combobox_model.h"
9 #include "ui/views/controls/combobox/combobox.h" 9 #include "ui/views/controls/combobox/combobox.h"
10 #include "ui/views/controls/combobox/native_combobox_views.h" 10 #include "ui/views/controls/combobox/native_combobox_views.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 void InitCombobox() { 97 void InitCombobox() {
98 model_.reset(new TestComboboxModel()); 98 model_.reset(new TestComboboxModel());
99 99
100 ASSERT_FALSE(combobox_); 100 ASSERT_FALSE(combobox_);
101 combobox_ = new TestCombobox(model_.get()); 101 combobox_ = new TestCombobox(model_.get());
102 combobox_->set_id(1); 102 combobox_->set_id(1);
103 103
104 widget_ = new Widget; 104 widget_ = new Widget;
105 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); 105 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
106 params.bounds = gfx::Rect(100, 100, 100, 100); 106 params.bounds = gfx::Rect(100, 100, 100, 100);
107 widget_->Init(params); 107 widget_->Init(params);
108 View* container = new View(); 108 View* container = new View();
109 widget_->SetContentsView(container); 109 widget_->SetContentsView(container);
110 container->AddChildView(combobox_); 110 container->AddChildView(combobox_);
111 111
112 combobox_view_ = static_cast<NativeComboboxViews*>( 112 combobox_view_ = static_cast<NativeComboboxViews*>(
113 combobox_->GetNativeWrapperForTesting()); 113 combobox_->GetNativeWrapperForTesting());
114 ASSERT_TRUE(combobox_view_); 114 ASSERT_TRUE(combobox_view_);
115 115
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // native wrapper inherits the disabled state when it gets created. 173 // native wrapper inherits the disabled state when it gets created.
174 TEST_F(NativeComboboxViewsTest, DisabilityTest) { 174 TEST_F(NativeComboboxViewsTest, DisabilityTest) {
175 model_.reset(new TestComboboxModel()); 175 model_.reset(new TestComboboxModel());
176 176
177 ASSERT_FALSE(combobox_); 177 ASSERT_FALSE(combobox_);
178 combobox_ = new TestCombobox(model_.get()); 178 combobox_ = new TestCombobox(model_.get());
179 combobox_->SetEnabled(false); 179 combobox_->SetEnabled(false);
180 ASSERT_FALSE(combobox_->GetNativeWrapperForTesting()); 180 ASSERT_FALSE(combobox_->GetNativeWrapperForTesting());
181 181
182 widget_ = new Widget; 182 widget_ = new Widget;
183 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); 183 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
184 params.bounds = gfx::Rect(100, 100, 100, 100); 184 params.bounds = gfx::Rect(100, 100, 100, 100);
185 widget_->Init(params); 185 widget_->Init(params);
186 View* container = new View(); 186 View* container = new View();
187 widget_->SetContentsView(container); 187 widget_->SetContentsView(container);
188 container->AddChildView(combobox_); 188 container->AddChildView(combobox_);
189 189
190 combobox_view_ = static_cast<NativeComboboxViews*>( 190 combobox_view_ = static_cast<NativeComboboxViews*>(
191 combobox_->GetNativeWrapperForTesting()); 191 combobox_->GetNativeWrapperForTesting());
192 ASSERT_TRUE(combobox_view_); 192 ASSERT_TRUE(combobox_view_);
193 ASSERT_FALSE(combobox_view_->enabled()); 193 ASSERT_FALSE(combobox_view_->enabled());
194 } 194 }
195 195
196 } // namespace views 196 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_frame_view_unittest.cc ('k') | ui/views/controls/native/native_view_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698