Skip to content

Commit

Permalink
"javascript:" urls: add web-platform-test
Browse files Browse the repository at this point in the history
  • Loading branch information
archive64 committed Aug 23, 2017
1 parent fa3e9ab commit af41769
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/wpt/metadata/MANIFEST.json
Expand Up @@ -359897,6 +359897,12 @@
{}
]
],
"url/a-element-href-javascript.html": [
[
"/url/a-element-href-javascript.html",
{}
]
],
"url/a-element-origin-xhtml.xhtml": [
[
"/url/a-element-origin-xhtml.xhtml",
Expand Down Expand Up @@ -600978,6 +600984,10 @@
"3dacc2783865ba292f20b72bc4c3942de521d9b0",
"support"
],
"url/a-element-href-javascript.html": [
"567d16dde294a2f3e75fdb8139d1af9a8c73e0fc",
"testharness"
],
"url/a-element-origin-xhtml.xhtml": [
"56019fd2d3870324ba412e3e0c602bad3b90ef49",
"testharness"
Expand Down
28 changes: 28 additions & 0 deletions tests/wpt/web-platform-tests/url/a-element-href-javascript.html
@@ -0,0 +1,28 @@
<!doctype html>
<meta charset=utf-8>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>

<script>
var linkStatus = 'link not clicked';

function changeStatus() {
linkStatus = 'link has been clicked';
}
</script>

<a id="javascript-link" href="javascript:changeStatus()">link</a>

<script>
setup({explicit_done:true});

document.querySelector("#javascript-link").click();

step_timeout(function() {
test(function() {
assert_equals(linkStatus, "link has been clicked");
}, "javascript: scheme urls should be executed in correct global scope");

done();
});
</script>

0 comments on commit af41769

Please sign in to comment.