Skip to content
Permalink
Browse files
2010-05-17 Robert Hogan <robert@webkit.org>
        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Disable Icon Database by default in Qt DRT

        Unskip:
         http/tests/misc/favicon-loads-with-images-disabled.html
         http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
         http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
         http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html

        Qt returns 5 (QNetworkReply::OperationCanceledError) instead of -999 for the XFrameOptions tests,
        so update accordingly.

        https://bugs.webkit.org/show_bug.cgi?id=37382

        * platform/qt/Skipped:
        * platform/qt/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: Added. Qt returns 5 instead of -999.
        * platform/qt/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: Added. Qt returns 5 instead of -999.
        * platform/qt/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: Added. Qt returns 5 instead of -999.
2010-05-17  Robert Hogan  <robert@webkit.org>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Disable Icon Database by default in Qt DRT

        Unskip:
         http/tests/misc/favicon-loads-with-images-disabled.html
         http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
         http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
         http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html

        https://bugs.webkit.org/show_bug.cgi?id=37382

        Add support for layoutTestController.setIconDatabaseEnabled and layoutTestController.disableImageLoading().
        The XFrameOptions tests were failing because of an extra resource load callback for favicon.ico requests.
        These extra callbacks are removed by supporting both of the above layoutTestContoller commands.

        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
        (WebCore::WebPage::resetSettings):
        (WebCore::DumpRenderTree::DumpRenderTree):
        * DumpRenderTree/qt/DumpRenderTreeQt.h:
        (WebCore::DumpRenderTree::drtStoragePath):
        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::reset):
        (LayoutTestController::disableImageLoading):
        (LayoutTestController::setIconDatabaseEnabled):
        * DumpRenderTree/qt/LayoutTestControllerQt.h:

Canonical link: https://commits.webkit.org/50759@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@59623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Robert Hogan committed May 17, 2010
1 parent 4148651 commit f48c9eb8152c37e1f0ccd710eacb0f246fb2796b
Showing 10 changed files with 115 additions and 16 deletions.
@@ -1,3 +1,25 @@
2010-05-17 Robert Hogan <robert@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Disable Icon Database by default in Qt DRT

Unskip:
http/tests/misc/favicon-loads-with-images-disabled.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html

Qt returns 5 (QNetworkReply::OperationCanceledError) instead of -999 for the XFrameOptions tests,
so update accordingly.

https://bugs.webkit.org/show_bug.cgi?id=37382

* platform/qt/Skipped:
* platform/qt/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: Added. Qt returns 5 instead of -999.
* platform/qt/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: Added. Qt returns 5 instead of -999.
* platform/qt/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: Added. Qt returns 5 instead of -999.

2010-05-17 David Hyatt <hyatt@apple.com>

Reviewed by Dan Bernstein.
@@ -275,9 +275,6 @@ http/tests/xmlhttprequest/access-control-basic-allow-preflight-cache-timeout.htm
http/tests/xmlhttprequest/default-content-type-dashboard.html
http/tests/xmlhttprequest/svg-created-by-xhr-disallowed-in-dashboard.html

# Missing layoutTestController.setIconDatabaseEnabled()
http/tests/misc/favicon-loads-with-images-disabled.html

# Missing layoutTestController.setCustomPolicyDelegate()
fast/loader/onload-policy-ignore-for-frame.html
http/tests/misc/policy-delegate-called-twice.html
@@ -4751,12 +4748,6 @@ http/tests/misc/refresh-headers.php
http/tests/misc/timer-vs-loading.html


# Have an additional line in results for GET of favicon.ico. Probably innocuous.
# https://bugs.webkit.org/show_bug.cgi?id=37382
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html

# Skip failing http/tests/security tests
http/tests/security/cross-frame-access-callback-explicit-domain-ALLOW.html
http/tests/security/cross-frame-access-put.html
@@ -0,0 +1,16 @@
http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag.html, http method GET> redirectResponse (null)
<unknown> - didFinishLoading
http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html, http status code 200>
http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code 5, failing URL "http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html">
CONSOLE MESSAGE: line 1: Refused to display document because display forbidden by X-Frame-Options.

about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag.html, http method GET> redirectResponse (null)
about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
There should be no content in the iframe below



--------
Frame: '<!--framePath //<!--frame0-->-->'
--------

@@ -0,0 +1,16 @@
http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html, http method GET> redirectResponse (null)
<unknown> - didFinishLoading
http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html, http status code 200>
http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code 5, failing URL "http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html">
CONSOLE MESSAGE: line 1: Refused to display document because display forbidden by X-Frame-Options.

about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html, http method GET> redirectResponse (null)
about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
There should be no content in the iframe below



--------
Frame: '<!--framePath //<!--frame0-->-->'
--------

