diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-04-07 14:00:35 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-15 17:03:28 +0200 |
commit | 84ced937a0f9f2874e32e16c4c6ebf72b46904c9 (patch) | |
tree | d78373210638476d0e0ee67e398dca7a1630544b /tests/auto/widgets | |
parent | fc55f57e6cbbcd0027493d0bbea8161a814aaff2 (diff) |
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 <michael.bruning@digia.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp | 5 | ||||
-rw-r--r-- | tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 4 |
2 files changed, 5 insertions, 4 deletions
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("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>"); 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); } }; |