Skip to content

Commit

Permalink
dwpas: Add tentative WPT tests for protocol_handler
Browse files Browse the repository at this point in the history
Adding manual WPT tests for new protocol_handler field.
w3c/manifest#846

Bug: 1019239
Change-Id: I49bbcae9ff1925fb2799d1462fca936147f2e118
  • Loading branch information
mwjacksonmsft authored and chromium-wpt-export-bot committed Sep 17, 2021
1 parent cc6b991 commit 5a69a61
Show file tree
Hide file tree
Showing 15 changed files with 205 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Test that protocol_handlers member is supported</title>
<link rel="manifest" href="protocol_handlers-member.webmanifest" />
<h1>Testing support for protocol_handlers member</h1>
<style>
.fail {
background-color: red;
}

.succeed {
background-color: green;
}
</style>
<script>
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('value');
if (myParam === "web+testing://test-url/") {
document.body.classList.add("succeed");
} else {
document.body.classList.add("fail");
}

</script>
<p>
To pass, when launching the application via web+testing://test-url/,
the background color must be green.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Test that protocol_handlers items with empty protocol are skipped</title>
<link rel="manifest" href="protocol_handlers-member-skip-for-empty-protocol.webmanifest" />
<h1>Test that protocol_handlers items with empty protocol are skipped</h1>
<style>
.fail {
background-color: red;
}

.succeed {
background-color: green;
}
</style>
<script>
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('value');
if (myParam === "web+testing://test-url/") {
document.body.classList.add("succeed");
} else {
document.body.classList.add("fail");
}

</script>
<p>
To pass, when launching the application via web+testing://test-url/,
the background color must be green.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Protocol_handlers Empty Protocol Test",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+testing",
"url": "protocol_handlers-member-skip-for-empty-protocol-manual.tentative.html?value=%s"
},
{
"protocol": "",
"url": "protocol_handlers-member-skip-for-empty-protocol-manual.tentative.html?value=%s"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Test that protocol_handlers items with empty url are skipped</title>
<link rel="manifest" href="protocol_handlers-member-skip-for-empty-url.webmanifest" />
<h1>Test that protocol_handlers items with empty url are skipped</h1>
<style>
.fail {
background-color: red;
}

.succeed {
background-color: green;
}
</style>
<script>
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('value');
if (myParam === "web+testing://test-url/") {
document.body.classList.add("succeed");
} else {
document.body.classList.add("fail");
}

</script>
<p>
To pass, when launching the application via web+testing://test-url/,
the background color must be green.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Protocol_handlers Empty URL Test",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+testing",
"url": "protocol_handlers-member-skip-for-empty-url-manual.tentative.html?value=%s"
},
{
"protocol": "web+empty",
"url": ""
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Test that protocol_handlers items with invalid url are skipped</title>
<link rel="manifest" href="protocol_handlers-member-skip-for-invalid-url.webmanifest" />
<h1>Test that protocol_handlers items with invalid url are skipped</h1>
<style>
.fail {
background-color: red;
}

.succeed {
background-color: green;
}
</style>
<script>
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('value');
if (myParam === "web+testing://test-url/") {
document.body.classList.add("succeed");
} else {
document.body.classList.add("fail");
}

</script>
<p>
To pass, when launching the application via web+testing://test-url/,
the background color must be green.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Protocol_handlers Invalid URL Test",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+testing",
"url": "protocol_handlers-member-skip-for-invalid-url-manual.tentative.html?value=%s"
},
{
"protocol": "web+invalid",
"url": "http://foo:660000/?%s"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Test that protocol_handlers items with out of scope url are skipped</title>
<link rel="manifest" href="protocol_handlers-member-skip-for-out-of-scope-url.webmanifest" />
<h1>Test that protocol_handlers items with out of scope url are skipped</h1>
<style>
.fail {
background-color: red;
}

.succeed {
background-color: green;
}
</style>
<script>
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('value');
if (myParam === "web+testing://test-url/") {
document.body.classList.add("succeed");
} else {
document.body.classList.add("fail");
}

</script>
<p>
To pass, when launching the application via web+testing://test-url/,
the background color must be green.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Protocol_handlers Out of Scope URL Test",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+testing",
"url": "protocol_handlers-member-skip-for-out-of-scope-url-manual.tentative.html?value=%s"
},
{
"protocol": "web+outofscope",
"url": "https://foo.com/q=%s"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Protocol_handlers test",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+testing",
"url": "protocol_handlers-member-manual.html?value=%s"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8

0 comments on commit 5a69a61

Please sign in to comment.