| OLD | NEW |
| 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/keycodes/keyboard_codes.h" | 6 #include "ui/base/keycodes/keyboard_codes.h" |
| 7 #include "ui/base/models/combobox_model.h" | 7 #include "ui/base/models/combobox_model.h" |
| 8 #include "ui/views/controls/combobox/combobox.h" | 8 #include "ui/views/controls/combobox/combobox.h" |
| 9 #include "ui/views/controls/combobox/native_combobox_views.h" | 9 #include "ui/views/controls/combobox/native_combobox_views.h" |
| 10 #include "ui/views/ime/mock_input_method.h" | 10 #include "ui/views/ime/mock_input_method.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 : widget_(NULL), | 78 : widget_(NULL), |
| 79 combobox_(NULL), | 79 combobox_(NULL), |
| 80 combobox_view_(NULL), | 80 combobox_view_(NULL), |
| 81 model_(NULL), | 81 model_(NULL), |
| 82 input_method_(NULL) { | 82 input_method_(NULL) { |
| 83 } | 83 } |
| 84 | 84 |
| 85 // ::testing::Test: | 85 // ::testing::Test: |
| 86 virtual void SetUp() { | 86 virtual void SetUp() { |
| 87 ViewsTestBase::SetUp(); | 87 ViewsTestBase::SetUp(); |
| 88 Widget::SetPureViews(true); | |
| 89 } | 88 } |
| 90 | 89 |
| 91 virtual void TearDown() { | 90 virtual void TearDown() { |
| 92 Widget::SetPureViews(false); | |
| 93 if (widget_) | 91 if (widget_) |
| 94 widget_->Close(); | 92 widget_->Close(); |
| 95 ViewsTestBase::TearDown(); | 93 ViewsTestBase::TearDown(); |
| 96 } | 94 } |
| 97 | 95 |
| 98 void InitCombobox() { | 96 void InitCombobox() { |
| 99 model_.reset(new TestComboboxModel()); | 97 model_.reset(new TestComboboxModel()); |
| 100 | 98 |
| 101 ASSERT_FALSE(combobox_); | 99 ASSERT_FALSE(combobox_); |
| 102 combobox_ = new TestCombobox(model_.get()); | 100 combobox_ = new TestCombobox(model_.get()); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 widget_->SetContentsView(container); | 186 widget_->SetContentsView(container); |
| 189 container->AddChildView(combobox_); | 187 container->AddChildView(combobox_); |
| 190 | 188 |
| 191 combobox_view_ = static_cast<NativeComboboxViews*>( | 189 combobox_view_ = static_cast<NativeComboboxViews*>( |
| 192 combobox_->GetNativeWrapperForTesting()); | 190 combobox_->GetNativeWrapperForTesting()); |
| 193 ASSERT_TRUE(combobox_view_); | 191 ASSERT_TRUE(combobox_view_); |
| 194 ASSERT_FALSE(combobox_view_->enabled()); | 192 ASSERT_FALSE(combobox_view_->enabled()); |
| 195 } | 193 } |
| 196 | 194 |
| 197 } // namespace views | 195 } // namespace views |
| OLD | NEW |