summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/PopupMenuTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit/chromium/tests/PopupMenuTest.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit/chromium/tests/PopupMenuTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/PopupMenuTest.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/WebKit/chromium/tests/PopupMenuTest.cpp b/Source/WebKit/chromium/tests/PopupMenuTest.cpp
index f053ca410..1db65ec6e 100644
--- a/Source/WebKit/chromium/tests/PopupMenuTest.cpp
+++ b/Source/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -42,6 +42,7 @@
#include "PopupMenu.h"
#include "PopupMenuClient.h"
#include "PopupMenuChromium.h"
+#include "RuntimeEnabledFeatures.h"
#include "WebDocument.h"
#include "WebElement.h"
#include "WebFrame.h"
@@ -154,7 +155,7 @@ public:
// We need to override this so that the popup menu size is not 0
// (the layout code checks to see if the popup fits on the screen).
virtual WebScreenInfo screenInfo()
- {
+ {
WebScreenInfo screenInfo;
screenInfo.availableRect.height = 2000;
screenInfo.availableRect.width = 2000;
@@ -181,6 +182,10 @@ public:
protected:
virtual void SetUp()
{
+ // When touch is enabled, padding is added to option elements
+ // In these tests, we'll assume touch is disabled.
+ m_touchWasEnabled = RuntimeEnabledFeatures::touchEnabled();
+ RuntimeEnabledFeatures::setTouchEnabled(false);
m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient));
m_webView->initializeMainFrame(&m_webFrameClient);
m_popupMenu = adoptRef(new PopupMenuChromium(&m_popupMenuClient));
@@ -191,6 +196,7 @@ protected:
m_popupMenu = 0;
m_webView->close();
webkit_support::UnregisterAllMockedURLs();
+ RuntimeEnabledFeatures::setTouchEnabled(m_touchWasEnabled);
}
// Returns true if there currently is a select popup in the WebView.
@@ -278,6 +284,7 @@ protected:
TestWebFrameClient m_webFrameClient;
TestPopupMenuClient m_popupMenuClient;
RefPtr<PopupMenu> m_popupMenu;
+ bool m_touchWasEnabled;
std::string baseURL;
};