-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dwpas: Add tentative WPT tests for protocol_handler
Adding manual WPT tests for new protocol_handler field. w3c/manifest#846 Bug: 1019239 Change-Id: I49bbcae9ff1925fb2799d1462fca936147f2e118
- Loading branch information
1 parent
cc6b991
commit 5a69a61
Showing
15 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
27 changes: 27 additions & 0 deletions
27
...ol_handlers-member/protocol_handlers-member-skip-for-empty-protocol-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
14 changes: 14 additions & 0 deletions
14
...est/protocol_handlers-member/protocol_handlers-member-skip-for-empty-protocol.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ocol_handlers-member/protocol_handlers-member-skip-for-empty-protocol.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
27 changes: 27 additions & 0 deletions
27
...rotocol_handlers-member/protocol_handlers-member-skip-for-empty-url-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
14 changes: 14 additions & 0 deletions
14
appmanifest/protocol_handlers-member/protocol_handlers-member-skip-for-empty-url.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
.../protocol_handlers-member/protocol_handlers-member-skip-for-empty-url.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
27 changes: 27 additions & 0 deletions
27
...tocol_handlers-member/protocol_handlers-member-skip-for-invalid-url-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
14 changes: 14 additions & 0 deletions
14
...nifest/protocol_handlers-member/protocol_handlers-member-skip-for-invalid-url.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...rotocol_handlers-member/protocol_handlers-member-skip-for-invalid-url.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
27 changes: 27 additions & 0 deletions
27
..._handlers-member/protocol_handlers-member-skip-for-out-of-scope-url-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
14 changes: 14 additions & 0 deletions
14
...t/protocol_handlers-member/protocol_handlers-member-skip-for-out-of-scope-url.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
...ol_handlers-member/protocol_handlers-member-skip-for-out-of-scope-url.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
9 changes: 9 additions & 0 deletions
9
appmanifest/protocol_handlers-member/protocol_handlers-member.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}] | ||
} |
1 change: 1 addition & 0 deletions
1
appmanifest/protocol_handlers-member/protocol_handlers-member.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |