1cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block/* 2cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 4cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 5cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * Redistribution and use in source and binary forms, with or without 6cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * modification, are permitted provided that the following conditions 7cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * are met: 8cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 9cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 1. Redistributions of source code must retain the above copyright 10cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * notice, this list of conditions and the following disclaimer. 11cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 2. Redistributions in binary form must reproduce the above copyright 12cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * notice, this list of conditions and the following disclaimer in the 13cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * documentation and/or other materials provided with the distribution. 14cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 15cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * its contributors may be used to endorse or promote products derived 16cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * from this software without specific prior written permission. 17cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 18cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 19cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block */ 29cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 30cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#ifndef LayoutTestControllerQt_h 31cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#define LayoutTestControllerQt_h 32cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 33cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QBasicTimer> 34cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QObject> 35cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QSize> 36cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QString> 37cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QtDebug> 38cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QTimer> 39cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QTimerEvent> 40cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <QVariant> 41cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 42cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <qwebdatabase.h> 43dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block#include <qwebelement.h> 44cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <qwebframe.h> 45cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <qwebhistory.h> 46cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <qwebpage.h> 47cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <qwebsecurityorigin.h> 48cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 49cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockclass QWebFrame; 50dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Blockclass DumpRenderTreeSupportQt; 51cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blocknamespace WebCore { 52cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block class DumpRenderTree; 53cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block} 54cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockclass LayoutTestController : public QObject { 55cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block Q_OBJECT 56d0825bca7fe65beaee391d30da42e937db621564Steve Block Q_PROPERTY(int webHistoryItemCount READ webHistoryItemCount) 57d0825bca7fe65beaee391d30da42e937db621564Steve Block Q_PROPERTY(int workerThreadCount READ workerThreadCount) 585e2bc6953fe6923165b8a5d7679939693a1d58d6Steve Block Q_PROPERTY(bool globalFlag READ globalFlag WRITE setGlobalFlag) 59cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockpublic: 60cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block LayoutTestController(WebCore::DumpRenderTree* drt); 61cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 62cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldDumpAsText() const { return m_textDump; } 63cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldDumpBackForwardList() const { return m_dumpBackForwardList; } 64cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldDumpChildrenAsText() const { return m_dumpChildrenAsText; } 65ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block bool shouldDumpChildFrameScrollPositions() const { return m_dumpChildFrameScrollPositions; } 66cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldDumpDatabaseCallbacks() const { return m_dumpDatabaseCallbacks; } 67f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool shouldDumpApplicationCacheDelegateCallbacks() const { return m_dumpApplicationCacheDelegateCallbacks; } 68cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; } 69cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldWaitUntilDone() const { return m_waitForDone; } 70643ca7872b450ea4efacab6188849e5aac2ba161Steve Block bool shouldHandleErrorPages() const { return m_handleErrorPages; } 71cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool canOpenWindows() const { return m_canOpenWindows; } 72cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; } 73cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool waitForPolicy() const { return m_waitForPolicy; } 740617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen bool ignoreReqestForPermission() const { return m_ignoreDesktopNotification; } 756b70adc33054f8aee8c54d0f460458a9df11b8a5Russell Brenner bool isPrinting() { return m_isPrinting; } 76cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 77cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void reset(); 78cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 79dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block static const unsigned int maxViewWidth; 80dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block static const unsigned int maxViewHeight; 81dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block 82cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockprotected: 83cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void timerEvent(QTimerEvent*); 84cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 85cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blocksignals: 86cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void done(); 87cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 88d0825bca7fe65beaee391d30da42e937db621564Steve Block void showPage(); 89d0825bca7fe65beaee391d30da42e937db621564Steve Block void hidePage(); 905ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen void geolocationPermissionSet(); 91d0825bca7fe65beaee391d30da42e937db621564Steve Block 92cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockpublic slots: 93cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void maybeDump(bool ok); 94cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpAsText() { m_textDump = true; } 95cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpChildFramesAsText() { m_dumpChildrenAsText = true; } 96ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block void dumpChildFrameScrollPositions() { m_dumpChildFrameScrollPositions = true; } 97cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpDatabaseCallbacks() { m_dumpDatabaseCallbacks = true; } 98f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void dumpApplicationCacheDelegateCallbacks() { m_dumpApplicationCacheDelegateCallbacks = true;} 99cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; } 100cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setCanOpenWindows() { m_canOpenWindows = true; } 1016b70adc33054f8aee8c54d0f460458a9df11b8a5Russell Brenner void setPrinting() { m_isPrinting = true; } 102cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void waitUntilDone(); 103cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block QString counterValueForElementById(const QString& id); 104d0825bca7fe65beaee391d30da42e937db621564Steve Block int webHistoryItemCount(); 105cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void keepWebHistory(); 106cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void notifyDone(); 107cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpBackForwardList() { m_dumpBackForwardList = true; } 1085e2bc6953fe6923165b8a5d7679939693a1d58d6Steve Block bool globalFlag() const { return m_globalFlag; } 1095e2bc6953fe6923165b8a5d7679939693a1d58d6Steve Block void setGlobalFlag(bool flag) { m_globalFlag = flag; } 110643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void handleErrorPages() { m_handleErrorPages = true; } 111cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpEditingCallbacks(); 1128a0914b749bbe7da7768e07a7db5c6d4bb09472bSteve Block void dumpFrameLoadCallbacks(); 113e14391e94c850b8bd03680c23b38978db68687a8John Reck void dumpUserGestureInFrameLoadCallbacks(); 114cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpResourceLoadCallbacks(); 115ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block void dumpResourceResponseMIMETypes(); 11668513a70bcd92384395513322f1b801e7bf9c729Steve Block void dumpHistoryCallbacks(); 11781bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight); 118dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setWillSendRequestReturnsNullOnRedirect(bool enabled); 119dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setWillSendRequestReturnsNull(bool enabled); 120dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setWillSendRequestClearHeader(const QStringList& headers); 121cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void queueBackNavigation(int howFarBackward); 122cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void queueForwardNavigation(int howFarForward); 123cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void queueLoad(const QString& url, const QString& target = QString()); 1242bde8e466a4451c7319e3a072d118917957d6554Steve Block void queueLoadHTMLString(const QString& content, const QString& baseURL = QString(), const QString& failingURL = QString()); 125cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void queueReload(); 126643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void queueLoadingScript(const QString& script); 127643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void queueNonLoadingScript(const QString& script); 128cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void provisionalLoad(); 129cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setCloseRemainingWindowsWhenComplete(bool = false) {} 130cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block int windowCount(); 131dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void grantDesktopNotificationPermission(const QString& origin); 1320617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen void ignoreDesktopNotificationPermissionRequests(); 133dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block bool checkDesktopNotificationPermission(const QString& origin); 13468513a70bcd92384395513322f1b801e7bf9c729Steve Block void simulateDesktopNotificationClick(const QString& title); 135d0825bca7fe65beaee391d30da42e937db621564Steve Block void display(); 136cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void clearBackForwardList(); 137643ca7872b450ea4efacab6188849e5aac2ba161Steve Block QString pathToLocalResource(const QString& url); 138cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpTitleChanges() { m_dumpTitleChanges = true; } 139cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block QString encodeHostName(const QString& host); 140cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block QString decodeHostName(const QString& host); 141cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dumpSelectionRect() const {} 142dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setDeveloperExtrasEnabled(bool); 143f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch void setAsynchronousSpellCheckingEnabled(bool); 144643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void showWebInspector(); 145692e5dbf12901edacf14812a6fae25462920af42Steve Block void closeWebInspector(); 146692e5dbf12901edacf14812a6fae25462920af42Steve Block void evaluateInWebInspector(long callId, const QString& script); 14768513a70bcd92384395513322f1b801e7bf9c729Steve Block void removeAllVisitedLinks(); 1488a0914b749bbe7da7768e07a7db5c6d4bb09472bSteve Block 149dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setMediaType(const QString& type); 150dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setFrameFlatteningEnabled(bool enable); 151643ca7872b450ea4efacab6188849e5aac2ba161Steve Block void setAllowUniversalAccessFromFileURLs(bool enable); 152692e5dbf12901edacf14812a6fae25462920af42Steve Block void setAllowFileAccessFromFileURLs(bool enable); 153dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setAppCacheMaximumSize(unsigned long long quota); 154cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setJavaScriptProfilingEnabled(bool enable); 155692e5dbf12901edacf14812a6fae25462920af42Steve Block void setTimelineProfilingEnabled(bool enable); 156cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setFixedContentsSize(int width, int height); 157cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setPrivateBrowsingEnabled(bool enable); 158dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setSpatialNavigationEnabled(bool enabled); 15921939df44de1705786c545cd1bf519d47250322dBen Murdoch void setPluginsEnabled(bool flag); 160cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setPopupBlockingEnabled(bool enable); 161cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setPOSIXLocale(const QString& locale); 162d0825bca7fe65beaee391d30da42e937db621564Steve Block void resetLoadFinished() { m_loadFinished = false; } 163d0825bca7fe65beaee391d30da42e937db621564Steve Block void setWindowIsKey(bool isKey); 164d0825bca7fe65beaee391d30da42e937db621564Steve Block void setMainFrameIsFirstResponder(bool isFirst); 165967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch void setDeferMainResourceDataLoad(bool); 16621939df44de1705786c545cd1bf519d47250322dBen Murdoch void setJavaScriptCanAccessClipboard(bool enable); 167d0825bca7fe65beaee391d30da42e937db621564Steve Block void setXSSAuditorEnabled(bool enable); 168dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setCaretBrowsingEnabled(bool enable); 169dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setViewModeMediaFeature(const QString& mode); 170dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setSmartInsertDeleteEnabled(bool enable); 171dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setSelectTrailingWhitespaceEnabled(bool enable); 172dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void execCommand(const QString& name, const QString& value = QString()); 173dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block bool isCommandEnabled(const QString& name) const; 174f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool findString(const QString& string, const QStringList& optionArray); 175cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 176cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId); 177cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId); 178643ca7872b450ea4efacab6188849e5aac2ba161Steve Block bool sampleSVGAnimationForElementAtTime(const QString& animationId, double time, const QString& elementId); 1796c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen bool elementDoesAutoCompleteForElementWithId(const QString& elementId); 180643ca7872b450ea4efacab6188849e5aac2ba161Steve Block 181cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block unsigned numberOfActiveAnimations() const; 182f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void suspendAnimations() const; 183f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick void resumeAnimations() const; 184cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 185dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); 186dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); 187cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 188cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void dispatchPendingLoadRequests(); 189cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void disableImageLoading(); 190cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 191dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch void clearAllApplicationCaches(); 1922bde8e466a4451c7319e3a072d118917957d6554Steve Block void clearApplicationCacheForOrigin(const QString& url); 193dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch void setApplicationCacheOriginQuota(unsigned long long quota); 1942bde8e466a4451c7319e3a072d118917957d6554Steve Block QStringList originsWithApplicationCache(); 195dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch 196cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void setDatabaseQuota(int size); 197cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void clearAllDatabases(); 1986c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen void setIconDatabaseEnabled(bool enable); 199cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 2002daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch void setCustomPolicyDelegate(bool enabled, bool permissive = false); 201cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void waitForPolicyDelegate(); 202ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block 203cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void overridePreference(const QString& name, const QVariant& value); 204d0825bca7fe65beaee391d30da42e937db621564Steve Block void setUserStyleSheetLocation(const QString& url); 205d0825bca7fe65beaee391d30da42e937db621564Steve Block void setUserStyleSheetEnabled(bool enabled); 206d0825bca7fe65beaee391d30da42e937db621564Steve Block void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme); 207d0825bca7fe65beaee391d30da42e937db621564Steve Block int workerThreadCount(); 2088a0914b749bbe7da7768e07a7db5c6d4bb09472bSteve Block int pageNumberForElementById(const QString& id, float width = 0, float height = 0); 209dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block int numberOfPages(float width = maxViewWidth, float height = maxViewHeight); 210dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block bool callShouldCloseOnWebView(); 211545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch // For now, this is a no-op. This may change depending on outcome of 212545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch // https://bugs.webkit.org/show_bug.cgi?id=33333 213545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch void setCallCloseOnWebViews() {} 21406ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen // This is a no-op - it allows us to pass 21506ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen // plugins/get-url-that-the-resource-load-delegate-will-disallow.html 21606ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen // which is a Mac-specific test. 21706ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen void addDisallowedURL(const QString&) {} 218545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch 219db14019a23d96bc8a444b6576a5da8bd1cfbc8b0Steve Block void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma); 220db14019a23d96bc8a444b6576a5da8bd1cfbc8b0Steve Block 221545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch void setMockGeolocationError(int code, const QString& message); 222545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch void setMockGeolocationPosition(double latitude, double longitude, double accuracy); 223545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch void setGeolocationPermission(bool allow); 2242bde8e466a4451c7319e3a072d118917957d6554Steve Block int numberOfPendingGeolocationPermissionRequests(); 225545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; } 226545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch bool geolocationPermission() const { return m_geolocationPermission; } 227dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block 2284576aa36e9a9671459299c7963ac95aa94beaea9Shimeng (Simon) Wang void addMockSpeechInputResult(const QString& result, double confidence, const QString& language); 229dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch 230ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block // Empty stub method to keep parity with object model exposed by global LayoutTestController. 231ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block void abortModal() {} 232a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch bool hasSpellingMarker(int from, int length); 233ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block 23428040489d744e0c5d475a88663056c9040ed5320Teng-Hui Zhu QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping); 23528040489d744e0c5d475a88663056c9040ed5320Teng-Hui Zhu 2362fc2651226baac27029e38c9d6ef883fa32084dbSteve Block void addURLToRedirect(const QString& origin, const QString& destination); 2372fc2651226baac27029e38c9d6ef883fa32084dbSteve Block 238dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block /* 239dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block Policy values: 'on', 'auto' or 'off'. 240dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block Orientation values: 'vertical' or 'horizontal'. 241dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block */ 242dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void setScrollbarPolicy(const QString& orientation, const QString& policy); 243dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block 244dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block QString markerTextForListItem(const QWebElement& listItem); 2456c2af9490927c3c5959b5cb07461b646f8b32f6cKristian Monsen QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element) const; 246dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block 247dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block // Simulate a request an embedding application could make, populating per-session credential storage. 248dcc8cf2e65d1aa555cce12431a16547e66b469eeSteve Block void authenticateSession(const QString& url, const QString& username, const QString& password); 249cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 250e78cbe89e6f337f2f1fe40315be88f742b547151Steve Block void setEditingBehavior(const QString& editingBehavior); 251e78cbe89e6f337f2f1fe40315be88f742b547151Steve Block 2522daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch QVariant shadowRoot(const QWebElement&); 2532daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch 25406ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen void evaluateScriptInIsolatedWorld(int worldID, const QString& script); 255e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke bool isPageBoxVisible(int pageIndex); 256e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke QString pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft); 257e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke QString pageProperty(const QString& propertyName, int pageNumber); 258e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke void addUserStyleSheet(const QString& sourceCode); 25906ea8e899e48f1f2f396b70e63fae369f2f23232Kristian Monsen 26081bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch void setMinimumTimerInterval(double); 2612bde8e466a4451c7319e3a072d118917957d6554Steve Block 2622bde8e466a4451c7319e3a072d118917957d6554Steve Block void originsWithLocalStorage(); 2632bde8e466a4451c7319e3a072d118917957d6554Steve Block void deleteAllLocalStorage(); 2642bde8e466a4451c7319e3a072d118917957d6554Steve Block void deleteLocalStorageForOrigin(const QString& originIdentifier); 2652bde8e466a4451c7319e3a072d118917957d6554Steve Block void observeStorageTrackerNotifications(unsigned number); 2662bde8e466a4451c7319e3a072d118917957d6554Steve Block void syncLocalStorage(); 26781bc750723a18f21cd17d1b173cd2a4dda9cea6eBen Murdoch 268cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockprivate slots: 269cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block void processWork(); 270cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 271cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockprivate: 2725ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen void setGeolocationPermissionCommon(bool allow); 2735ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsen 2745ddde30071f639962dd557c453f2ad01f8f0fd00Kristian Monsenprivate: 275d0825bca7fe65beaee391d30da42e937db621564Steve Block bool m_hasDumped; 276cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_textDump; 277cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_dumpBackForwardList; 278cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_dumpChildrenAsText; 279ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block bool m_dumpChildFrameScrollPositions; 280cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_canOpenWindows; 281cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_waitForDone; 282cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_dumpTitleChanges; 283cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_dumpDatabaseCallbacks; 284f05b935882198ccf7d81675736e3aeb089c5113aBen Murdoch bool m_dumpApplicationCacheDelegateCallbacks; 285cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_dumpStatusCallbacks; 286cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block bool m_waitForPolicy; 287643ca7872b450ea4efacab6188849e5aac2ba161Steve Block bool m_handleErrorPages; 288d0825bca7fe65beaee391d30da42e937db621564Steve Block bool m_loadFinished; 2895e2bc6953fe6923165b8a5d7679939693a1d58d6Steve Block bool m_globalFlag; 290ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24Steve Block bool m_userStyleSheetEnabled; 291545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch bool m_isGeolocationPermissionSet; 2926b70adc33054f8aee8c54d0f460458a9df11b8a5Russell Brenner bool m_isPrinting; 293545e470e52f0ac6a3a072bf559c796b42c6066b6Ben Murdoch bool m_geolocationPermission; 294cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 295d0825bca7fe65beaee391d30da42e937db621564Steve Block QUrl m_userStyleSheetLocation; 296cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block QBasicTimer m_timeoutTimer; 297cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block QWebFrame* m_topLoadingFrame; 298cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block WebCore::DumpRenderTree* m_drt; 299d0825bca7fe65beaee391d30da42e937db621564Steve Block QWebHistory* m_webHistory; 3005af96e2c7b73ebc627c6894727826a7576d31758Leon Clarke QStringList m_desktopNotificationAllowedOrigins; 3010617145a89917ae7735fe1c9538688ab9a577df5Kristian Monsen bool m_ignoreDesktopNotification; 302cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block}; 303cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block 304cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#endif // LayoutTestControllerQt_h 305