| Index: Source/web/ExternalPopupMenuTest.cpp
|
| diff --git a/Source/web/ExternalPopupMenuTest.cpp b/Source/web/ExternalPopupMenuTest.cpp
|
| index ecb284c7d12e8a5ae412296a6bec5ab36ec365cc..e887165a4185c38d757904986af85d54f74835b9 100644
|
| --- a/Source/web/ExternalPopupMenuTest.cpp
|
| +++ b/Source/web/ExternalPopupMenuTest.cpp
|
| @@ -11,6 +11,7 @@
|
| #include "core/html/HTMLSelectElement.h"
|
| #include "core/page/Page.h"
|
| #include "core/rendering/RenderMenuList.h"
|
| +#include "core/testing/DummyPageHolder.h"
|
| #include "core/testing/URLTestHelpers.h"
|
| #include "platform/PopupMenu.h"
|
| #include "platform/PopupMenuClient.h"
|
| @@ -62,12 +63,17 @@ public:
|
| virtual bool itemIsSelected(unsigned listIndex) const override { return listIndex == 0;}
|
| virtual void setTextFromItem(unsigned listIndex) override { }
|
| virtual bool multiple() const override { return false; }
|
| + virtual IntRect elementRectRelativeToRootView() const override { return IntRect(); }
|
| + virtual Element& ownerElement() const override { return *m_ownerElement; }
|
| + virtual RenderStyle* renderStyleForItem(HTMLElement& element) const override { return nullptr; }
|
|
|
| void setListSize(size_t size) { m_listSize = size; }
|
| void setDisplayNoneIndex(unsigned index) { m_displayNoneIndexSet.insert(index); }
|
| + void setOwnerElement(PassRefPtrWillBeRawPtr<Element> element) { m_ownerElement = element; }
|
| private:
|
| size_t m_listSize;
|
| std::set<unsigned> m_displayNoneIndexSet;
|
| + RefPtrWillBePersistent<Element> m_ownerElement;
|
| };
|
|
|
| class ExternalPopupMenuDisplayNoneItemsTest : public testing::Test {
|
| @@ -82,6 +88,9 @@ protected:
|
| // Set the 4th an 5th items to have "display: none" property
|
| m_popupMenuClient.setDisplayNoneIndex(3);
|
| m_popupMenuClient.setDisplayNoneIndex(4);
|
| +
|
| + OwnPtr<DummyPageHolder> dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
|
| + m_popupMenuClient.setOwnerElement(HTMLSelectElement::create(dummyPageHolder->document()));
|
| }
|
|
|
| TestPopupMenuClient m_popupMenuClient;
|
|
|