mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
Base: Add a simple test page for window.prompt
The window prototypes alert, confirm, and prompt must "pause" execution until a response is received from the user. This test page is meant to ensure that a timeout queued before a prompt is not executed until after that prompt is closed.
This commit is contained in:
parent
4aeb1ffc12
commit
894bddf62c
2 changed files with 18 additions and 0 deletions
17
Base/res/html/misc/prompt.html
Normal file
17
Base/res/html/misc/prompt.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<pre id=message></pre>
|
||||||
|
<script>
|
||||||
|
const closed = (message) => {
|
||||||
|
console.log(message);
|
||||||
|
document.getElementById('message').innerHTML = `Message: "${message}"\n`;
|
||||||
|
};
|
||||||
|
|
||||||
|
setTimeout(() => { console.log('This must not appear until after the prompt is closed.'); }, 1000);
|
||||||
|
closed(prompt("Hello friends!"));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -167,6 +167,7 @@
|
||||||
<li><a href="events.html">simple DOM events</a></li>
|
<li><a href="events.html">simple DOM events</a></li>
|
||||||
<li><a href="dom.html">simple DOM JS</a></li>
|
<li><a href="dom.html">simple DOM JS</a></li>
|
||||||
<li><a href="alert.html">alert()</a></li>
|
<li><a href="alert.html">alert()</a></li>
|
||||||
|
<li><a href="prompt.html">prompt()</a></li>
|
||||||
<li><a href="qsa.html">querySelectorAll()</a></li>
|
<li><a href="qsa.html">querySelectorAll()</a></li>
|
||||||
<li><a href="innerHTML.html">innerHTML()</a></li>
|
<li><a href="innerHTML.html">innerHTML()</a></li>
|
||||||
<li><a href="demo.html">fun demo</a></li>
|
<li><a href="demo.html">fun demo</a></li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue