Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/1736bdcfee86a776ab3a9a6b74b2f9646688bb9c
...commit
http://git.netsurf-browser.org/netsurf.git/commit/1736bdcfee86a776ab3a9a6b74b2f9646688bb9c
...tree
http://git.netsurf-browser.org/netsurf.git/tree/1736bdcfee86a776ab3a9a6b74b2f9646688bb9c
The branch, master has been updated
via 1736bdcfee86a776ab3a9a6b74b2f9646688bb9c (commit)
from a43b83de0369228b935b693390186e5a8804340d (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.git/commit/?id=1736bdcfee86a776ab3a9a6b74b2f9646688bb9c
commit 1736bdcfee86a776ab3a9a6b74b2f9646688bb9c
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Add js-exec to monkey_driver, add a test, etc.
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/test/monkey-tests/inserted-script.yaml
b/test/monkey-tests/inserted-script.yaml
index b2f8fbf..ac7bb0f 100644
--- a/test/monkey-tests/inserted-script.yaml
+++ b/test/monkey-tests/inserted-script.yaml
@@ -10,7 +10,14 @@ steps:
window: win1
- action: navigate
window: win1
- url:
file:///home/dsilvers/dev-netsurf/workspace/netsurf/test/js/inserted-script.html
+ url: about:blank
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: js-exec
+ window: win1
+ cmd:
location.assign("file:///home/dsilvers/dev-netsurf/workspace/netsurf/test/js/inserted-script.html")
- action: block
conditions:
- window: win1
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 9f33160..c39d5e6 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -315,6 +315,18 @@ def run_test_step_action_wait_log(ctx, step):
win.wait_for_log(source=source, foldable=foldable, level=level,
substr=substr)
+def run_test_step_action_js_exec(ctx, step):
+ print(get_indent(ctx) + "Action: " + step["action"])
+ assert_browser(ctx)
+ browser = ctx['browser']
+ tag = step['window']
+ cmd = step['cmd']
+ print(get_indent(ctx) + " " + tag + " Run " + cmd)
+ win = ctx['windows'].get(tag)
+ assert(win is not None)
+ win.js_exec(cmd)
+
+
def run_test_step_action_quit(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
assert_browser(ctx)
@@ -338,6 +350,7 @@ step_handlers = {
"remove-auth": run_test_step_action_remove_auth,
"clear-log": run_test_step_action_clear_log,
"wait-log": run_test_step_action_wait_log,
+ "js-exec": run_test_step_action_js_exec,
"quit": run_test_step_action_quit,
}
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index 6cc7ec1..0bae027 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -306,7 +306,10 @@ class BrowserWindow:
def reload(self):
self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
-
+
+ def js_exec(self, src):
+ self.browser.farmer.tell_monkey("WINDOW EXEC WIN %s %s" % (self.winid,
src))
+
def handle(self, action, *args):
handler = getattr(self, "handle_window_" + action, None)
if handler is not None:
-----------------------------------------------------------------------
Summary of changes:
test/monkey-tests/inserted-script.yaml | 9 ++++++++-
test/monkey_driver.py | 13 +++++++++++++
test/monkeyfarmer.py | 5 ++++-
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/test/monkey-tests/inserted-script.yaml
b/test/monkey-tests/inserted-script.yaml
index b2f8fbf..ac7bb0f 100644
--- a/test/monkey-tests/inserted-script.yaml
+++ b/test/monkey-tests/inserted-script.yaml
@@ -10,7 +10,14 @@ steps:
window: win1
- action: navigate
window: win1
- url:
file:///home/dsilvers/dev-netsurf/workspace/netsurf/test/js/inserted-script.html
+ url: about:blank
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: js-exec
+ window: win1
+ cmd:
location.assign("file:///home/dsilvers/dev-netsurf/workspace/netsurf/test/js/inserted-script.html")
- action: block
conditions:
- window: win1
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 9f33160..c39d5e6 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -315,6 +315,18 @@ def run_test_step_action_wait_log(ctx, step):
win.wait_for_log(source=source, foldable=foldable, level=level,
substr=substr)
+def run_test_step_action_js_exec(ctx, step):
+ print(get_indent(ctx) + "Action: " + step["action"])
+ assert_browser(ctx)
+ browser = ctx['browser']
+ tag = step['window']
+ cmd = step['cmd']
+ print(get_indent(ctx) + " " + tag + " Run " + cmd)
+ win = ctx['windows'].get(tag)
+ assert(win is not None)
+ win.js_exec(cmd)
+
+
def run_test_step_action_quit(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
assert_browser(ctx)
@@ -338,6 +350,7 @@ step_handlers = {
"remove-auth": run_test_step_action_remove_auth,
"clear-log": run_test_step_action_clear_log,
"wait-log": run_test_step_action_wait_log,
+ "js-exec": run_test_step_action_js_exec,
"quit": run_test_step_action_quit,
}
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index 6cc7ec1..0bae027 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -306,7 +306,10 @@ class BrowserWindow:
def reload(self):
self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
-
+
+ def js_exec(self, src):
+ self.browser.farmer.tell_monkey("WINDOW EXEC WIN %s %s" % (self.winid,
src))
+
def handle(self, action, *args):
handler = getattr(self, "handle_window_" + action, None)
if handler is not None:
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org