| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class ExternalPopupMenuTest : public RenderViewTest { | 24 class ExternalPopupMenuTest : public RenderViewTest { |
| 25 public: | 25 public: |
| 26 ExternalPopupMenuTest() {} | 26 ExternalPopupMenuTest() {} |
| 27 | 27 |
| 28 RenderViewImpl* view() { | 28 RenderViewImpl* view() { |
| 29 return static_cast<RenderViewImpl*>(view_); | 29 return static_cast<RenderViewImpl*>(view_); |
| 30 } | 30 } |
| 31 | 31 |
| 32 RenderFrameImpl* frame() { | 32 RenderFrameImpl* frame() { |
| 33 return view()->main_render_frame(); | 33 return view()->GetMainRenderFrame(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual void SetUp() { | 36 virtual void SetUp() { |
| 37 RenderViewTest::SetUp(); | 37 RenderViewTest::SetUp(); |
| 38 // We need to set this explictly as RenderMain is not run. | 38 // We need to set this explictly as RenderMain is not run. |
| 39 blink::WebView::setUseExternalPopupMenus(true); | 39 blink::WebView::setUseExternalPopupMenus(true); |
| 40 | 40 |
| 41 std::string html = "<select id='mySelect' onchange='selectChanged(this)'>" | 41 std::string html = "<select id='mySelect' onchange='selectChanged(this)'>" |
| 42 " <option>zero</option>" | 42 " <option>zero</option>" |
| 43 " <option selected='1'>one</option>" | 43 " <option selected='1'>one</option>" |
| (...skipping 152 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 |