123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585 |
- /*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2012 Sony Computer Entertainment Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- #include "config.h"
- #include "LayoutTestController.h"
- #include "DumpRenderTree.h"
- #include "NotImplemented.h"
- #include "WebCoreSupport/DumpRenderTreeSupportManx.h"
- #include "WorkQueue.h"
- #include "WorkQueueItem.h"
- #include <JavaScriptCore/JSRetainPtr.h>
- #include <JavaScriptCore/JavaScriptCore.h>
- #include <string>
- #include <wtf/Assertions.h>
- #include <wtf/Platform.h>
- #include <wtf/RetainPtr.h>
- #include <wtf/Vector.h>
- using namespace std;
- LayoutTestController::~LayoutTestController()
- {
- }
- void LayoutTestController::addDisallowedURL(JSStringRef url)
- {
- notImplemented();
- }
- void LayoutTestController::clearBackForwardList()
- {
- }
- bool LayoutTestController::callShouldCloseOnWebView()
- {
- return false;
- }
- JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
- {
- return 0;
- }
- JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
- {
- return 0;
- }
- void LayoutTestController::disableImageLoading()
- {
- }
- void LayoutTestController::dispatchPendingLoadRequests()
- {
- }
- void LayoutTestController::display()
- {
- }
- void LayoutTestController::keepWebHistory()
- {
- }
- JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
- {
- return JSValueMakeUndefined(context);
- }
- JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
- {
- return 0;
- }
- JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
- {
- return 0;
- }
- void LayoutTestController::waitForPolicyDelegate()
- {
- waitForPolicy = true;
- setWaitToDump(true);
- }
- size_t LayoutTestController::webHistoryItemCount()
- {
- return 0;
- }
- unsigned LayoutTestController::workerThreadCount() const
- {
- return 0;
- }
- void LayoutTestController::notifyDone()
- {
- if (m_waitToDump)
- dump();
- m_waitToDump = false;
- waitForPolicy = false;
- }
- JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
- {
- return JSStringCreateWithCharacters(JSChar(), 0);
- }
- void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
- {
- }
- void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
- {
- }
- void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
- {
- }
- void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
- {
- }
- void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
- {
- }
- void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
- {
- }
- void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
- {
- }
- void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
- {
- }
- void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
- {
- }
- void LayoutTestController::setGeolocationPermission(bool allow)
- {
- }
- int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
- {
- return -1;
- }
- void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
- {
- }
- void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
- {
- }
- void LayoutTestController::startSpeechInput(JSContextRef inputElement)
- {
- }
- void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
- {
- }
- void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
- {
- }
- void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
- {
- }
- void LayoutTestController::setXSSAuditorEnabled(bool enabled)
- {
- }
- void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
- {
- }
- void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
- {
- }
- void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
- {
- }
- void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
- {
- }
- void LayoutTestController::setPopupBlockingEnabled(bool enabled)
- {
- }
- void LayoutTestController::setPluginsEnabled(bool flag)
- {
- }
- void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
- {
- }
- void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle)
- {
- }
- void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
- {
- }
- void LayoutTestController::setUserStyleSheetEnabled(bool flag)
- {
- }
- void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL)
- {
- }
- void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
- {
- }
- void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
- {
- }
- void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
- {
- }
- void LayoutTestController::clearPersistentUserStyleSheet()
- {
- }
- void LayoutTestController::setWindowIsKey(bool flag)
- {
- }
- void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
- {
- }
- void LayoutTestController::setJavaScriptProfilingEnabled(bool flag)
- {
- }
- void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
- {
- }
- static bool waitToDumpWatchdogFired()
- {
- setWaitToDumpWatchdog(0);
- gLayoutTestController->waitToDumpWatchdogTimerFired();
- return FALSE;
- }
- void LayoutTestController::setWaitToDump(bool waitUntilDone)
- {
- static const int timeoutSeconds = 3;
- m_waitToDump = waitUntilDone;
- if (m_waitToDump && shouldSetWaitToDumpWatchdog()) {
- sceKernelDelayThread(timeoutSeconds * 1000 *1000);
- waitToDumpWatchdogFired();
- setWaitToDumpWatchdog(1);
- }
- }
- int LayoutTestController::windowCount()
- {
- return 1;
- }
- bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
- {
- return false;
- }
- void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
- {
- }
- bool LayoutTestController::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */)
- {
- return false;
- }
- void LayoutTestController::setCacheModel(int)
- {
- }
- bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
- {
- return false;
- }
- void LayoutTestController::clearAllApplicationCaches()
- {
- }
- void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef origin)
- {
- }
- void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
- {
- }
- JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
- {
- return JSValueMakeUndefined(context);
- }
- long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name)
- {
- // FIXME: Implement to get disk usage by all application caches for an origin.
- return 0;
- }
- void LayoutTestController::clearAllDatabases()
- {
- }
- void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
- {
- }
- void LayoutTestController::setDatabaseQuota(unsigned long long quota)
- {
- }
- void LayoutTestController::goBack()
- {
- }
- void LayoutTestController::setDefersLoading(bool)
- {
- }
- void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
- {
- }
- void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
- {
- }
- bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
- {
- return false;
- }
- bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
- {
- return false;
- }
- unsigned LayoutTestController::numberOfActiveAnimations() const
- {
- return 0;
- }
- void LayoutTestController::suspendAnimations() const
- {
- }
- void LayoutTestController::resumeAnimations() const
- {
- }
- void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
- {
- }
- void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
- {
- }
- void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
- {
- }
- void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
- {
- }
- void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
- {
- }
- void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
- {
- }
- void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
- {
- }
- void LayoutTestController::showWebInspector()
- {
- }
- void LayoutTestController::closeWebInspector()
- {
- }
- void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
- {
- }
- void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
- {
- }
- void LayoutTestController::removeAllVisitedLinks()
- {
- }
- JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id)
- {
- return JSRetainPtr<JSStringRef>();
- }
- int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels)
- {
- return 0;
- }
- int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
- {
- return 0;
- }
- JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
- {
- return JSRetainPtr<JSStringRef>();
- }
- void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
- {
- }
- bool LayoutTestController::isPageBoxVisible(int pageNumber) const
- {
- return false;
- }
- JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
- {
- return JSRetainPtr<JSStringRef>();
- }
- void LayoutTestController::apiTestGoToCurrentBackForwardItem()
- {
- }
- void LayoutTestController::setWebViewEditable(bool)
- {
- }
- void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
- {
- }
- void LayoutTestController::setEditingBehavior(const char* editingBehavior)
- {
- }
- void LayoutTestController::abortModal()
- {
- }
- void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/)
- {
- }
- void LayoutTestController::setSerializeHTTPLoads(bool)
- {
- }
- void LayoutTestController::syncLocalStorage()
- {
- }
- void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
- {
- }
- void LayoutTestController::deleteAllLocalStorage()
- {
- }
- JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
- {
- return JSValueMakeUndefined(context);
- }
- long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
- {
- return 0;
- }
- void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
- {
- }
- void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval)
- {
- }
- void LayoutTestController::setTextDirection(JSStringRef direction)
- {
- }
- void LayoutTestController::allowRoundingHacks()
- {
- }
- void LayoutTestController::addChromeInputField()
- {
- }
- void LayoutTestController::removeChromeInputField()
- {
- }
- void LayoutTestController::focusWebView()
- {
- }
- void LayoutTestController::setBackingScaleFactor(double)
- {
- }
- void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
- {
- }
- void LayoutTestController::setPageVisibility(const char* visibilityBuffer)
- {
- }
- void LayoutTestController::resetPageVisibility()
- {
- }
- void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
- {
- }
|