From 84ced937a0f9f2874e32e16c4c6ebf72b46904c9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 7 Apr 2014 14:00:35 +0200 Subject: Replace uses of QWebEngineFrame with a security origin URL This changes implemented methods. The rest of the references will go away with the public headers cleanup. Change-Id: I82340cd7a4488c4b463489ae98cd9c16de4e7487 Reviewed-by: Michael Bruning --- tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp | 5 +++-- tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp index 5e1113765..55b30459f 100644 --- a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp +++ b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp @@ -547,9 +547,10 @@ public: int alerts; protected: - virtual void javaScriptAlert(QWebEngineFrame*, const QString& msg) + virtual void javaScriptAlert(const QUrl &securityOrigin, const QString &msg) { alerts++; + QCOMPARE(securityOrigin, QUrl(QStringLiteral("http://test.origin.com/"))); QCOMPARE(msg, QString("foo")); } }; @@ -558,7 +559,7 @@ void tst_QWebEngineFrame::setHtmlWithJSAlert() { QString html("

hello world

"); MyPage page; - page.setHtml(html); + page.setHtml(html, QUrl(QStringLiteral("http://test.origin.com/path#fragment"))); waitForSignal(&page, SIGNAL(loadFinished(bool))); QCOMPARE(page.alerts, 1); QCOMPARE(toHtmlSync(&page), html); diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 3c2bbb67b..edfe2153b 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -3092,7 +3092,7 @@ public: JSPromptPage() {} - bool javaScriptPrompt(QWebEngineFrame* frame, const QString& msg, const QString& defaultValue, QString* result) + bool javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result) { if (msg == QLatin1String("test1")) { *result = QString(); @@ -3109,7 +3109,7 @@ public: } qFatal("Unknown msg."); - return QWebEnginePage::javaScriptPrompt(frame, msg, defaultValue, result); + return QWebEnginePage::javaScriptPrompt(securityOrigin, msg, defaultValue, result); } }; -- cgit v1.2.3