diff options
Diffstat (limited to 'tests/auto/httpserver/data')
-rw-r--r-- | tests/auto/httpserver/data/hedgehog.html | 9 | ||||
-rw-r--r-- | tests/auto/httpserver/data/hedgehog.png | bin | 0 -> 11273 bytes | |||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/downloadable.tar.gz | bin | 0 -> 131 bytes | |||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/main.html | 30 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page1.html | 8 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page2.html | 15 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page3.html | 20 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page4.html | 8 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page5.html | 20 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page6.html | 13 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page7.html | 13 | ||||
-rw-r--r-- | tests/auto/httpserver/data/loadprogress/page8.html | 20 | ||||
-rw-r--r-- | tests/auto/httpserver/data/notification.html | 70 |
13 files changed, 226 insertions, 0 deletions
diff --git a/tests/auto/httpserver/data/hedgehog.html b/tests/auto/httpserver/data/hedgehog.html new file mode 100644 index 000000000..d8abbcd48 --- /dev/null +++ b/tests/auto/httpserver/data/hedgehog.html @@ -0,0 +1,9 @@ +<!doctype html> +<html> + <head> + <title>BREAKING NEWS: 15 Hedgehogs With Things That Look Like Hedgehogs</title> + </head> + <body> + <img src="hedgehog.png"/> + </body> +</html> diff --git a/tests/auto/httpserver/data/hedgehog.png b/tests/auto/httpserver/data/hedgehog.png Binary files differnew file mode 100644 index 000000000..4d56d8633 --- /dev/null +++ b/tests/auto/httpserver/data/hedgehog.png diff --git a/tests/auto/httpserver/data/loadprogress/downloadable.tar.gz b/tests/auto/httpserver/data/loadprogress/downloadable.tar.gz Binary files differnew file mode 100644 index 000000000..741cb8ca6 --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/downloadable.tar.gz diff --git a/tests/auto/httpserver/data/loadprogress/main.html b/tests/auto/httpserver/data/loadprogress/main.html new file mode 100644 index 000000000..3b7d2034b --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/main.html @@ -0,0 +1,30 @@ +<html> +<head><title>Load Progress Test Page</title> + <style> + .monospace { font-family: "Lucida Console", Courier, monospace; } + </style> + <title>page1</title> + <script> + function addP(t) { + var p = document.createElement('p') + p.class = 'monospace' + p.innerHTML = t + var d = document.createElement('div') + d.appendChild(p) + document.body.appendChild(d) + } + window.addEventListener('DOMContentLoaded', (event) => { addP('DOMContentLoaded') }) + </script> +</head> +<body> + <h1>Hello.</h1> + <script> + addP('sometext') + </script> + <p class="monospace">body in monospace</p> + <iframe id="page1" src="page1.html"></iframe> + <iframe id="page2" src="page2.html"></iframe> + <iframe id="page3" src="page3.html"></iframe> + <iframe id="page4" src="page4.html"></iframe> +</body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page1.html b/tests/auto/httpserver/data/loadprogress/page1.html new file mode 100644 index 000000000..9b11ce887 --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page1.html @@ -0,0 +1,8 @@ +<html> + <head> + <title>page1</title> + </head> + <body> + <div><a href="page2.html#anchor">page2</a></div> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page2.html b/tests/auto/httpserver/data/loadprogress/page2.html new file mode 100644 index 000000000..223817c8c --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page2.html @@ -0,0 +1,15 @@ +<html> + <head> + <title>page2</title> + </head> + <style> + .fardown { + position: absolute; + top: 2500px; + } + </style> + <body> + <div><a href="#anchor">page2</a></div> + <div class="fardown" id="anchor">page2 anchor</div> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page3.html b/tests/auto/httpserver/data/loadprogress/page3.html new file mode 100644 index 000000000..d38ca31f0 --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page3.html @@ -0,0 +1,20 @@ +<html> + <head> + <title>page3</title> + </head> + <script> + setTimeout(function(){ + document.getElementById('anchorLink').click(); + },500); + </script> + <style> + .fardown { + position: absolute; + top: 2500px; + } + </style> + <body> + <div><a id="anchorLink" href="#anchor">page3</a></div> + <div class="fardown" id="anchor">page3 anchor</div> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page4.html b/tests/auto/httpserver/data/loadprogress/page4.html new file mode 100644 index 000000000..61976b4fb --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page4.html @@ -0,0 +1,8 @@ +<html> + <head> + <title>page4</title> + </head> + <body onload="document.getElementById('downloadLink').focus();"> + <a id="downloadLink" href="downloadable.tar.gz">download</a> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page5.html b/tests/auto/httpserver/data/loadprogress/page5.html new file mode 100644 index 000000000..47709ff08 --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page5.html @@ -0,0 +1,20 @@ +<html> + <head> + <title>page5</title> + </head> + <script> + addEventListener('DOMContentLoaded', (event) => { + document.getElementById('anchorLink').click(); + }); + </script> + <style> + .fardown { + position: absolute; + top: 2500px; + } + </style> + <body> + <div><a id="anchorLink" href="#anchor">go to the anchor</a></div> + <div class="fardown" id="anchor">here is the anchor</div> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page6.html b/tests/auto/httpserver/data/loadprogress/page6.html new file mode 100644 index 000000000..98042701a --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page6.html @@ -0,0 +1,13 @@ +<html> + <head> + <title>page6</title> + </head> + <script> + addEventListener('DOMContentLoaded', (event) => { + document.getElementById('anchorLink').click(); + }); + </script> + <body> + <div><a id="anchorLink" href="page2.html#anchor">go to another page</a></div> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page7.html b/tests/auto/httpserver/data/loadprogress/page7.html new file mode 100644 index 000000000..42538c5de --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page7.html @@ -0,0 +1,13 @@ +<html> + <head> + <title>page6</title> + </head> + <script> + setTimeout(function(){ + document.getElementById('anchorLink').click(); + },500); + </script> + <body> + <div><a id="anchorLink" href="page2.html#anchor">go to another page</a></div> + </body> +</html> diff --git a/tests/auto/httpserver/data/loadprogress/page8.html b/tests/auto/httpserver/data/loadprogress/page8.html new file mode 100644 index 000000000..8ebdddf97 --- /dev/null +++ b/tests/auto/httpserver/data/loadprogress/page8.html @@ -0,0 +1,20 @@ +<html> + <head> + <title>Page with js navigation in the end of document to anchor within the page</title> + </head> + <style> + .fardown { + position: absolute; + top: 2500px; + } + </style> + <body> + <div><a id="anchorLink" href="#anchor">go to the anchor</a></div> + <div class="fardown" id="anchor">here is the anchor</div> + <script> + addEventListener('load', (event) => { + window.location.replace(document.getElementById('anchorLink').href) + }) + </script> + </body> +</html> diff --git a/tests/auto/httpserver/data/notification.html b/tests/auto/httpserver/data/notification.html new file mode 100644 index 000000000..1d1e9c411 --- /dev/null +++ b/tests/auto/httpserver/data/notification.html @@ -0,0 +1,70 @@ +<!doctype html> +<html> +<head> +<title>Desktop Notifications Demo</title> +<script> + function resetPermission() { document.Notification = 'default' } + + function getPermission() { return document.Notification } + + function sendNotification(title, body) { + let notification = new Notification(title, { body: body, dir: 'rtl', lang: 'de', tag: 'tst' }) + notification.onclick = function() { console.info('onclick') } + notification.onclose = function() { console.info('onclose') } + notification.onerror = function(error) { console.info('onerror: ' + error) } + notification.onshow = function() { console.info('onshow') } + } + + function makeNotification() { + let title = document.getElementById("title").value + let body = document.getElementById("body").value + console.log('making notification:', title) + sendNotification(title, body) + } + + function requestPermission(callback) { + Notification.requestPermission().then(function (permission) { + document.Notification = permission + if (callback) + callback(permission) + }) + } + + function displayNotification() { + console.info('notifications are ' + document.Notification) + + let state = document.getElementById('state') + + if (document.Notification === 'denied') { + state.innerHTML = 'Notifications disabled' + } else if (document.Notification === 'granted') { + makeNotification() + state.innerHTML = 'notification created' + } else { + state.innerHTML = 'requesting permission...' + requestPermission(function (permission) { + console.info('notifications request: ' + permission) + if (permission === 'granted') { + makeNotification() + state.innerHTML = 'permission granted, notification created' + } else if (permission === 'denied') + state.innerHTML = 'Notifications are disabled' + }) + } + } + + document.addEventListener("DOMContentLoaded", function() { + document.Notification = Notification.permission + }) +</script> +</head> +<body> + <form name="NotificationForm" id="notificationForm"> + Title: <input type="text" id="title" placeholder="Notification title" value='sample title'><br> + Body: <input type="text" id="body" placeholder="Notification body" value='default body'><br> + <input type="button" value="Display Notification" onclick="displayNotification()"><br> + <input type="button" value="Reset Permission" onclick="resetPermission()"> + </form> + <div id='state'></div> +</body> +</html> |