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

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: Fixed tests for mac Created 5 years, 10 months 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
« no previous file with comments | « Source/web/DateTimeChooserImpl.h ('k') | Source/web/PopupMenuImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ExternalPopupMenuTest.cpp
diff --git a/Source/web/ExternalPopupMenuTest.cpp b/Source/web/ExternalPopupMenuTest.cpp
index c1a5156ff7375a23a4fa445d67476be2c430cca9..80cae7900a43288a5b1a7d4f9c75eaab7e44b310 100644
--- a/Source/web/ExternalPopupMenuTest.cpp
+++ b/Source/web/ExternalPopupMenuTest.cpp
@@ -12,6 +12,7 @@
#include "core/html/forms/PopupMenuClient.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 "public/platform/Platform.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(Element& 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;
« no previous file with comments | « Source/web/DateTimeChooserImpl.h ('k') | Source/web/PopupMenuImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698