OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 #include "content/common/frame_messages.h" | 6 #include "content/common/frame_messages.h" |
7 #include "content/public/test/render_view_test.h" | 7 #include "content/public/test/render_view_test.h" |
8 #include "content/renderer/render_frame_impl.h" | 8 #include "content/renderer/render_frame_impl.h" |
9 #include "content/renderer/render_view_impl.h" | 9 #include "content/renderer/render_view_impl.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // http://crbug.com/63774 | 126 // http://crbug.com/63774 |
127 TEST_F(ExternalPopupMenuTest, EmptySelect) { | 127 TEST_F(ExternalPopupMenuTest, EmptySelect) { |
128 EXPECT_TRUE(SimulateElementClick(kEmptySelectID)); | 128 EXPECT_TRUE(SimulateElementClick(kEmptySelectID)); |
129 } | 129 } |
130 | 130 |
131 class ExternalPopupMenuRemoveTest : public ExternalPopupMenuTest { | 131 class ExternalPopupMenuRemoveTest : public ExternalPopupMenuTest { |
132 public: | 132 public: |
133 ExternalPopupMenuRemoveTest() {} | 133 ExternalPopupMenuRemoveTest() {} |
134 | 134 |
135 protected: | 135 protected: |
136 virtual bool ShouldRemoveSelectOnChange() const OVERRIDE { return true; } | 136 virtual bool ShouldRemoveSelectOnChange() const override { return true; } |
137 }; | 137 }; |
138 | 138 |
139 // Tests that nothing bad happen when the page removes the select when it | 139 // Tests that nothing bad happen when the page removes the select when it |
140 // changes. (http://crbug.com/61997) | 140 // changes. (http://crbug.com/61997) |
141 TEST_F(ExternalPopupMenuRemoveTest, RemoveOnChange) { | 141 TEST_F(ExternalPopupMenuRemoveTest, RemoveOnChange) { |
142 // Click the text field once to show the popup. | 142 // Click the text field once to show the popup. |
143 EXPECT_TRUE(SimulateElementClick(kSelectID)); | 143 EXPECT_TRUE(SimulateElementClick(kSelectID)); |
144 | 144 |
145 // Select something, it causes the select to be removed from the page. | 145 // Select something, it causes the select to be removed from the page. |
146 frame()->OnSelectPopupMenuItem(0); | 146 frame()->OnSelectPopupMenuItem(0); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ASSERT_EQ(5U, param.a.popup_items.size()); | 196 ASSERT_EQ(5U, param.a.popup_items.size()); |
197 | 197 |
198 // Select index 1 item. This should select item with index 2, | 198 // Select index 1 item. This should select item with index 2, |
199 // skipping the item with 'display: none' | 199 // skipping the item with 'display: none' |
200 frame()->OnSelectPopupMenuItem(1); | 200 frame()->OnSelectPopupMenuItem(1); |
201 | 201 |
202 EXPECT_EQ(2, GetSelectedIndex()); | 202 EXPECT_EQ(2, GetSelectedIndex()); |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |