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

Side by Side Diff: Source/web/PopupMenuTest.cpp

Issue 892083003: Revert Implement <select> Popup Menu using PagePopup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/PopupMenuImpl.cpp ('k') | Source/web/WebPagePopupImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 virtual LayoutUnit clientPaddingLeft() const { return 0; } 115 virtual LayoutUnit clientPaddingLeft() const { return 0; }
116 virtual LayoutUnit clientPaddingRight() const { return 0; } 116 virtual LayoutUnit clientPaddingRight() const { return 0; }
117 virtual int listSize() const { return m_listSize; } 117 virtual int listSize() const { return m_listSize; }
118 virtual int selectedIndex() const { return m_selectIndex; } 118 virtual int selectedIndex() const { return m_selectIndex; }
119 virtual void popupDidHide() { } 119 virtual void popupDidHide() { }
120 virtual bool itemIsSeparator(unsigned listIndex) const { return false; } 120 virtual bool itemIsSeparator(unsigned listIndex) const { return false; }
121 virtual bool itemIsLabel(unsigned listIndex) const { return false; } 121 virtual bool itemIsLabel(unsigned listIndex) const { return false; }
122 virtual bool itemIsSelected(unsigned listIndex) const { return listIndex == m_selectIndex; } 122 virtual bool itemIsSelected(unsigned listIndex) const { return listIndex == m_selectIndex; }
123 virtual bool valueShouldChangeOnHotTrack() const { return false; } 123 virtual bool valueShouldChangeOnHotTrack() const { return false; }
124 virtual void setTextFromItem(unsigned listIndex) { } 124 virtual void setTextFromItem(unsigned listIndex) { }
125 virtual IntRect elementRectRelativeToRootView() const override { return IntR ect(); }
126 virtual Element& ownerElement() const override { return *toElement(m_node); }
127 virtual RenderStyle* renderStyleForItem(Element& element) const override { r eturn nullptr; }
128 125
129 virtual FontSelector* fontSelector() const { return 0; } 126 virtual FontSelector* fontSelector() const { return 0; }
130 virtual HostWindow* hostWindow() const { return 0; } 127 virtual HostWindow* hostWindow() const { return 0; }
131 128
132 virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollableArea*, S crollbarOrientation, ScrollbarControlSize) { return nullptr; } 129 virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollableArea*, S crollbarOrientation, ScrollbarControlSize) { return nullptr; }
133 130
134 void setDisabledIndex(unsigned index) { m_disabledIndexSet.insert(index); } 131 void setDisabledIndex(unsigned index) { m_disabledIndexSet.insert(index); }
135 void setFocusedNode(Node* node) { m_node = node; } 132 void setFocusedNode(Node* node) { m_node = node; }
136 void setListSize(int listSize) { m_listSize = listSize; } 133 void setListSize(int listSize) { m_listSize = listSize; }
137 134
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 private: 589 private:
593 FrameTestHelpers::WebViewHelper m_helper; 590 FrameTestHelpers::WebViewHelper m_helper;
594 }; 591 };
595 592
596 #if OS(MACOSX) || OS(ANDROID) 593 #if OS(MACOSX) || OS(ANDROID)
597 TEST_F(SelectPopupMenuStyleTest, DISABLED_PopupListBoxRTLRowWidth) 594 TEST_F(SelectPopupMenuStyleTest, DISABLED_PopupListBoxRTLRowWidth)
598 #else 595 #else
599 TEST_F(SelectPopupMenuStyleTest, PopupListBoxRTLRowWidth) 596 TEST_F(SelectPopupMenuStyleTest, PopupListBoxRTLRowWidth)
600 #endif 597 #endif
601 { 598 {
602 RuntimeEnabledFeatures::setHTMLPopupMenuEnabled(false);
603 registerMockedURLLoad("select_rtl_width.html"); 599 registerMockedURLLoad("select_rtl_width.html");
604 loadFrame(mainFrame(), "select_rtl_width.html"); 600 loadFrame(mainFrame(), "select_rtl_width.html");
605 HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->docume nt()->focusedElement()); 601 HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->docume nt()->focusedElement());
606 RenderMenuList* menuList = toRenderMenuList(select->renderer()); 602 RenderMenuList* menuList = toRenderMenuList(select->renderer());
607 ASSERT(menuList); 603 ASSERT(menuList);
608 menuList->showPopup(); 604 menuList->showPopup();
609 ASSERT(popupOpen()); 605 ASSERT(popupOpen());
610 PopupListBox* listBox = webView()->selectPopup()->listBox(); 606 PopupListBox* listBox = webView()->selectPopup()->listBox();
611 int ltrWidth = listBox->getRowBaseWidth(0); 607 int ltrWidth = listBox->getRowBaseWidth(0);
612 int rtlWidth = listBox->getRowBaseWidth(1); 608 int rtlWidth = listBox->getRowBaseWidth(1);
613 EXPECT_LT(rtlWidth, ltrWidth); 609 EXPECT_LT(rtlWidth, ltrWidth);
614 } 610 }
615 611
616 } // namespace 612 } // namespace
OLDNEW
« no previous file with comments | « Source/web/PopupMenuImpl.cpp ('k') | Source/web/WebPagePopupImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698