Skip to content

Commit

Permalink
Add a few more picture tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed Jul 8, 2020
1 parent a69d3b1 commit ed26ec1
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, document.write(): picture-source-br-img</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/html/syntax/preload-scanner.tentative/resources/preload-scanner-util.js></script>
<script>
setup({single_test: true});
const uuid = token();
expect_fetched_onload(uuid, true).then(done);
document.write(`
<script src=/common/slow.py><\/script>
<script>
document.write('<plaintext>');
<\/script>
<picture><source srcset=/html/syntax/preload-scanner.tentative/resources/stash.py?action=put&uuid=${uuid}><br><img></picture>
`);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, document.write(): picture-source-nomatch-media</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/html/syntax/preload-scanner.tentative/resources/preload-scanner-util.js></script>
<script>
setup({single_test: true});
const uuid = token();
expect_fetched_onload(uuid, false).then(done);
document.write(`
<script src=/common/slow.py><\/script>
<script>
document.write('<plaintext>');
<\/script>
<picture><source srcset=/html/syntax/preload-scanner.tentative/resources/stash.py?action=put&uuid=${uuid} media="not all"><img></picture>
`);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, document.write(): picture-source-unsupported-type</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/html/syntax/preload-scanner.tentative/resources/preload-scanner-util.js></script>
<script>
setup({single_test: true});
const uuid = token();
expect_fetched_onload(uuid, false).then(done);
document.write(`
<script src=/common/slow.py><\/script>
<script>
document.write('<plaintext>');
<\/script>
<picture><source srcset=/html/syntax/preload-scanner.tentative/resources/stash.py?action=put&uuid=${uuid} type=text/plain><img></picture>
`);
</script>

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, page load: picture-source-br-img</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/html/syntax/preload-scanner.tentative/resources/preload-scanner-util.js></script>
<body>
<script>
setup({single_test: true});
const uuid = token();
const iframe = document.createElement('iframe');
iframe.src = `resources/picture-source-br-img-framed.sub.html?uuid=${uuid}`;
document.body.appendChild(iframe);
expect_fetched_onload(uuid, true).then(done);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, page load: picture-source-nomatch-media</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/html/syntax/preload-scanner.tentative/resources/preload-scanner-util.js></script>
<body>
<script>
setup({single_test: true});
const uuid = token();
const iframe = document.createElement('iframe');
iframe.src = `resources/picture-source-nomatch-media-framed.sub.html?uuid=${uuid}`;
document.body.appendChild(iframe);
expect_fetched_onload(uuid, false).then(done);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, page load: picture-source-unsupported-type</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/utils.js></script>
<script src=/html/syntax/preload-scanner.tentative/resources/preload-scanner-util.js></script>
<body>
<script>
setup({single_test: true});
const uuid = token();
const iframe = document.createElement('iframe');
iframe.src = `resources/picture-source-unsupported-type-framed.sub.html?uuid=${uuid}`;
document.body.appendChild(iframe);
expect_fetched_onload(uuid, false).then(done);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, page load (helper file): picture-source-br-img</title>
<script src=/common/slow.py></script>
<script>
document.write('<plaintext>');
</script>
<picture><source srcset=/html/syntax/preload-scanner.tentative/resources/stash.py?action=put&uuid={{GET[uuid]}}><br><img></picture>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, page load (helper file): picture-source-nomatch-media</title>
<script src=/common/slow.py></script>
<script>
document.write('<plaintext>');
</script>
<picture><source srcset=/html/syntax/preload-scanner.tentative/resources/stash.py?action=put&uuid={{GET[uuid]}} media="not all"><img></picture>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset=utf-8>
<!-- DO NOT EDIT! This file has been generated by /html/syntax/preload-scanner.tentative/tools/generate.py. -->
<title>Preload scanner, page load (helper file): picture-source-unsupported-type</title>
<script src=/common/slow.py></script>
<script>
document.write('<plaintext>');
</script>
<picture><source srcset=/html/syntax/preload-scanner.tentative/resources/stash.py?action=put&uuid={{GET[uuid]}} type=text/plain><img></picture>
3 changes: 3 additions & 0 deletions html/syntax/preload-scanner.tentative/tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
(u'script-src', u'<script src={}></script>', u'true'),
(u'script-src-unsupported-type', u'<script src={} type=text/plain></script>', u'false'),
(u'img-src', u'<img src={}>', u'true'),
(u'picture-source-unsupported-type', u'<picture><source srcset={} type=text/plain><img></picture>', u'false'),
(u'picture-source-nomatch-media', u'<picture><source srcset={} media="not all"><img></picture>', u'false'),
(u'picture-source-no-img', u'<picture><source srcset={}></picture>', u'false'),
(u'picture-source-br-img', u'<picture><source srcset={}><br><img></picture>', u'true'),
]

preamble = u"""<!DOCTYPE html>
Expand Down

0 comments on commit ed26ec1

Please sign in to comment.