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

Unified Diff: Source/web/PopupMenuTest.cpp

Issue 1013303004: Fix issue on <select> style change when popup is visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed test expectation Created 5 years, 9 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/PopupMenuImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupMenuTest.cpp
diff --git a/Source/web/PopupMenuTest.cpp b/Source/web/PopupMenuTest.cpp
index 4fc1a1a39bb99dfe9088bfe922eca661af2ad2dc..c9375727c57abbf023cfa1a4b225975f7d029484 100644
--- a/Source/web/PopupMenuTest.cpp
+++ b/Source/web/PopupMenuTest.cpp
@@ -79,7 +79,7 @@ namespace {
class TestPopupMenuClient : public PopupMenuClient {
public:
// Item at index 0 is selected by default.
- TestPopupMenuClient() : m_selectIndex(0), m_node(0), m_listSize(10) { }
+ TestPopupMenuClient() : m_selectIndex(0), m_node(0), m_listSize(10), m_indexToSelectOnCancel(-1) { }
virtual ~TestPopupMenuClient() { }
virtual void valueChanged(unsigned listIndex, bool fireEvents = true)
{
@@ -117,10 +117,15 @@ public:
virtual int listSize() const { return m_listSize; }
virtual int selectedIndex() const { return m_selectIndex; }
virtual void popupDidHide() { }
+ virtual void popupDidCancel()
+ {
+ if (m_indexToSelectOnCancel >= 0)
+ m_selectIndex = m_indexToSelectOnCancel;
+ }
virtual bool itemIsSeparator(unsigned listIndex) const { return false; }
virtual bool itemIsLabel(unsigned listIndex) const { return false; }
virtual bool itemIsSelected(unsigned listIndex) const { return listIndex == m_selectIndex; }
- virtual void setTextFromItem(unsigned listIndex) { }
+ virtual void provisionalSelectionChanged(unsigned listIndex) { m_indexToSelectOnCancel = listIndex; }
virtual IntRect elementRectRelativeToViewport() const override { return IntRect(); }
virtual Element& ownerElement() const override { return *toElement(m_node); }
virtual ComputedStyle* computedStyleForItem(Element& element) const override { return nullptr; }
@@ -139,6 +144,7 @@ private:
std::set<unsigned> m_disabledIndexSet;
Node* m_node;
int m_listSize;
+ int m_indexToSelectOnCancel;
};
class TestWebWidgetClient : public WebWidgetClient {
« no previous file with comments | « Source/web/PopupMenuImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698