[Qt][WK2] http/tests/navigation/https-in-page-cache.html fails with timeout
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2012 09:39:10 +0000 (09:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 May 2012 09:39:10 +0000 (09:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83576

Patch by Michael Brüning <michael.bruning@nokia.com> on 2012-05-15
Reviewed by Simon Hausmann.

Source/WebKit2:

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebViewPrivate::handleCertificateVerificationRequest):
(QQuickWebView::allowAnyHTTPSCertificateForLocalHost): Added.
(QQuickWebView::setAllowAnyHTTPSCertificateForLocalHost): Added.
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):  Added bool m_allowAnyHTTPSCertificateForLocalHost.

Tools:

Set the PlatformWebView for the Qt port to accept all SSL certificates.

* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView):

LayoutTests:

Unskipped http/tests/navgiation/https-in-page-cache.html

* platform/qt-5.0-wk2/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/qt-5.0-wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Tools/ChangeLog
Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp

index 4d5da06..08e2555 100644 (file)
@@ -1,3 +1,14 @@
+2012-05-15  Michael Brüning  <michael.bruning@nokia.com>
+
+        [Qt][WK2] http/tests/navigation/https-in-page-cache.html fails with timeout
+        https://bugs.webkit.org/show_bug.cgi?id=83576
+
+        Reviewed by Simon Hausmann.
+
+        Unskipped http/tests/navgiation/https-in-page-cache.html
+
+        * platform/qt-5.0-wk2/Skipped:
+
 2012-05-15  Zan Dobersek  <zandobersek@gmail.com>
 
         Unreviewed, GTK gardening after r116986, r117012 and r117016.
index 889d898..d368a26 100644 (file)
@@ -324,8 +324,8 @@ css3/unicode-bidi-isolate-aharon-failing.html
 # https://bugs.webkit.org/show_bug.cgi?id=74504
 fast/dom/rtl-scroll-to-leftmost-and-resize.html
 
-#[Qt][WK2]REGRESSION(r110699): It made fast/animation/request-animation-frame-during-modal.html timeout
-#https://bugs.webkit.org/show_bug.cgi?id=81671
+# [Qt][WK2]REGRESSION(r110699): It made fast/animation/request-animation-frame-during-modal.html timeout
+# https://bugs.webkit.org/show_bug.cgi?id=81671
 fast/animation/request-animation-frame-during-modal.html
 
 # flakey svg tests
@@ -574,10 +574,6 @@ plugins
 # https://bugs.webkit.org/show_bug.cgi?id=83575
 fast/frames/iframe-window-focus.html
 
-# [Qt][WK2] http/tests/navigation/https-in-page-cache.html fails with timeout
-# https://bugs.webkit.org/show_bug.cgi?id=83576
-http/tests/navigation/https-in-page-cache.html
-
 # [Qt][WK2] fast/loader/create-frame-in-DOMContentLoaded.html crashes
 # https://bugs.webkit.org/show_bug.cgi?id=83578
 fast/loader/create-frame-in-DOMContentLoaded.html
index 0806acc..2bff1fb 100644 (file)
@@ -1,3 +1,19 @@
+2012-05-15  Michael Brüning  <michael.bruning@nokia.com>
+
+        [Qt][WK2] http/tests/navigation/https-in-page-cache.html fails with timeout
+        https://bugs.webkit.org/show_bug.cgi?id=83576
+
+        Reviewed by Simon Hausmann.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::QQuickWebViewPrivate):
+        (QQuickWebViewPrivate::handleCertificateVerificationRequest):
+        (QQuickWebView::allowAnyHTTPSCertificateForLocalHost): Added.
+        (QQuickWebView::setAllowAnyHTTPSCertificateForLocalHost): Added.
+        * UIProcess/API/qt/qquickwebview_p.h:
+        * UIProcess/API/qt/qquickwebview_p_p.h:
+        (QQuickWebViewPrivate):  Added bool m_allowAnyHTTPSCertificateForLocalHost.
+
 2012-05-14  Shinya Kawanaka  <shinyak@chromium.org>
 
         document.execCommand('Indent') in the direct child of ShadowRoot causes a crash.
