mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +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>
|
Loading…
Add table
Add a link
Reference in a new issue