Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf-test.git/shortlog/7daf034fd94a8a07f9cbb5d070a085de69d184fd
...commit 
http://git.netsurf-browser.org/netsurf-test.git/commit/7daf034fd94a8a07f9cbb5d070a085de69d184fd
...tree 
http://git.netsurf-browser.org/netsurf-test.git/tree/7daf034fd94a8a07f9cbb5d070a085de69d184fd

The branch, master has been updated
       via  7daf034fd94a8a07f9cbb5d070a085de69d184fd (commit)
      from  e995422137ad124718c97326e205ce531d8b0536 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf-test.git/commit/?id=7daf034fd94a8a07f9cbb5d070a085de69d184fd
commit 7daf034fd94a8a07f9cbb5d070a085de69d184fd
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    Async delayed hello world, first draft
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/cgi-bin/and-then-js-async-cb-adds-timeout.js 
b/cgi-bin/and-then-js-async-cb-adds-timeout.js
new file mode 100644
index 0000000..b53678b
--- /dev/null
+++ b/cgi-bin/and-then-js-async-cb-adds-timeout.js
@@ -0,0 +1,11 @@
+/* JS returned by and-then-js.cgi
+ * this is to be loaded as an async script
+ */
+
+/* After one second */
+setTimeout(1000, function() {
+    /* Add a <script> tag */
+    var script = document.createElement("SCRIPT");
+    script.src = "https://test.netsurf-browser.org/hello-world.js";;
+    document.body.appendChild(script);
+});
diff --git a/cgi-bin/and-then-js.cgi b/cgi-bin/and-then-js.cgi
new file mode 100755
index 0000000..1930df3
--- /dev/null
+++ b/cgi-bin/and-then-js.cgi
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+import cgi
+import cgitb
+import os
+import time
+
+cgitb.enable()
+
+qs = cgi.parse_qs(os.getenv("QUERY_STRING", "t=1&val=async-cb-adds-timeout"))
+
+content = qs.get("val", ["async-cb-adds-timeout"])[0]
+
+print("Content-Type: text/javascript")
+print("")
+
+sleep_time = int(qs.get("t", [1])[0])
+
+print("{}Sleeping for {} seconds".format(prefix, sleep_time))
+
+time.sleep(sleep_time)
+
+print("{}Done sleeping {} seconds".format(prefix,sleep_time))
+
diff --git a/html/async-delayed-hello-world.html 
b/html/async-delayed-hello-world.html
new file mode 100644
index 0000000..a2cbc20
--- /dev/null
+++ b/html/async-delayed-hello-world.html
@@ -0,0 +1,9 @@
+<html>
+  <head>
+    <title>Hello World</title>
+    <script 
src="https://test.netsurf-browser.org/cgi-bin/and-then-js.cgi?t=5&val=async-cb-adds-timeout";></script>
+  </head>
+  <body>
+    <h1>Check the console for a hello world log</h1>
+  </body>
+</html>
diff --git a/html/hello-world.js b/html/hello-world.js
new file mode 100644
index 0000000..03a10db
--- /dev/null
+++ b/html/hello-world.js
@@ -0,0 +1,3 @@
+/* Hello World */
+
+console.log("Hello World")


-----------------------------------------------------------------------

Summary of changes:
 cgi-bin/and-then-js-async-cb-adds-timeout.js |   11 +++++++++++
 cgi-bin/and-then-js.cgi                      |   24 ++++++++++++++++++++++++
 html/async-delayed-hello-world.html          |    9 +++++++++
 html/hello-world.js                          |    3 +++
 4 files changed, 47 insertions(+)
 create mode 100644 cgi-bin/and-then-js-async-cb-adds-timeout.js
 create mode 100755 cgi-bin/and-then-js.cgi
 create mode 100644 html/async-delayed-hello-world.html
 create mode 100644 html/hello-world.js

diff --git a/cgi-bin/and-then-js-async-cb-adds-timeout.js 
b/cgi-bin/and-then-js-async-cb-adds-timeout.js
new file mode 100644
index 0000000..b53678b
--- /dev/null
+++ b/cgi-bin/and-then-js-async-cb-adds-timeout.js
@@ -0,0 +1,11 @@
+/* JS returned by and-then-js.cgi
+ * this is to be loaded as an async script
+ */
+
+/* After one second */
+setTimeout(1000, function() {
+    /* Add a <script> tag */
+    var script = document.createElement("SCRIPT");
+    script.src = "https://test.netsurf-browser.org/hello-world.js";;
+    document.body.appendChild(script);
+});
diff --git a/cgi-bin/and-then-js.cgi b/cgi-bin/and-then-js.cgi
new file mode 100755
index 0000000..1930df3
--- /dev/null
+++ b/cgi-bin/and-then-js.cgi
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+import cgi
+import cgitb
+import os
+import time
+
+cgitb.enable()
+
+qs = cgi.parse_qs(os.getenv("QUERY_STRING", "t=1&val=async-cb-adds-timeout"))
+
+content = qs.get("val", ["async-cb-adds-timeout"])[0]
+
+print("Content-Type: text/javascript")
+print("")
+
+sleep_time = int(qs.get("t", [1])[0])
+
+print("{}Sleeping for {} seconds".format(prefix, sleep_time))
+
+time.sleep(sleep_time)
+
+print("{}Done sleeping {} seconds".format(prefix,sleep_time))
+
diff --git a/html/async-delayed-hello-world.html 
b/html/async-delayed-hello-world.html
new file mode 100644
index 0000000..a2cbc20
--- /dev/null
+++ b/html/async-delayed-hello-world.html
@@ -0,0 +1,9 @@
+<html>
+  <head>
+    <title>Hello World</title>
+    <script 
src="https://test.netsurf-browser.org/cgi-bin/and-then-js.cgi?t=5&val=async-cb-adds-timeout";></script>
+  </head>
+  <body>
+    <h1>Check the console for a hello world log</h1>
+  </body>
+</html>
diff --git a/html/hello-world.js b/html/hello-world.js
new file mode 100644
index 0000000..03a10db
--- /dev/null
+++ b/html/hello-world.js
@@ -0,0 +1,3 @@
+/* Hello World */
+
+console.log("Hello World")


-- 
NetSurf test cases

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to