index 7ec02ba..7163a7e 100644 (file)
@@ -266,6 +266,7 @@ QQuickWebViewPrivate::QQuickWebViewPrivate(QQuickWebView* viewport)
     , m_navigatorQtObjectEnabled(false)
     , m_renderToOffscreenBuffer(false)
     , m_dialogActive(false)
+    , m_allowAnyHTTPSCertificateForLocalHost(false)
     , m_loadProgress(0)
 {
     viewport->setClip(true);
@@ -559,6 +560,11 @@ void QQuickWebViewPrivate::handleProxyAuthenticationRequiredRequest(const QStrin
 bool QQuickWebViewPrivate::handleCertificateVerificationRequest(const QString& hostname)
 {
     Q_Q(QQuickWebView);
+
+    if (m_allowAnyHTTPSCertificateForLocalHost
+        && (hostname == QStringLiteral("127.0.0.1") || hostname == QStringLiteral("localhost")))
+        return true;
+
     QtDialogRunner dialogRunner(q);
     if (!dialogRunner.initForCertificateVerification(hostname))
         return false;
@@ -1859,4 +1865,17 @@ void QQuickWebView::runJavaScriptInMainFrame(const QString &script, QObject *rec
     d->webPageProxy.get()->runJavaScriptInMainFrame(script, ScriptValueCallback::create(closure, javaScriptCallback));
 }
 
+bool QQuickWebView::allowAnyHTTPSCertificateForLocalHost() const
+{
+    Q_D(const QQuickWebView);
+    return d->m_allowAnyHTTPSCertificateForLocalHost;
+}
+
+void QQuickWebView::setAllowAnyHTTPSCertificateForLocalHost(bool allow)
+{
+    Q_D(QQuickWebView);
+    d->m_allowAnyHTTPSCertificateForLocalHost = allow;
+}
+
+
 #include "moc_qquickwebview_p.cpp"
index 4bdd0fb..7bd45b6 100644 (file)
@@ -149,6 +149,9 @@ public:
     qreal zoomFactor() const;
     void setZoomFactor(qreal);
     void runJavaScriptInMainFrame(const QString& script, QObject* receiver, const char* method);
+    // Used to automatically accept the HTTPS certificate in WTR. No other use intended.
+    bool allowAnyHTTPSCertificateForLocalHost() const;
+    void setAllowAnyHTTPSCertificateForLocalHost(bool allow);
 
 public Q_SLOTS:
     void loadHtml(const QString& html, const QUrl& baseUrl = QUrl());
index b73df1d..d3beca4 100644 (file)
@@ -198,6 +198,7 @@ protected:
     bool m_navigatorQtObjectEnabled;
     bool m_renderToOffscreenBuffer;
     bool m_dialogActive;
+    bool m_allowAnyHTTPSCertificateForLocalHost;
     QUrl m_iconURL;
     int m_loadProgress;
 };
index 8c285a3..8b124d8 100644 (file)
@@ -1,3 +1,15 @@
+2012-05-15  Michael Brüning  <michael.bruning@nokia.com>
+
+        [Qt][WK2] http/tests/navigation/https-in-page-cache.html fails with timeout
+        https://bugs.webkit.org/show_bug.cgi?id=83576
+
+        Reviewed by Simon Hausmann.
+
+        Set the PlatformWebView for the Qt port to accept all SSL certificates.
+
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+
 2012-05-14  Luke Macpherson  <macpherson@chromium.org>
 
         Introduce ENABLE_CSS_VARIABLES compile flag.
index f65ff19..0211df5 100644 (file)
@@ -76,6 +76,7 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
 {
     QQuickWebViewExperimental experimental(m_view);
     experimental.setRenderToOffscreenBuffer(true);
+    m_view->setAllowAnyHTTPSCertificateForLocalHost(true);
 }
 
 PlatformWebView::~PlatformWebView()