Skip to content

Commit

Permalink
test: do not use quirks mode for test files (#11930)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN authored Feb 16, 2024
1 parent eea5884 commit aef584c
Show file tree
Hide file tree
Showing 54 changed files with 54 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/assets/abort-request.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<button id="abort"></button>

<script>
Expand Down
1 change: 1 addition & 0 deletions test/assets/beforeunload.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<div>beforeunload demo.</div>
<script>
window.addEventListener('beforeunload', event => {
Expand Down
1 change: 1 addition & 0 deletions test/assets/cached/bfcache/worker-iframe-container.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<body>BFCached<a href="target.html">next</a></body>
<script>
window.addEventListener('DOMContentLoaded', () => {
Expand Down
1 change: 1 addition & 0 deletions test/assets/cached/bfcache/worker-iframe.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
const worker = new Worker('worker.mjs', {type: 'module'})
</script>
1 change: 1 addition & 0 deletions test/assets/cached/one-style-font.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./one-style-font.css'>
<div>hello, world!</div>
1 change: 1 addition & 0 deletions test/assets/cached/one-style.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./one-style.css'>
<div>hello, world!</div>
1 change: 1 addition & 0 deletions test/assets/csp.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
1 change: 1 addition & 0 deletions test/assets/csscoverage/empty.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style></style>
<div>empty style tag</div>

1 change: 1 addition & 0 deletions test/assets/csscoverage/involved.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
@charset "utf-8";
@namespace svg url(http://www.w3.org/2000/svg);
Expand Down
1 change: 1 addition & 0 deletions test/assets/csscoverage/media.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
@media screen { div { color: green; } } </style>
<div>hello, world</div>
Expand Down
1 change: 1 addition & 0 deletions test/assets/csscoverage/multiple.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<link rel="stylesheet" href="stylesheet1.css">
<link rel="stylesheet" href="stylesheet2.css">
<script>
Expand Down
1 change: 1 addition & 0 deletions test/assets/csscoverage/simple.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
div { color: green; }
a { color: blue; }
Expand Down
1 change: 1 addition & 0 deletions test/assets/csscoverage/sourceurl.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
body {
padding: 10px;
Expand Down
1 change: 1 addition & 0 deletions test/assets/csscoverage/unused.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
@media screen {
a { color: green; }
Expand Down
1 change: 1 addition & 0 deletions test/assets/dynamic-oopif.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe');
Expand Down
1 change: 1 addition & 0 deletions test/assets/empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html>
1 change: 1 addition & 0 deletions test/assets/error.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
a();

Expand Down
1 change: 1 addition & 0 deletions test/assets/frames/frame.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./style.css'>
<script src='./script.js' type='text/javascript'></script>
<style>
Expand Down
1 change: 1 addition & 0 deletions test/assets/frames/frameset.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<frameset>
<frameset>
<frame src='./frame.html'></frame>
Expand Down
1 change: 1 addition & 0 deletions test/assets/frames/lazy-frame.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<iframe width="100%" height="300" src="about:blank"></iframe>
<div style="height: 800vh"></div>
<iframe width="100%" height="300" src='./frame.html' loading="lazy"></iframe>
1 change: 1 addition & 0 deletions test/assets/frames/nested-frames.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
:root {
scrollbar-width: none;
Expand Down
1 change: 1 addition & 0 deletions test/assets/frames/one-frame-url-fragment.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<iframe src='./frame.html?param=value#fragment'></iframe>
1 change: 1 addition & 0 deletions test/assets/frames/one-frame.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<iframe src='./frame.html'></iframe>
1 change: 1 addition & 0 deletions test/assets/frames/two-frames.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
body {
display: flex;
Expand Down
1 change: 1 addition & 0 deletions test/assets/global-var.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
var globalVar = 123;
</script>
1 change: 1 addition & 0 deletions test/assets/grid.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
document.addEventListener('DOMContentLoaded', function() {
function generatePalette(amount) {
Expand Down
1 change: 1 addition & 0 deletions test/assets/historyapi.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
window.addEventListener('DOMContentLoaded', () => {
history.pushState({}, '', '#1');
Expand Down
1 change: 1 addition & 0 deletions test/assets/initiator.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<iframe src="./frames/frame.html"></iframe>
<script src="./initiator.js"></script>
1 change: 1 addition & 0 deletions test/assets/inner-frame1.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe');
Expand Down
1 change: 1 addition & 0 deletions test/assets/inner-frame2.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<button>click</button>
2 changes: 1 addition & 1 deletion test/assets/input/touchscreen.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<title>Touch test</title>
Expand Down
1 change: 1 addition & 0 deletions test/assets/jscoverage/eval.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<script>eval('console.log("foo")')</script>
1 change: 1 addition & 0 deletions test/assets/jscoverage/involved.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
function foo() {
if (1 > 2)
Expand Down
1 change: 1 addition & 0 deletions test/assets/jscoverage/multiple.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<script src='script1.js'></script>
<script src='script2.js'></script>
1 change: 1 addition & 0 deletions test/assets/jscoverage/ranges.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<script>
function unused(){}console.log('used!');if(true===false)console.log('unused!');</script>
1 change: 1 addition & 0 deletions test/assets/jscoverage/simple.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<script>
function foo() {function bar() { } console.log(1); } foo(); </script>
1 change: 1 addition & 0 deletions test/assets/jscoverage/sourceurl.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
console.log(1);
//# sourceURL=nicename.js
Expand Down
1 change: 1 addition & 0 deletions test/assets/jscoverage/unused.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<script>function foo() { }</script>
1 change: 1 addition & 0 deletions test/assets/lazy-oopif-frame.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<iframe width="100%" height="300" src="about:blank"></iframe>
<div style="height: 800vh"></div>
<iframe width="100%" height="300" src="https://www.example.com" loading="lazy"></iframe>
1 change: 1 addition & 0 deletions test/assets/main-frame.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe');
Expand Down
1 change: 1 addition & 0 deletions test/assets/mobile.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
1 change: 1 addition & 0 deletions test/assets/networkidle.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
async function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, delay));
Expand Down
1 change: 1 addition & 0 deletions test/assets/one-style.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./one-style.css'>
<div>hello, world!</div>
1 change: 1 addition & 0 deletions test/assets/oopif.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<a id="navigate-within-document" href="#nav">Navigate within document</a>
<a name="nav"></a>
<script>
Expand Down
1 change: 1 addition & 0 deletions test/assets/p-selectors.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<div id="a">hello <button id="b">world</button>
<span id="f"></span>
<div id="c"></div>
Expand Down
1 change: 1 addition & 0 deletions test/assets/resetcss.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
Expand Down
1 change: 1 addition & 0 deletions test/assets/self-request.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
var req = new XMLHttpRequest();
req.open('GET', '/self-request.html');
Expand Down
1 change: 1 addition & 0 deletions test/assets/serviceworkers/empty/sw.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
window.registrationPromise = navigator.serviceWorker.register('sw.js');
</script>
1 change: 1 addition & 0 deletions test/assets/serviceworkers/fetch/sw.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<link rel="stylesheet" href="./style.css">
<script>
window.registrationPromise = navigator.serviceWorker.register('sw.js');
Expand Down
1 change: 1 addition & 0 deletions test/assets/shadow.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>

let h1 = null;
Expand Down
1 change: 1 addition & 0 deletions test/assets/tamperable.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<script>
window.result = window.injected;
</script>
1 change: 1 addition & 0 deletions test/assets/title.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<!DOCTYPE html>
<title>Woof-Woof</title>
1 change: 1 addition & 0 deletions test/assets/wrappedlink.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
:root {
font-family: monospace;
Expand Down
2 changes: 1 addition & 1 deletion test/src/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ describe('Page', function () {
page.goto(server.PREFIX + '/error.html'),
]);
expect(error.message).toContain('Fancy');
expect(error.stack?.split('\n')[1]).toContain('error.html:13');
expect(error.stack?.split('\n').at(-1)).toContain('error.html:3:1');
});
});

Expand Down

0 comments on commit aef584c

Please sign in to comment.