summaryrefslogtreecommitdiff
path: root/Source/WebKit/qt
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2017-04-21 06:12:49 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-04-22 08:43:17 +0000
commitbd3f57b00bee3088971209a0ebc513eb1ef4ba14 (patch)
tree651d181d7348d440ff164909e8480297e4e7f18e /Source/WebKit/qt
parent3b7091813e38631b9ca03ce9657c170ee8826439 (diff)
downloadqtwebkit-bd3f57b00bee3088971209a0ebc513eb1ef4ba14.tar.gz
Import WebKit commit 584c4a7a6a8bffb60f03b9eb10a65dbcf41dc0b7
Change-Id: Ife943bbbd8226afa05ef6320b10ba351d55fd797 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit/qt')
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp17
-rw-r--r--Source/WebKit/qt/tests/CMakeLists.txt2
-rw-r--r--Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp14
-rw-r--r--Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp4
4 files changed, 19 insertions, 18 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 76038cbc0..50f91e203 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -565,9 +565,8 @@ void FrameLoaderClientQt::finishedLoading(DocumentLoader*)
{
if (!m_pluginView)
return;
- if (m_pluginView->isPluginView())
- m_pluginView->didFinishLoading();
- m_pluginView = 0;
+ m_pluginView->didFinishLoading();
+ m_pluginView = nullptr;
m_hasSentResponseToPlugin = false;
}
@@ -803,8 +802,7 @@ void FrameLoaderClientQt::setMainDocumentError(WebCore::DocumentLoader* loader,
{
if (!m_pluginView)
return;
- if (m_pluginView->isPluginView())
- m_pluginView->didFail(error);
+ m_pluginView->didFail(error);
m_pluginView = 0;
m_hasSentResponseToPlugin = false;
}
@@ -820,7 +818,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c
loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response()));
// We re-check here as the plugin can have been created.
- if (m_pluginView && m_pluginView->isPluginView()) {
+ if (m_pluginView) {
if (!m_hasSentResponseToPlugin) {
m_pluginView->didReceiveResponse(loader->response());
// The function didReceiveResponse sets up a new stream to the plug-in.
@@ -1496,9 +1494,12 @@ RefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTML
void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
{
+ if (!pluginWidget || !pluginWidget->isPluginView()) {
+ m_pluginView = nullptr;
+ return;
+ }
m_pluginView = toPluginView(pluginWidget);
- if (pluginWidget)
- m_hasSentResponseToPlugin = false;
+ m_hasSentResponseToPlugin = false;
}
PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize& pluginSize, HTMLAppletElement* element, const URL& url, const Vector<String>& paramNames, const Vector<String>& paramValues)
diff --git a/Source/WebKit/qt/tests/CMakeLists.txt b/Source/WebKit/qt/tests/CMakeLists.txt
index 685896bfe..2691196b3 100644
--- a/Source/WebKit/qt/tests/CMakeLists.txt
+++ b/Source/WebKit/qt/tests/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+remove_definitions(-DQT_ASCII_CAST_WARNINGS)
include_directories(
"${CMAKE_SOURCE_DIR}/Source"
diff --git a/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 9d6425ad6..17488ebb9 100644
--- a/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/Source/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -126,7 +126,7 @@ void tst_QWebHistory::count()
void tst_QWebHistory::back()
{
for (int i = histsize;i > 1;i--) {
- QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(i));
+ QCOMPARE(page->mainFrame()->toPlainText(), QStringLiteral("page%1").arg(i));
hist->back();
loadFinishedBarrier->ensureSignalEmitted();
}
@@ -147,13 +147,13 @@ void tst_QWebHistory::forward()
}
for (int i = 1;i < histsize;i++) {
- QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(i));
+ QCOMPARE(page->mainFrame()->toPlainText(), QStringLiteral("page%1").arg(i));
hist->forward();
loadFinishedBarrier->ensureSignalEmitted();
}
//try one more time (too many). crash test
hist->forward();
- QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(histsize));
+ QCOMPARE(page->mainFrame()->toPlainText(), QStringLiteral("page%1").arg(histsize));
}
/**
@@ -162,7 +162,7 @@ void tst_QWebHistory::forward()
void tst_QWebHistory::itemAt()
{
for (int i = 1;i < histsize;i++) {
- QCOMPARE(hist->itemAt(i - 1).title(), QString("page") + QString::number(i));
+ QCOMPARE(hist->itemAt(i - 1).title(), QStringLiteral("page%1").arg(i));
QVERIFY(hist->itemAt(i - 1).isValid());
}
//check out of range values
@@ -197,7 +197,7 @@ void tst_QWebHistory::items()
//check order
for (int i = 1;i <= histsize;i++) {
- QCOMPARE(items.at(i - 1).title(), QString("page") + QString::number(i));
+ QCOMPARE(items.at(i - 1).title(), QStringLiteral("page%1").arg(i));
}
}
@@ -226,7 +226,7 @@ void tst_QWebHistory::serialize_1()
//check order of historyItems
QList<QWebHistoryItem> items = hist->items();
for (int i = 1;i <= histsize;i++) {
- QCOMPARE(items.at(i - 1).title(), QString("page") + QString::number(i));
+ QCOMPARE(items.at(i - 1).title(), QStringLiteral("page%1").arg(i));
}
}
@@ -241,7 +241,7 @@ void tst_QWebHistory::serialize_2()
QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded
// Force a "same document" navigation.
- frame->load(frame->url().toString() + QLatin1String("#dummyAnchor"));
+ frame->load(QUrl(frame->url().toString() + QLatin1String("#dummyAnchor")));
int initialCurrentIndex = hist->currentItemIndex();
diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 67fe242f9..e545c5c0f 100644
--- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -596,8 +596,8 @@ void tst_QWebPage::userStyleSheet()
TestNetworkManager* networkManager = new TestNetworkManager(m_page);
m_page->setNetworkAccessManager(networkManager);
- m_page->settings()->setUserStyleSheetUrl(QUrl("data:text/css;charset=utf-8;base64,"
- + QByteArray("p { background-image: url('http://does.not/exist.png');}").toBase64()));
+ m_page->settings()->setUserStyleSheetUrl(QUrl(QString::fromLatin1("data:text/css;charset=utf-8;base64,"
+ + QByteArray("p { background-image: url('http://does.not/exist.png');}").toBase64())));
m_view->setHtml("<p>hello world</p>");
QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));