summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2019-05-14 12:05:39 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2019-07-18 10:47:02 +0200
commit0872bcd6a0a423d7aa904f597f83cd991b53112b (patch)
tree045876db52ddb08222a985bc51d1367d192e4204 /tests/auto
parentbc1176b7bc7d7ce9ddfc5f83d100162f3a0c651f (diff)
Adapt tst_origins for blink::SecurityOrigin fix
PathSyntax schemes used to have their origins serialized to 'qrc:' in url::Origin::Serialize and to 'qrc://' in blink::SecurityOrigin::ToString. This has now been harmonized to 'qrc:' everywhere so the tests have to be adapted. Task-number: QTBUG-75651 Change-Id: I03515788e151f3d4a82081269b6babecfaa69e97 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/origins/tst_origins.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/auto/widgets/origins/tst_origins.cpp b/tests/auto/widgets/origins/tst_origins.cpp
index c1307c5e6..8fed79975 100644
--- a/tests/auto/widgets/origins/tst_origins.cpp
+++ b/tests/auto/widgets/origins/tst_origins.cpp
@@ -346,11 +346,7 @@ void tst_Origins::jsUrlOrigin()
QCOMPARE(eval(QSL("new URL(\"file:/etc/passwd\").origin")), QVariant(QSL("file://")));
QCOMPARE(eval(QSL("new URL(\"file://foo.com/etc/passwd\").origin")), QVariant(QSL("file://")));
- // The qrc scheme should behave like file.
- QCOMPARE(eval(QSL("new URL(\"qrc:/crysis.css\").origin")), QVariant(QSL("qrc://")));
- QCOMPARE(eval(QSL("new URL(\"qrc://foo.com/crysis.css\").origin")), QVariant(QSL("qrc://")));
-
- // Unregistered schemes behaves like opaque origins.
+ // Unregistered schemes behave like file.
QCOMPARE(eval(QSL("new URL(\"tst:/banana\").origin")), QVariant(QSL("tst://")));
QCOMPARE(eval(QSL("new URL(\"tst://foo.com/banana\").origin")), QVariant(QSL("tst://")));
@@ -367,8 +363,9 @@ void tst_Origins::jsUrlOrigin()
QVariant(QSL("hostportanduserinformationsyntax://foo")));
// A PathSyntax scheme should have a 'universal' origin.
- QCOMPARE(eval(QSL("new URL(\"PathSyntax:foo\").origin")),
- QVariant(QSL("pathsyntax://")));
+ QCOMPARE(eval(QSL("new URL(\"PathSyntax:foo\").origin")), QVariant(QSL("pathsyntax:")));
+ QCOMPARE(eval(QSL("new URL(\"qrc:/crysis.css\").origin")), QVariant(QSL("qrc:")));
+ QCOMPARE(eval(QSL("new URL(\"qrc://foo.com/crysis.css\").origin")), QVariant(QSL("qrc:")));
// The NoAccessAllowed flag forces opaque origins.
QCOMPARE(eval(QSL("new URL(\"PathSyntax-NoAccessAllowed:foo\").origin")),
@@ -709,7 +706,7 @@ void tst_Origins::serviceWorker()
QVERIFY(load(QSL("qrc:/resources/serviceWorker.html")));
QTRY_VERIFY(eval(QSL("done")).toBool());
QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("The URL protocol of the current origin ('qrc://') is not supported.")));
+ .contains(QSL("The URL protocol of the current origin ('qrc:') is not supported.")));
QVERIFY(load(QSL("tst:/resources/serviceWorker.html")));
QTRY_VERIFY(eval(QSL("done")).toBool());
@@ -724,7 +721,7 @@ void tst_Origins::serviceWorker()
QVERIFY(load(QSL("PathSyntax-Secure:/resources/serviceWorker.html")));
QTRY_VERIFY(eval(QSL("done")).toBool());
QVERIFY(eval(QSL("error")).toString()
- .contains(QSL("The URL protocol of the current origin ('pathsyntax-secure://') is not supported.")));
+ .contains(QSL("The URL protocol of the current origin ('pathsyntax-secure:') is not supported.")));
QVERIFY(load(QSL("PathSyntax-ServiceWorkersAllowed:/resources/serviceWorker.html")));
QTRY_VERIFY(eval(QSL("done")).toBool());