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

Unified Diff: Source/web/ExternalPopupMenuTest.cpp

Issue 736883002: Implement <select> Popup Menu using PagePopup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698