summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp25
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro2
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp115
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp117
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp7
-rw-r--r--tests/auto/qnetworkreply/.gitattributes1
-rw-r--r--tests/auto/qnetworkreply/index.html3
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp61
-rw-r--r--tests/auto/qsslcertificate/more-certificates/blacklisted-google.com-diginotar.pem30
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp45
10 files changed, 403 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
index 2cc2971..96bea68 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -43,6 +43,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QDebug>
+#include <QtCore/qlibraryinfo.h>
#include "../shared/testhttpserver.h"
#include "../../../shared/util.h"
@@ -70,6 +71,7 @@ private slots:
void remoteImportWithUnquotedUri();
void versionNotInstalled();
void versionNotInstalled_data();
+ void importPath();
};
#ifdef Q_OS_SYMBIAN
@@ -308,6 +310,29 @@ void tst_qdeclarativemoduleplugin::versionNotInstalled()
VERIFY_ERRORS(errorFile.toLatin1().constData());
}
+void tst_qdeclarativemoduleplugin::importPath()
+{
+#ifndef Q_OS_SYMBIAN
+ QSKIP("Import path order testing for Symbian only", SkipAll);
+#else
+ QDeclarativeEngine engine;
+ QStringList imports = engine.importPathList();
+ QString installImportsPath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::ImportsPath));
+ QString driveOrder(QLatin1String("ZABCDEFGHIJKLMNOPQRSTUVWXY"));
+ int lastOrder = 30;
+ foreach(QString import, imports)
+ {
+ if (import.endsWith(installImportsPath))
+ {
+ int order = driveOrder.indexOf(import[0]);
+ QVERIFY(order < lastOrder);
+ lastOrder = order;
+ }
+ }
+ QVERIFY(lastOrder != 30);
+#endif
+}
+
QTEST_MAIN(tst_qdeclarativemoduleplugin)
#include "tst_qdeclarativemoduleplugin.moc"
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
index a92d3a2..2716a8b 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
@@ -9,7 +9,7 @@ CONFIG -= app_bundle
symbian: {
importFiles.sources = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 33f74a9..4d8bd0b 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -156,6 +156,7 @@ private slots:
void inputContextMouseHandler();
void inputMethodComposing();
void cursorRectangleSize();
+ void deselect();
private:
void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0);
@@ -2699,6 +2700,120 @@ void tst_qdeclarativetextedit::cursorRectangleSize()
QCOMPARE(microFocusFromScene.size(), cursorRect.size());
QCOMPARE(microFocusFromApp.size(), cursorRect.size());
}
+
+void tst_qdeclarativetextedit::deselect()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEdit != 0);
+
+ textEdit->setText("Select");
+
+ QSignalSpy selectionStartSpy(textEdit, SIGNAL(selectionStartChanged()));
+ QSignalSpy selectionEndSpy(textEdit, SIGNAL(selectionEndChanged()));
+ QSignalSpy selectionSpy(textEdit, SIGNAL(selectionChanged()));
+
+ textEdit->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 1);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectionSpy.count(), 1);
+ QCOMPARE(textEdit->selectionStart(), 5);
+ QCOMPARE(textEdit->selectionEnd(), 6);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("t"));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ textEdit->deselect();
+
+ QCOMPARE(selectionStartSpy.count(), 2);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectionSpy.count(), 2);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ textEdit->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectionSpy.count(), 3);
+ QCOMPARE(textEdit->selectionStart(), 5);
+ QCOMPARE(textEdit->selectionEnd(), 6);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("t"));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ QKeyEvent leftArrowPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier);
+ QKeyEvent leftArrowRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier);
+ QApplication::sendEvent(canvas, &leftArrowPress);
+ QApplication::sendEvent(canvas, &leftArrowRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 2);
+ QCOMPARE(selectionSpy.count(), 4);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 5);
+
+ textEdit->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 3);
+ QCOMPARE(selectionSpy.count(), 5);
+ QCOMPARE(textEdit->selectionStart(), 5);
+ QCOMPARE(textEdit->selectionEnd(), 6);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("t"));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 4);
+ QCOMPARE(selectionEndSpy.count(), 4);
+ QCOMPARE(selectionSpy.count(), 6);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 0);
+
+ textEdit->setCursorPosition(1);
+
+ QCOMPARE(selectionStartSpy.count(), 5);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectionSpy.count(), 6);
+
+ QKeyEvent leftArrowShiftPress(QEvent::KeyPress, Qt::Key_Left, Qt::ShiftModifier);
+ QKeyEvent leftArrowShiftRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::ShiftModifier);
+ QApplication::sendEvent(canvas, &leftArrowShiftPress);
+ QApplication::sendEvent(canvas, &leftArrowShiftRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 6);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectionSpy.count(), 7);
+ QCOMPARE(textEdit->selectionStart(), 0);
+ QCOMPARE(textEdit->selectionEnd(), 1);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("S"));
+ QCOMPARE(textEdit->cursorPosition(), 0);
+
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 6);
+ QCOMPARE(selectionEndSpy.count(), 6);
+ QCOMPARE(selectionSpy.count(), 8);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 0);
+}
QTEST_MAIN(tst_qdeclarativetextedit)
#include "tst_qdeclarativetextedit.moc"
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index bb895bf..b077670 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -147,6 +147,7 @@ private slots:
void inputContextMouseHandler();
void inputMethodComposing();
void cursorRectangleSize();
+ void deselect();
private:
void simulateKey(QDeclarativeView *, int key);
@@ -2367,7 +2368,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
// input method should not be enabled
- // if TextEdit is read only.
+ // if TextInput is read only.
input.setReadOnly(true);
ic.openInputPanelReceived = false;
input.setFocus(true);
@@ -2815,6 +2816,120 @@ void tst_qdeclarativetextinput::cursorRectangleSize()
QCOMPARE(microFocusFromApp.size(), cursorRect.size());
}
+void tst_qdeclarativetextinput::deselect()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInput != 0);
+
+ textInput->setText("Select");
+
+ QSignalSpy selectionStartSpy(textInput, SIGNAL(selectionStartChanged()));
+ QSignalSpy selectionEndSpy(textInput, SIGNAL(selectionEndChanged()));
+ QSignalSpy selectedTextSpy(textInput, SIGNAL(selectedTextChanged()));
+
+ textInput->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 1);
+ QCOMPARE(selectionEndSpy.count(), 0);
+ QCOMPARE(selectedTextSpy.count(), 1);
+ QCOMPARE(textInput->selectionStart(), 5);
+ QCOMPARE(textInput->selectionEnd(), 6);
+ QCOMPARE(textInput->selectedText(), QLatin1String("t"));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ textInput->deselect();
+
+ QCOMPARE(selectionStartSpy.count(), 2);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectedTextSpy.count(), 2);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ textInput->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectedTextSpy.count(), 3);
+ QCOMPARE(textInput->selectionStart(), 5);
+ QCOMPARE(textInput->selectionEnd(), 6);
+ QCOMPARE(textInput->selectedText(), QLatin1String("t"));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ QKeyEvent leftArrowPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier);
+ QKeyEvent leftArrowRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier);
+ QApplication::sendEvent(canvas, &leftArrowPress);
+ QApplication::sendEvent(canvas, &leftArrowRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 4);
+ QCOMPARE(selectionEndSpy.count(), 2);
+ QCOMPARE(selectedTextSpy.count(), 4);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 5);
+
+ textInput->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 4);
+ QCOMPARE(selectionEndSpy.count(), 3);
+ QCOMPARE(selectedTextSpy.count(), 5);
+ QCOMPARE(textInput->selectionStart(), 5);
+ QCOMPARE(textInput->selectionEnd(), 6);
+ QCOMPARE(textInput->selectedText(), QLatin1String("t"));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 5);
+ QCOMPARE(selectionEndSpy.count(), 4);
+ QCOMPARE(selectedTextSpy.count(), 6);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 0);
+
+ textInput->setCursorPosition(1);
+
+ QCOMPARE(selectionStartSpy.count(), 6);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectedTextSpy.count(), 6);
+
+ QKeyEvent leftArrowShiftPress(QEvent::KeyPress, Qt::Key_Left, Qt::ShiftModifier);
+ QKeyEvent leftArrowShiftRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::ShiftModifier);
+ QApplication::sendEvent(canvas, &leftArrowShiftPress);
+ QApplication::sendEvent(canvas, &leftArrowShiftRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 7);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectedTextSpy.count(), 7);
+ QCOMPARE(textInput->selectionStart(), 0);
+ QCOMPARE(textInput->selectionEnd(), 1);
+ QCOMPARE(textInput->selectedText(), QLatin1String("S"));
+ QCOMPARE(textInput->cursorPosition(), 0);
+
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 8);
+ QCOMPARE(selectionEndSpy.count(), 6);
+ QCOMPARE(selectedTextSpy.count(), 8);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 0);
+}
+
QTEST_MAIN(tst_qdeclarativetextinput)
#include "tst_qdeclarativetextinput.moc"
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 1f33458..3276375 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -1764,6 +1764,13 @@ void tst_QLineEdit::passwordEchoDelay()
QApplication::sendEvent(testWidget, &ev);
QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7'));
+ testWidget->setCursorPosition(3);
+ QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7'));
+ QTest::keyPress(testWidget, 'a');
+ QCOMPARE(testWidget->displayText(), QString(3, fillChar) + QLatin1Char('a') + QString(5, fillChar));
+ QTest::keyPress(testWidget, Qt::Key_Backspace);
+ QCOMPARE(testWidget->displayText(), QString(8, fillChar));
+
// restore clean state
testWidget->setEchoMode(QLineEdit::Normal);
}
diff --git a/tests/auto/qnetworkreply/.gitattributes b/tests/auto/qnetworkreply/.gitattributes
index 80252cf..7fa30e3 100644
--- a/tests/auto/qnetworkreply/.gitattributes
+++ b/tests/auto/qnetworkreply/.gitattributes
@@ -1,3 +1,4 @@
rfc3252.txt -crlf
bigfile -crlf
resource -crlf
+index.html -crlf
diff --git a/tests/auto/qnetworkreply/index.html b/tests/auto/qnetworkreply/index.html
new file mode 100644
index 0000000..135db79
--- /dev/null
+++ b/tests/auto/qnetworkreply/index.html
@@ -0,0 +1,3 @@
+<h1>Welcome to qt-test-server</h1>
+<img src="gif/fluke.gif" alt="fluke">
+<p>This is a network test server. It serves as a cacheing ftp and http proxy, transparent http/socks5 proxy, imap, ftp and http server, plus more.</p>
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index ebf8295..7e5b365 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -178,6 +178,8 @@ private Q_SLOTS:
void getFromHttp();
void getErrors_data();
void getErrors();
+ void headFromHttp_data();
+ void headFromHttp();
void putToFile_data();
void putToFile();
void putToFtp_data();
@@ -1484,6 +1486,65 @@ void tst_QNetworkReply::getFromHttp()
QCOMPARE(reply->readAll(), reference.readAll());
}
+void tst_QNetworkReply::headFromHttp_data()
+{
+ QTest::addColumn<qint64>("referenceSize");
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QString>("contentType");
+ QTest::addColumn<QNetworkProxy>("proxy");
+
+ qint64 rfcsize = QFileInfo(SRCDIR "/rfc3252.txt").size();
+ qint64 bigfilesize = QFileInfo(SRCDIR "/bigfile").size();
+ qint64 indexsize = QFileInfo(SRCDIR "/index.html").size();
+
+ //testing proxies, mainly for the 407 response from http proxy
+ for (int i = 0; i < proxies.count(); ++i) {
+ QTest::newRow("rfc" + proxies.at(i).tag) << rfcsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << "text/plain" << proxies.at(i).proxy;
+ QTest::newRow("bigfile" + proxies.at(i).tag) << bigfilesize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") << "text/plain" << proxies.at(i).proxy;
+ QTest::newRow("index" + proxies.at(i).tag) << indexsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/") << "text/html" << proxies.at(i).proxy;
+ QTest::newRow("with-authentication" + proxies.at(i).tag) << rfcsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << "text/plain" << proxies.at(i).proxy;
+ QTest::newRow("cgi" + proxies.at(i).tag) << (qint64)-1 << QUrl("http://qt-test-server/qtest/cgi-bin/httpcachetest_expires500.cgi") << "text/html" << proxies.at(i).proxy;
+ }
+}
+
+void tst_QNetworkReply::headFromHttp()
+{
+ QFETCH(qint64, referenceSize);
+ QFETCH(QUrl, url);
+ QFETCH(QString, contentType);
+ QFETCH(QNetworkProxy, proxy);
+
+ QNetworkRequest request(url);
+ QNetworkReplyPtr reply;
+
+ QElapsedTimer time;
+ time.start();
+
+ manager.setProxy(proxy);
+ connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
+ SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+ connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
+
+ RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::HeadOperation, request, reply));
+
+ manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
+ this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+ manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
+
+ QVERIFY(time.elapsed() < 8000); //check authentication didn't wait for the server to timeout the http connection (15s on qt test server)
+
+ QCOMPARE(reply->url(), request.url());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
+ // only compare when the header is set.
+ if (reply->header(QNetworkRequest::ContentLengthHeader).isValid() && referenceSize >= 0)
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), referenceSize);
+ if (reply->header(QNetworkRequest::ContentTypeHeader).isValid())
+ QCOMPARE(reply->header(QNetworkRequest::ContentTypeHeader).toString(), contentType);
+}
+
void tst_QNetworkReply::getErrors_data()
{
QTest::addColumn<QString>("url");
diff --git a/tests/auto/qsslcertificate/more-certificates/blacklisted-google.com-diginotar.pem b/tests/auto/qsslcertificate/more-certificates/blacklisted-google.com-diginotar.pem
new file mode 100644
index 0000000..12bbcae
--- /dev/null
+++ b/tests/auto/qsslcertificate/more-certificates/blacklisted-google.com-diginotar.pem
@@ -0,0 +1,30 @@
+-----BEGIN CERTIFICATE-----
+MIIFKDCCBBCgAwIBAgIQBeLmpM0J6lTWZbB1/iKiVjANBgkqhkiG9w0BAQUFADBm
+MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdp
+Tm90YXIgUHVibGljIENBIDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5v
+dGFyLm5sMB4XDTExMDcxMDE5MDYzMFoXDTEzMDcwOTE5MDYzMFowajELMAkGA1UE
+BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxFjAUBgNVBAcTDU1vdW50YWluIFZp
+ZXcxFzAVBgNVBAUTDlBLMDAwMjI5MjAwMDAyMRUwEwYDVQQDEwwqLmdvb2dsZS5j
+b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNbeKubCV0aCxhOiOS
+CSQ/w9HXTYuD5BLKuiqXNw3setdTymeJz2L8aWOHo3nicFNDVwWTgwWomGNr2J6Q
+7g1iINNSW0rR4E1l2szRkcnAY6c6i/Eke93nF4i2hDsnIBveolF5yjpuRm73uQQD
+ulHjA3BFRF/PTi0fw2/Yt+8ieoMuNcMWN6Eou5Gqt5YZkWv176ofeCbsBmMrP87x
+OhhtTDckCapk4VQZG2XrfzZcV6tdzCp5TI8uHdu17cdzXm1imZ8tyvzFeiCEOQN8
+vPNzB/fIr3CJQ5q4uM5aKT3DD5PeVzf4rfJKQNgCTWiIBc9XcWEUuszwAsnmg7e2
+EJRdAgMBAAGjggHMMIIByDA6BggrBgEFBQcBAQQuMCwwKgYIKwYBBQUHMAGGHmh0
+dHA6Ly92YWxpZGF0aW9uLmRpZ2lub3Rhci5ubDAfBgNVHSMEGDAWgBTfM8Cvkv43
+/LbYFhbQ2bGR1fpupTAJBgNVHRMEAjAAMIHGBgNVHSAEgb4wgbswgbgGDmCEEAGH
+aQEBAQIEAQICMIGlMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2lub3Rhci5u
+bC9jcHMwegYIKwYBBQUHAgIwbhpsQ29uZGl0aW9ucywgYXMgbWVudGlvbmVkIG9u
+IG91ciB3ZWJzaXRlICh3d3cuZGlnaW5vdGFyLm5sKSwgYXJlIGFwcGxpY2FibGUg
+dG8gYWxsIG91ciBwcm9kdWN0cyBhbmQgc2VydmljZXMuMEkGA1UdHwRCMEAwPqA8
+oDqGOGh0dHA6Ly9zZXJ2aWNlLmRpZ2lub3Rhci5ubC9jcmwvcHVibGljMjAyNS9s
+YXRlc3RDUkwuY3JsMA4GA1UdDwEB/wQEAwIEsDAbBgNVHREEFDASgRBhZG1pbkBn
+b29nbGUuY29tMB0GA1UdDgQWBBQHSn0WJzIo0eMBMQUNsMqN6eF/7TANBgkqhkiG
+9w0BAQUFAAOCAQEAAs5dL7N9wzRJkI4Aq4lC5t8j5ZadqnqUcgYLADzSv4ExytNH
+UY2nH6iVTihC0UPSsILWraoeApdT7Rphz/8DLQEBRGdeKWAptNM3EbiXtQaZT2uB
+pidL8UoafX0kch3f71Y1scpBEjvu5ZZLnjg0A8AL0tnsereOVdDpU98bKqdbbrnM
+FRmBlSf7xdaNca6JJHeEpga4E9Ty683CmccrSGXdU2tTCuHEJww+iOAUtPIZcsum
+U7/eYeY1pMyGLyIjbNgRY7nDzRwvM/BsbL9eh4/mSQj/4nncqJd22sVQpCggQiVK
+baB2sVGcVNBkK55bT8gPqnx8JypubyUvayzZGg==
+-----END CERTIFICATE-----
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 43dd077..2161f99 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -397,6 +397,9 @@ private slots:
void minimizedWindowModeTransitions();
void normalWindowModeTransitions();
void focusSwitchClosesPopupMenu();
+#if !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE)
+ void opacityChangeCausesBackingStoreRecreation();
+#endif
#endif
void focusProxyAndInputMethods();
@@ -10336,7 +10339,47 @@ void tst_QWidget::focusSwitchClosesPopupMenu()
mainWindow.activateWindow();
QVERIFY(!CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed());
}
-#endif
+
+#if !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE)
+class OpacityChangeWidget : public QWidget
+{
+public:
+ OpacityChangeWidget() : m_paintEngineType(QPaintEngine::MaxUser) { }
+ void paintEvent(QPaintEvent *)
+ {
+ QPainter painter(this);
+ m_paintEngineType = painter.paintEngine()->type();
+ }
+ QPaintEngine::Type paintEngineType() const { return m_paintEngineType; }
+private:
+ QPaintEngine::Type m_paintEngineType;
+};
+
+void tst_QWidget::opacityChangeCausesBackingStoreRecreation()
+{
+ OpacityChangeWidget w;
+ w.show();
+ QTest::qWaitForWindowShown(&w);
+ const QPaintEngine::Type type = w.paintEngineType();
+ if (QPaintEngine::OpenGL != type && QPaintEngine::OpenVG != type) {
+ QSKIP("Test case is only valid when using opengl or openvg graphics system", SkipAll);
+ } else {
+ if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ QSKIP("Test case is only valid when EGL surface transparency is not supported", SkipAll);
+ } else {
+ // Making window transparent should force switch to raster graphics system
+ w.setAttribute(Qt::WA_TranslucentBackground, true);
+ w.repaint();
+ QCOMPARE(w.paintEngineType(), QPaintEngine::Raster);
+ // Making window opaque should cause switch back to previous graphics system
+ w.setAttribute(Qt::WA_TranslucentBackground, false);
+ w.repaint();
+ QCOMPARE(w.paintEngineType(), type);
+ }
+ }
+}
+#endif // !Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
+#endif // Q_OS_SYMBIAN
class InputContextTester : public QInputContext
{