summaryrefslogtreecommitdiff
path: root/Base
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-15 15:24:43 -0500
committerLinus Groh <mail@linusgroh.de>2022-11-16 17:23:56 +0000
commit894bddf62cc8da242017750f0f4690e9b461bc03 (patch)
tree27d325f4d380847bf4c157b8c5042eda49d822e5 /Base
parent4aeb1ffc1206e5c56e71ad34c8c27cddd9a5f4a5 (diff)
downloadserenity-894bddf62cc8da242017750f0f4690e9b461bc03.zip
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.
Diffstat (limited to 'Base')
-rw-r--r--Base/res/html/misc/prompt.html17
-rw-r--r--Base/res/html/misc/welcome.html1
2 files changed, 18 insertions, 0 deletions
diff --git a/Base/res/html/misc/prompt.html b/Base/res/html/misc/prompt.html
new file mode 100644
index 0000000000..bf485cb948
--- /dev/null
+++ b/Base/res/html/misc/prompt.html
@@ -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>
diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html
index 8c56941b46..cd36b35334 100644
--- a/Base/res/html/misc/welcome.html
+++ b/Base/res/html/misc/welcome.html
@@ -167,6 +167,7 @@
<li><a href="events.html">simple DOM events</a></li>
<li><a href="dom.html">simple DOM JS</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="innerHTML.html">innerHTML()</a></li>
<li><a href="demo.html">fun demo</a></li>