Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/09f6c50980f12a57ac79a8af8993b196e66d64f5
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/09f6c50980f12a57ac79a8af8993b196e66d64f5
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/09f6c50980f12a57ac79a8af8993b196e66d64f5

The branch, master has been updated
       via  09f6c50980f12a57ac79a8af8993b196e66d64f5 (commit)
      from  92caa16cfcd10ecc2024972fbef740fbdbd3254b (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=09f6c50980f12a57ac79a8af8993b196e66d64f5
commit 09f6c50980f12a57ac79a8af8993b196e66d64f5
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    monkey: Support testing page info state
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/test/monkey-tests/state-test.yaml 
b/test/monkey-tests/state-test.yaml
new file mode 100644
index 0000000..6f25a78
--- /dev/null
+++ b/test/monkey-tests/state-test.yaml
@@ -0,0 +1,69 @@
+title: Page state info test
+group: basic
+steps:
+- action: launch
+  language: en
+- action: window-new
+  tag: win1
+- action: navigate
+  window: win1
+  url: about:config
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: INTERNAL
+- action: navigate
+  window: win1
+  url: file:///
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: LOCAL
+- action: navigate
+  window: win1
+  url: http://test.netsurf-browser.org/html/trivial-document.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: INSECURE
+- action: navigate
+  window: win1
+  url: https://test.netsurf-browser.org/html/trivial-document.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: SECURE
+- action: navigate
+  window: win1
+  url: https://test.netsurf-browser.org/html/trivial-document-with-png.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: SECURE
+- action: navigate
+  window: win1
+  url: 
https://test.netsurf-browser.org/html/trivial-document-with-http-png.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: SECURE_ISSUES
+- action: quit
+
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index a442f4e..2a9234d 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -588,6 +588,16 @@ def run_test_step_action_js_exec(ctx, step):
     win.js_exec(cmd)
 
 
+def run_test_step_action_page_info_state(ctx, step):
+    print(get_indent(ctx) + "Action: " + step["action"])
+    assert_browser(ctx)
+    tag = step['window']
+    win = ctx['windows'].get(tag)
+    assert win is not None
+    match = step['match']
+    assert win.page_info_state == match
+
+
 def run_test_step_action_quit(ctx, step):
     print(get_indent(ctx) + "Action: " + step["action"])
     assert_browser(ctx)
@@ -619,6 +629,8 @@ STEP_HANDLERS = {
     "clear-log":     run_test_step_action_clear_log,
     "wait-log":      run_test_step_action_wait_log,
     "js-exec":       run_test_step_action_js_exec,
+    "page-info-state":
+                     run_test_step_action_page_info_state,
     "quit":          run_test_step_action_quit,
 }
 
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index dcc3217..cbdda0c 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -406,6 +406,7 @@ class BrowserWindow:
         self.plotted = []
         self.plotting = False
         self.log_entries = []
+        self.page_info_state = "UNKNOWN"
 
     def kill(self):
         self.browser.farmer.tell_monkey("WINDOW DESTROY %s" % self.winid)
@@ -519,6 +520,9 @@ class BrowserWindow:
     def handle_window_CONSOLE_LOG(self, _src, src, folding, level, *msg):
         self.log_entries.append((src, folding == "FOLDABLE", level, " 
".join(msg)))
 
+    def handle_window_PAGE_STATUS(self, _status, status):
+        self.page_info_state = status
+
     def load_page(self, url=None, referer=None):
         if url is not None:
             self.go(url, referer)


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

Summary of changes:
 test/monkey-tests/state-test.yaml |   69 +++++++++++++++++++++++++++++++++++++
 test/monkey_driver.py             |   12 +++++++
 test/monkeyfarmer.py              |    4 +++
 3 files changed, 85 insertions(+)
 create mode 100644 test/monkey-tests/state-test.yaml

diff --git a/test/monkey-tests/state-test.yaml 
b/test/monkey-tests/state-test.yaml
new file mode 100644
index 0000000..6f25a78
--- /dev/null
+++ b/test/monkey-tests/state-test.yaml
@@ -0,0 +1,69 @@
+title: Page state info test
+group: basic
+steps:
+- action: launch
+  language: en
+- action: window-new
+  tag: win1
+- action: navigate
+  window: win1
+  url: about:config
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: INTERNAL
+- action: navigate
+  window: win1
+  url: file:///
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: LOCAL
+- action: navigate
+  window: win1
+  url: http://test.netsurf-browser.org/html/trivial-document.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: INSECURE
+- action: navigate
+  window: win1
+  url: https://test.netsurf-browser.org/html/trivial-document.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: SECURE
+- action: navigate
+  window: win1
+  url: https://test.netsurf-browser.org/html/trivial-document-with-png.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: SECURE
+- action: navigate
+  window: win1
+  url: 
https://test.netsurf-browser.org/html/trivial-document-with-http-png.html
+- action: block
+  conditions:
+  - window: win1
+    status: complete
+- action: page-info-state
+  window: win1
+  match: SECURE_ISSUES
+- action: quit
+
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index a442f4e..2a9234d 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -588,6 +588,16 @@ def run_test_step_action_js_exec(ctx, step):
     win.js_exec(cmd)
 
 
+def run_test_step_action_page_info_state(ctx, step):
+    print(get_indent(ctx) + "Action: " + step["action"])
+    assert_browser(ctx)
+    tag = step['window']
+    win = ctx['windows'].get(tag)
+    assert win is not None
+    match = step['match']
+    assert win.page_info_state == match
+
+
 def run_test_step_action_quit(ctx, step):
     print(get_indent(ctx) + "Action: " + step["action"])
     assert_browser(ctx)
@@ -619,6 +629,8 @@ STEP_HANDLERS = {
     "clear-log":     run_test_step_action_clear_log,
     "wait-log":      run_test_step_action_wait_log,
     "js-exec":       run_test_step_action_js_exec,
+    "page-info-state":
+                     run_test_step_action_page_info_state,
     "quit":          run_test_step_action_quit,
 }
 
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index dcc3217..cbdda0c 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -406,6 +406,7 @@ class BrowserWindow:
         self.plotted = []
         self.plotting = False
         self.log_entries = []
+        self.page_info_state = "UNKNOWN"
 
     def kill(self):
         self.browser.farmer.tell_monkey("WINDOW DESTROY %s" % self.winid)
@@ -519,6 +520,9 @@ class BrowserWindow:
     def handle_window_CONSOLE_LOG(self, _src, src, folding, level, *msg):
         self.log_entries.append((src, folding == "FOLDABLE", level, " 
".join(msg)))
 
+    def handle_window_PAGE_STATUS(self, _status, status):
+        self.page_info_state = status
+
     def load_page(self, url=None, referer=None):
         if url is not None:
             self.go(url, referer)


-- 
NetSurf Browser

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

Reply via email to