From 3905f8a0801b0160bae3f6947678c4156d96e5dc Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 14 Apr 2010 10:14:10 +1000 Subject: Pass even if $LANG is not set to en_US.* --- tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect | 2 +- tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml | 2 ++ .../declarative/qdeclarativexmlhttprequest/data/abort_opened.qml | 2 ++ .../declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml | 1 + .../qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml | 1 + .../qdeclarativexmlhttprequest/data/getResponseHeader.expect | 2 +- .../qdeclarativexmlhttprequest/data/getResponseHeader.qml | 1 + tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/open_network.expect | 2 +- .../auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/responseText.qml | 2 ++ .../qdeclarativexmlhttprequest/data/send_alreadySent.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.1.expect | 2 +- .../declarative/qdeclarativexmlhttprequest/data/send_data.1.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.2.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.3.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.4.expect | 2 +- .../declarative/qdeclarativexmlhttprequest/data/send_data.4.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.5.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.6.expect | 2 +- .../declarative/qdeclarativexmlhttprequest/data/send_data.6.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_data.7.qml | 1 + .../declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml | 1 + .../qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect | 2 +- .../qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect | 2 +- .../qdeclarativexmlhttprequest/data/setRequestHeader.expect | 2 +- .../qdeclarativexmlhttprequest/data/setRequestHeader.qml | 1 + .../data/setRequestHeader_illegalName.qml | 1 + .../qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml | 1 + .../auto/declarative/qdeclarativexmlhttprequest/data/status.expect | 2 +- tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml | 2 ++ .../auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml | 2 ++ .../qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp | 6 ------ 33 files changed, 37 insertions(+), 16 deletions(-) diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect index f43e043..4d21122 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect @@ -1,9 +1,9 @@ PUT /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Content-Type: text/plain;charset=UTF-8 Content-Length: 9 Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml index d7b9266..729793e 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml @@ -13,6 +13,7 @@ QtObject { var x = new XMLHttpRequest; x.open("GET", urlDummy); x.setRequestHeader("Test-header", "TestValue"); + x.setRequestHeader("Accept-Language", "en-US"); x.send(); x.onreadystatechange = function() { @@ -35,6 +36,7 @@ QtObject { } } x.open("PUT", url); + x.setRequestHeader("Accept-Language", "en-US"); x.send("Test Data"); } } diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml index 72a45e7..33ca020 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml @@ -21,10 +21,12 @@ QtObject { readyState = true; x.open("PUT", url); + x.setRequestHeader("Accept-Language", "en-US"); x.abort(); x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); if (x.readyState == XMLHttpRequest.OPENED) openedState = true; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml index aa78cde..c0957ed 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml @@ -21,6 +21,7 @@ QtObject { readyState = true; x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); if (x.readyState == XMLHttpRequest.OPENED) openedState = true; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml index 8d67fad..9096999 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml @@ -31,6 +31,7 @@ QtObject { readyState = true; x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); if (x.readyState == XMLHttpRequest.OPENED) openedState = true; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect index a740c79..c6cad70 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect @@ -1,7 +1,7 @@ GET /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml index 2f949e1..7a65e25 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml @@ -37,6 +37,7 @@ QtObject { readyState = true; x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); if (x.readyState == XMLHttpRequest.OPENED) openedState = true; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml index c06bae3..72fb9d7 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml @@ -20,6 +20,7 @@ QtObject { readyState = true; x.open("GET", url); + x.setRequestHeader("Accept-Language","en-US"); if (x.readyState == XMLHttpRequest.OPENED) openedState = true; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect index a740c79..c6cad70 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect @@ -1,7 +1,7 @@ GET /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml index 19e37fa..b07f8e7 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml @@ -20,6 +20,7 @@ QtObject { readyState = true; x.open("GET", url, true, "username", "password"); + x.setRequestHeader("Accept-Language","en-US"); if (x.readyState == XMLHttpRequest.OPENED) openedState = true; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml index 4bb3a7a..9fa4847 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml @@ -22,6 +22,7 @@ QtObject { unsent = (x.responseText == ""); x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); opened = (x.responseText == ""); @@ -39,6 +40,7 @@ QtObject { dataOK = (x.responseText == expectedText); x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); reset = (x.responseText == ""); } diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml index 0bad7df..a9ef3e8 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml @@ -7,6 +7,7 @@ QtObject { Component.onCompleted: { var x = new XMLHttpRequest; x.open("GET", "testdocument.html"); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect index 81dd4a0..2effbdc 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect @@ -1,9 +1,9 @@ POST /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml index 03543a9..171e0b1 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml @@ -8,6 +8,7 @@ QtObject { Component.onCompleted: { var x = new XMLHttpRequest; x.open("POST", url); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml index 79a27b6..09b742b 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml @@ -9,6 +9,7 @@ QtObject { var x = new XMLHttpRequest; x.open("POST", url); x.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml index e048769..8786917 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml @@ -9,6 +9,7 @@ QtObject { var x = new XMLHttpRequest; x.open("POST", url); x.setRequestHeader("Content-Type", "text/plain;charset=latin1"); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect index 8fcf3ac..8336860 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect @@ -1,9 +1,9 @@ POST /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Content-Type: charset=UTF-8;text/plain Content-Length: 12 Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml index 7ab0b27..6789480 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml @@ -9,6 +9,7 @@ QtObject { var x = new XMLHttpRequest; x.open("POST", url); x.setRequestHeader("Content-Type", "charset=UTF-8;text/plain"); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml index 29bf2c2..08d999d 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml @@ -9,6 +9,7 @@ QtObject { var x = new XMLHttpRequest; x.open("POST", url); x.setRequestHeader("Content-Type", "charset=latin1;text/plain"); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect index 97e6fac..4f10bbc 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect @@ -1,9 +1,9 @@ PUT /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml index 135f45c..e047fc8 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml @@ -8,6 +8,7 @@ QtObject { Component.onCompleted: { var x = new XMLHttpRequest; x.open("PUT", url); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml index 4a09527..ba0db25 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml @@ -9,6 +9,7 @@ QtObject { var x = new XMLHttpRequest; x.open("POST", url); x.setRequestHeader("Content-Type", "text/plain"); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml index dd5fa46..ddf520e 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml @@ -9,6 +9,7 @@ QtObject { Component.onCompleted: { var x = new XMLHttpRequest; x.open(reqType, url); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect index a740c79..c6cad70 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect @@ -1,7 +1,7 @@ GET /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect index 991bd59..74a9798 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect @@ -1,7 +1,7 @@ HEAD /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect index 4600f2a..7b8e260 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect @@ -1,9 +1,9 @@ GET /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US TEST-HEADER: value TEST-HEADER2: value,value2 Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml index b0723aa..61eea33 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml @@ -9,6 +9,7 @@ QtObject { var x = new XMLHttpRequest; x.open("GET", url); + x.setRequestHeader("Accept-Language","en-US"); x.setRequestHeader("Test-header", "value"); x.setRequestHeader("Test-header2", "value"); diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml index bf31eca..b22b239 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml @@ -21,6 +21,7 @@ QtObject { readyState = true; x.open("GET", url); + x.setRequestHeader("Accept-Language","en-US"); x.setRequestHeader(header, "Value"); diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml index c2bbc6e..666c791 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml @@ -10,6 +10,7 @@ QtObject { var x = new XMLHttpRequest; x.open("GET", url); + x.setRequestHeader("Accept-Language","en-US"); // Test to the end x.onreadystatechange = function() { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect index a740c79..c6cad70 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect @@ -1,7 +1,7 @@ GET /testdocument.html HTTP/1.1 +ACCEPT-LANGUAGE: en-US Connection: Keep-Alive Accept-Encoding: gzip -Accept-Language: en-US,* User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml index 04202c4..c903e12 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml @@ -27,6 +27,7 @@ QtObject { } x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); try { var a = x.status; @@ -54,6 +55,7 @@ QtObject { } x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); try { var a = x.status; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml index 8becc3b..a3b98be 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml @@ -27,6 +27,7 @@ QtObject { } x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); try { var a = x.statusText; @@ -54,6 +55,7 @@ QtObject { } x.open("GET", url); + x.setRequestHeader("Accept-Language", "en-US"); try { var a = x.statusText; diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp index 13ed959..1d26f2c 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp @@ -55,12 +55,6 @@ public: tst_qdeclarativexmlhttprequest() {} private slots: - void initTestCase() { - if (QLocale::system().name().replace(QChar::fromAscii('_'),QChar::fromAscii('-')) != QLatin1String("en-US")) { - qWarning() << "Test will fail unless LANG is en_US"; - } - } - void domExceptionCodes(); void callbackException(); void callbackException_data(); -- cgit v0.12 From 65020d507a5b6a932034b9d6ee57fd765893f3ad Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 14 Apr 2010 11:07:18 +1000 Subject: More verbose message on failure. --- tests/auto/declarative/examples/tst_examples.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index dfcc9c0..abb2b93 100644 --- a/tests/auto/declarative/examples/tst_examples.cpp +++ b/tests/auto/declarative/examples/tst_examples.cpp @@ -293,8 +293,11 @@ void tst_examples::examples() sync.waitForFinished(); - for (int ii = 0; ii < tests.count(); ++ii) + for (int ii = 0; ii < tests.count(); ++ii) { + if (tests.at(ii).result != Example::Pass) + qWarning() << tests.at(ii).file << ":failed"; QVERIFY(tests.at(ii).result == Example::Pass); + } #else -- cgit v0.12 From 428317f83fd8b7a62244a446b76299de050d1325 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 14 Apr 2010 11:31:05 +1000 Subject: Give better error messages on plugin load failures. Fixes reverted commit e0dcdbd2984299665b9b784b201289219b9978d3. --- src/declarative/qml/qdeclarativeengine.cpp | 44 ++++++++++++++++++++---------- src/declarative/qml/qdeclarativeengine.h | 2 +- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index f1adc16..e2f810e 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1486,13 +1486,17 @@ public: QSet qmlDirFilesForWhichPluginsHaveBeenLoaded; - QDeclarativeDirComponents importExtension(const QString &absoluteFilePath, const QString &uri, QDeclarativeEngine *engine) { + bool importExtension(const QString &absoluteFilePath, const QString &uri, QDeclarativeEngine *engine, QDeclarativeDirComponents* components, QString *errorString) { QFile file(absoluteFilePath); QString filecontent; if (file.open(QFile::ReadOnly)) { filecontent = QString::fromUtf8(file.readAll()); if (qmlImportTrace()) qDebug() << "QDeclarativeEngine::add: loaded" << absoluteFilePath; + } else { + if (errorString) + *errorString = QDeclarativeEngine::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath); + return false; } QDir dir = QFileInfo(file).dir(); @@ -1512,11 +1516,23 @@ public: plugin.name); if (!resolvedFilePath.isEmpty()) { - engine->importPlugin(resolvedFilePath, uri); + if (!engine->importPlugin(resolvedFilePath, uri, errorString)) { + if (errorString) + *errorString = QDeclarativeEngine::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(*errorString); + return false; + } + } else { + if (errorString) + *errorString = QDeclarativeEngine::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name); + return false; } } } - return qmldirParser.components(); + + if (components) + *components = qmldirParser.components(); + + return true; } QString resolvedUri(const QString &dir_arg, QDeclarativeEngine *engine) @@ -1577,7 +1593,8 @@ public: url = QUrl::fromLocalFile(fi.absolutePath()).toString(); uri = resolvedUri(dir, engine); - qmldircomponents = importExtension(absoluteFilePath, uri, engine); + if (!importExtension(absoluteFilePath, uri, engine, &qmldircomponents, errorString)) + return false; break; } } @@ -1608,12 +1625,12 @@ public: return false; // local import dirs must exist } uri = resolvedUri(toLocalFileOrQrc(base.resolved(QUrl(uri))), engine); - qmldircomponents = importExtension(localFileOrQrc, - uri, - engine); - if (uri.endsWith(QLatin1Char('/'))) uri.chop(1); + if (QFile::exists(localFileOrQrc)) { + if (!importExtension(localFileOrQrc,uri,engine,&qmldircomponents,errorString)) + return false; + } } else { if (prefix.isEmpty()) { // directory must at least exist for valid import @@ -1927,7 +1944,7 @@ void QDeclarativeEngine::setPluginPathList(const QStringList &paths) Imports the plugin named \a filePath with the \a uri provided. Returns true if the plugin was successfully imported; otherwise returns false. */ -bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri) +bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri, QString *errorString) { if (qmlImportTrace()) qDebug() << "QDeclarativeEngine::importPlugin" << uri << "from" << filePath; @@ -1948,9 +1965,8 @@ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &ur QPluginLoader loader(absoluteFilePath); if (!loader.load()) { - if (qmlImportTrace()) { - qDebug() << "QDeclarativeEngine::importPlugin: " << loader.errorString(); - } + if (errorString) + *errorString = loader.errorString(); return false; } @@ -1972,8 +1988,8 @@ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &ur iface->initializeEngine(this, moduleId); } } else { - if (qmlImportTrace()) - qDebug() << "QDeclarativeEngine::importPlugin: no DeclarativeExtensionInterface error"; + if (errorString) + *errorString = loader.errorString(); return false; } } diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h index fcaddcf..7b058ea 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/declarative/qml/qdeclarativeengine.h @@ -85,7 +85,7 @@ public: void setPluginPathList(const QStringList &paths); void addPluginPath(const QString& dir); - bool importPlugin(const QString &filePath, const QString &uri); + bool importPlugin(const QString &filePath, const QString &uri, QString *errorString); void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *); QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory() const; -- cgit v0.12 From b24a4c0b75f5d393ca673942b68a12f02ed476e8 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 14 Apr 2010 13:05:07 +1000 Subject: Stabilize test. Uses built-in server. --- .../qdeclarativepixmapcache/data/http/exists.png | Bin 0 -> 2738 bytes .../qdeclarativepixmapcache/data/http/exists1.png | Bin 0 -> 2738 bytes .../qdeclarativepixmapcache/data/http/exists2.png | Bin 0 -> 2738 bytes .../qdeclarativepixmapcache/data/http/exists3.png | Bin 0 -> 2738 bytes .../qdeclarativepixmapcache/data/http/exists4.png | Bin 0 -> 2738 bytes .../qdeclarativepixmapcache/data/http/exists5.png | Bin 0 -> 2738 bytes .../qdeclarativepixmapcache.pro | 6 +++++ .../tst_qdeclarativepixmapcache.cpp | 30 ++++++++++++--------- 8 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png create mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png create mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png create mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png create mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png create mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png differ diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png differ diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png differ diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png differ diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png differ diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png differ diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro index b5b033a..4b247fc 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro +++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro @@ -5,6 +5,12 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepixmapcache.cpp +INCLUDEPATH += ../shared/ +HEADERS += ../shared/testhttpserver.h +SOURCES += ../shared/testhttpserver.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" + # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage # LIBS += -lgcov diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp index 223f54f..f2ccf80 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp +++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp @@ -43,6 +43,8 @@ #include #include #include +#include "testhttpserver.h" +#include "../../../shared/util.h" // These don't let normal people run tests! //#include "../network-settings.h" @@ -52,8 +54,10 @@ class tst_qdeclarativepixmapcache : public QObject Q_OBJECT public: tst_qdeclarativepixmapcache() : - thisfile(QUrl::fromLocalFile(__FILE__)) + thisfile(QUrl::fromLocalFile(__FILE__)), + server(14452) { + server.serveDirectory(SRCDIR "/data/http"); } private slots: @@ -65,6 +69,7 @@ private slots: private: QDeclarativeEngine engine; QUrl thisfile; + TestHTTPServer server; }; @@ -110,8 +115,8 @@ void tst_qdeclarativepixmapcache::single_data() // File URLs are optimized QTest::newRow("local") << thisfile.resolved(QUrl("data/exists.png")) << localfile_optimized << true << false; QTest::newRow("local") << thisfile.resolved(QUrl("data/notexists.png")) << localfile_optimized << false << false; - QTest::newRow("remote") << QUrl("http://qt.nokia.com/logo.png") << false << true << false; - QTest::newRow("remote") << QUrl("http://qt.nokia.com/thereisnologo.png") << false << false << true; + QTest::newRow("remote") << QUrl("http://127.0.0.1:14452/exists.png") << false << true << false; + QTest::newRow("remote") << QUrl("http://127.0.0.1:14452/notexists.png") << false << false << true; } void tst_qdeclarativepixmapcache::single() @@ -122,7 +127,7 @@ void tst_qdeclarativepixmapcache::single() QFETCH(bool, neterror); if (neterror) { - QString expected = "\"Error downloading " + target.toString() + " - server replied: Not Found\" "; + QString expected = "\"Error downloading " + target.toString() + " - server replied: Not found\" "; QTest::ignoreMessage(QtWarningMsg, expected.toLatin1()); } else if (!exists) { QString expected = "Cannot open QUrl( \"" + target.toString() + "\" ) "; @@ -183,32 +188,32 @@ void tst_qdeclarativepixmapcache::parallel_data() ; QTest::newRow("remote") - << QUrl("http://qt.nokia.com/images/template/checkbox-on.png") - << QUrl("http://qt.nokia.com/images/products/qt-logo/image_tile") + << QUrl("http://127.0.0.1:14452/exists2.png") + << QUrl("http://127.0.0.1:14452/exists3.png") << 0 << -1 << 2 ; QTest::newRow("remoteagain") - << QUrl("http://qt.nokia.com/images/template/checkbox-on.png") - << QUrl("http://qt.nokia.com/images/products/qt-logo/image_tile") + << QUrl("http://127.0.0.1:14452/exists2.png") + << QUrl("http://127.0.0.1:14452/exists3.png") << 2 << -1 << 0 ; QTest::newRow("remotecopy") - << QUrl("http://qt.nokia.com/images/template/checkbox-off.png") - << QUrl("http://qt.nokia.com/images/template/checkbox-off.png") + << QUrl("http://127.0.0.1:14452/exists4.png") + << QUrl("http://127.0.0.1:14452/exists4.png") << 0 << -1 << 1 ; QTest::newRow("remotecopycancel") - << QUrl("http://qt.nokia.com/rounded_block_bg.png") - << QUrl("http://qt.nokia.com/rounded_block_bg.png") + << QUrl("http://127.0.0.1:14452/exists5.png") + << QUrl("http://127.0.0.1:14452/exists5.png") << 0 << 0 << 1 @@ -233,6 +238,7 @@ void tst_qdeclarativepixmapcache::parallel() QPixmap pixmap; QDeclarativePixmapReply::Status status = QDeclarativePixmapCache::get(target, &pixmap); QDeclarativePixmapReply *reply = 0; + QVERIFY(status != QDeclarativePixmapReply::Error); if (status != QDeclarativePixmapReply::Error && status != QDeclarativePixmapReply::Ready) reply = QDeclarativePixmapCache::request(&engine, target); replies.append(reply); -- cgit v0.12