@@ -0,0 +1,16 @@
http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html - willSendRequest <NSURLRequest URL http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html, http method GET> redirectResponse (null)
<unknown> - didFinishLoading
http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html - didReceiveResponse <NSURLResponse http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html, http status code 200>
http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html - didFailLoadingWithError: <NSError domain NSURLErrorDomain, code 5, failing URL "http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html">
CONSOLE MESSAGE: line 1: Refused to display document because display forbidden by X-Frame-Options.

about:blank - willSendRequest <NSURLRequest URL about:blank, main document URL http://127.0.0.1:8000/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html, http method GET> redirectResponse (null)
about:blank - didReceiveResponse <NSURLResponse about:blank, http status code 0>
There should be no content in the iframe below



--------
Frame: '<!--framePath //<!--frame0-->-->'
--------

@@ -1,3 +1,32 @@
2010-05-17 Robert Hogan <robert@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Disable Icon Database by default in Qt DRT

Unskip:
http/tests/misc/favicon-loads-with-images-disabled.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html

https://bugs.webkit.org/show_bug.cgi?id=37382

Add support for layoutTestController.setIconDatabaseEnabled and layoutTestController.disableImageLoading().
The XFrameOptions tests were failing because of an extra resource load callback for favicon.ico requests.
These extra callbacks are removed by supporting both of the above layoutTestContoller commands.

* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::WebPage::resetSettings):
(WebCore::DumpRenderTree::DumpRenderTree):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(WebCore::DumpRenderTree::drtStoragePath):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::reset):
(LayoutTestController::disableImageLoading):
(LayoutTestController::setIconDatabaseEnabled):
* DumpRenderTree/qt/LayoutTestControllerQt.h:

2010-05-17 Fumitoshi Ukai <ukai@chromium.org>

Reviewed by Eric Seidel.
@@ -188,6 +188,7 @@ void WebPage::resetSettings()
settings()->resetAttribute(QWebSettings::LocalContentCanAccessRemoteUrls);
settings()->resetAttribute(QWebSettings::PluginsEnabled);
settings()->resetAttribute(QWebSettings::JavaScriptCanAccessClipboard);
settings()->resetAttribute(QWebSettings::AutoLoadImages);

m_drt->layoutTestController()->setCaretBrowsingEnabled(false);
m_drt->layoutTestController()->setFrameFlatteningEnabled(false);
@@ -339,14 +340,11 @@ DumpRenderTree::DumpRenderTree()
, m_stdin(0)
, m_enableTextOutput(false)
, m_singleFileMode(false)
, m_persistentStoragePath(QString(getenv("DUMPRENDERTREE_TEMP")))
{
DumpRenderTreeSupportQt::overwritePluginDirectories();

char* dumpRenderTreeTemp = getenv("DUMPRENDERTREE_TEMP");
if (dumpRenderTreeTemp)
QWebSettings::enablePersistentStorage(QString(dumpRenderTreeTemp));
else
QWebSettings::enablePersistentStorage();
QWebSettings::enablePersistentStorage(m_persistentStoragePath);

// create our primary testing page/view.
m_mainView = new QWebView(0);
@@ -86,6 +86,7 @@ Q_OBJECT
LayoutTestController *layoutTestController() const { return m_controller; }
EventSender *eventSender() const { return m_eventSender; }
TextInputController *textInputController() const { return m_textInputController; }
QString persistentStoragePath() const { return m_persistentStoragePath; }

QWebPage *createWindow();
int windowCount() const;
@@ -141,6 +142,7 @@ private Q_SLOTS:
QList<QObject*> windows;
bool m_enableTextOutput;
bool m_singleFileMode;
QString m_persistentStoragePath;
};

class NetworkAccessManager : public QNetworkAccessManager {
@@ -70,6 +70,7 @@ void LayoutTestController::reset()
DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(false);
DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(false);
DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList());
setIconDatabaseEnabled(false);
emit hidePage();
}

@@ -456,8 +457,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const

void LayoutTestController::disableImageLoading()
{
// FIXME: Implement for testing fix for https://bugs.webkit.org/show_bug.cgi?id=27896
// Also need to make sure image loading is re-enabled for each new test.
m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
}

void LayoutTestController::dispatchPendingLoadRequests()
@@ -630,5 +630,13 @@ void LayoutTestController::authenticateSession(const QString&, const QString&, c
// FIXME: If there is a concept per-session (per-process) credential storage, the credentials should be added to it for later use.
}

void LayoutTestController::setIconDatabaseEnabled(bool enable)
{
if (enable && !m_drt->persistentStoragePath().isEmpty())
QWebSettings::setIconDatabasePath(m_drt->persistentStoragePath());
else
QWebSettings::setIconDatabasePath(QString());
}

const unsigned LayoutTestController::maxViewWidth = 800;
const unsigned LayoutTestController::maxViewHeight = 600;
@@ -169,6 +169,7 @@ public slots:

void setDatabaseQuota(int size);
void clearAllDatabases();
void setIconDatabaseEnabled(bool enable);

void waitForPolicyDelegate();
void overridePreference(const QString& name, const QVariant& value);

0 comments on commit f48c9eb

Please sign in to comment.