diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-16 14:57:44 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-16 14:57:44 +0100 |
commit | ef177a48f2c6c41549ef9d11a985ab2661942638 (patch) | |
tree | d6bc5aa8cbde95d9e9857ead4b509e8b04b524b9 /tests | |
parent | 396ca081d7b0d9dab7de14ebaec7943c3f857a24 (diff) | |
parent | e5bc5a6dbdd915e0b19cfc43e7af17e43c1a7878 (diff) |
Merge branch '5.12' into dev
Conflicts:
src/core/compositor/compositor.cpp
src/core/compositor/compositor.h
Change-Id: I8a4d73d728d93d95e499849f8778cc88dda2105e
Diffstat (limited to 'tests')
7 files changed, 47 insertions, 7 deletions
diff --git a/tests/auto/quick/qmltests/data/directoryupload.html b/tests/auto/quick/qmltests/data/directoryupload.html index 6a6e4580c..adc408ebb 100644 --- a/tests/auto/quick/qmltests/data/directoryupload.html +++ b/tests/auto/quick/qmltests/data/directoryupload.html @@ -1,9 +1,10 @@ <html> <head> -<meta name="viewport" initial-scale=1"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Directory Upload </title> <script src = "./titleupdate.js"> </script> +</head> <body> <input type="file" id="upfile" webkitdirectory="" directory="" onchange="updateTitle()"> diff --git a/tests/auto/quick/qmltests/data/favicon.html b/tests/auto/quick/qmltests/data/favicon.html index 7a81194e4..e1b84a9cc 100644 --- a/tests/auto/quick/qmltests/data/favicon.html +++ b/tests/auto/quick/qmltests/data/favicon.html @@ -1,7 +1,7 @@ <html> <head> -</head> <link type="image/png" href="icons/favicon.png" sizes="48x48" rel="icon" /> +</head> <body> <p>It's expected that you see a favicon displayed for this page when you open it as a local file.</p> <p>The favicon looks like this:</p> diff --git a/tests/auto/quick/qmltests/data/multifileupload.html b/tests/auto/quick/qmltests/data/multifileupload.html index cc87d8f41..1f788a377 100644 --- a/tests/auto/quick/qmltests/data/multifileupload.html +++ b/tests/auto/quick/qmltests/data/multifileupload.html @@ -1,9 +1,10 @@ <html> <head> -<meta name="viewport" initial-scale=1"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Mutli-file Upload </title> <script src = "./titleupdate.js"> </script> +</head> <body> <input type="file" name="file" id="upfile" onchange="updateTitle()" multiple/> diff --git a/tests/auto/quick/qmltests/data/singlefileupload.html b/tests/auto/quick/qmltests/data/singlefileupload.html index 8469aa128..6cfef7ade 100644 --- a/tests/auto/quick/qmltests/data/singlefileupload.html +++ b/tests/auto/quick/qmltests/data/singlefileupload.html @@ -1,9 +1,10 @@ <html> <head> -<meta name="viewport" initial-scale=1"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Single File Upload </title> <script src = "./titleupdate.js"> </script> +</head> <body> <input type="file" name="file" id="upfile" onchange="updateTitle()"/> diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html index 142b53668..afda71bc5 100644 --- a/tests/auto/quick/qmltests/data/test4.html +++ b/tests/auto/quick/qmltests/data/test4.html @@ -12,7 +12,7 @@ <meta name="viewport" content="initial-scale=2.0"/> </head> <body> - <button onclick="scrollWin()", id="scroll">Click me to scroll!</button><br><br> + <button onclick="scrollWin()" id="scroll">Click me to scroll!</button><br><br> <script> window.onload = function() { diff --git a/tests/auto/widgets/printing/tst_printing.cpp b/tests/auto/widgets/printing/tst_printing.cpp index 2fd12b8ec..380fb65ff 100644 --- a/tests/auto/widgets/printing/tst_printing.cpp +++ b/tests/auto/widgets/printing/tst_printing.cpp @@ -44,7 +44,7 @@ class tst_Printing : public QObject private slots: void printToPdfBasic(); void printRequest(); -#if QT_CONFIG(webengine_poppler_cpp) +#if QT_CONFIG(webengine_poppler_cpp) && defined(Q_OS_LINUX) && defined(__GLIBCXX__) void printToPdfPoppler(); #endif }; @@ -108,7 +108,7 @@ void tst_Printing::printRequest() QVERIFY(data.length() > 0); } -#if QT_CONFIG(webengine_poppler_cpp) +#if QT_CONFIG(webengine_poppler_cpp) && defined(Q_OS_LINUX) && defined(__GLIBCXX__) void tst_Printing::printToPdfPoppler() { // check if generated pdf is correct by searching for a know string on the page diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index 92e281873..a0f8f11d2 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -191,6 +191,7 @@ private Q_SLOTS: void visibilityState(); void jsKeyboardEvent(); void deletePage(); + void closeOpenerTab(); }; // This will be called before the first test function is executed. @@ -2905,5 +2906,41 @@ void tst_QWebEngineView::deletePage() QTRY_VERIFY(spy.count()); } +class TestView : public QWebEngineView { + Q_OBJECT +public: + TestView(QWidget *parent = nullptr) : QWebEngineView(parent) + { + } + + QWebEngineView *createWindow(QWebEnginePage::WebWindowType) override + { + TestView *view = new TestView(parentWidget()); + createdWindows.append(view); + return view; + } + QList<TestView *> createdWindows; +}; + +void tst_QWebEngineView::closeOpenerTab() +{ + QWidget rootWidget; + rootWidget.resize(600, 400); + auto *testView = new TestView(&rootWidget); + testView->settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true); + QSignalSpy loadFinishedSpy(testView, SIGNAL(loadFinished(bool))); + testView->setUrl(QStringLiteral("about:blank")); + QTRY_VERIFY(loadFinishedSpy.count()); + testView->page()->runJavaScript(QStringLiteral("window.open('about:blank','_blank')")); + QTRY_COMPARE(testView->createdWindows.size(), 1); + auto *newView = testView->createdWindows.at(0); + newView->show(); + rootWidget.show(); + QVERIFY(QTest::qWaitForWindowExposed(newView)); + QVERIFY(newView->focusProxy()->isVisible()); + delete testView; + QVERIFY(newView->focusProxy()->isVisible()); +} + QTEST_MAIN(tst_QWebEngineView) #include "tst_qwebengineview.moc" |