Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/5c9d54d05b35f3f06261f8bf9c3a48d2293df767
...commit
http://git.netsurf-browser.org/netsurf.git/commit/5c9d54d05b35f3f06261f8bf9c3a48d2293df767
...tree
http://git.netsurf-browser.org/netsurf.git/tree/5c9d54d05b35f3f06261f8bf9c3a48d2293df767
The branch, master has been updated
via 5c9d54d05b35f3f06261f8bf9c3a48d2293df767 (commit)
via 095a0639d30b2683e028d632379bf7f7ac1ae6ae (commit)
via d196dee05b8dc5245da32629bc8f7759cf55a62a (commit)
from 9742a8317f66cc2802b3d92456ec0516a6de8c79 (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=5c9d54d05b35f3f06261f8bf9c3a48d2293df767
commit 5c9d54d05b35f3f06261f8bf9c3a48d2293df767
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Monkey: Properly support reload in farmer and driver
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 18d915f..7a1bd79 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -299,6 +299,15 @@ def run_test_step_action_stop(ctx, step):
win.stop()
+def run_test_step_action_reload(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
+ win.reload()
+
+
def run_test_step_action_sleep_ms(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
conds = step['conditions']
@@ -540,6 +549,7 @@ STEP_HANDLERS = {
"window-new": run_test_step_action_window_new,
"window-close": run_test_step_action_window_close,
"navigate": run_test_step_action_navigate,
+ "reload": run_test_step_action_reload,
"stop": run_test_step_action_stop,
"sleep-ms": run_test_step_action_sleep_ms,
"block": run_test_step_action_block,
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index e4c6543..f6497fa 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -426,8 +426,10 @@ class BrowserWindow:
def stop(self):
self.browser.farmer.tell_monkey("WINDOW STOP %s" % (self.winid))
- def reload(self):
- self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
+ def reload(self, all=False):
+ all = " ALL" if all else ""
+ self.browser.farmer.tell_monkey("WINDOW RELOAD %s%s" % (self.winid,
all))
+ self.wait_start_loading()
def js_exec(self, src):
self.browser.farmer.tell_monkey("WINDOW EXEC WIN %s %s" % (self.winid,
src))
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=095a0639d30b2683e028d632379bf7f7ac1ae6ae
commit 095a0639d30b2683e028d632379bf7f7ac1ae6ae
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Document.bnd: Fix cookies getter and implement setter
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/javascript/duktape/Document.bnd
b/content/handlers/javascript/duktape/Document.bnd
index bd02068..d9bff0a 100644
--- a/content/handlers/javascript/duktape/Document.bnd
+++ b/content/handlers/javascript/duktape/Document.bnd
@@ -374,7 +374,39 @@ getter Document::cookie()
if (cookie_str != NULL) {
duk_push_string(ctx, cookie_str);
free(cookie_str);
- return 1;
+ } else {
+ duk_push_string(ctx, "");
+ }
+ return 1;
+ } else {
+ NSLOG(netsurf, INFO,
+ "error getting htmlc. parent node:%p htmlc:%p",
+ priv->parent.node, htmlc);
+ }
+ return 0;
+%}
+
+setter Document::cookie()
+%{
+ struct html_content *htmlc;
+ dom_exception err;
+
+ const char * cookie_str = duk_safe_to_string(ctx, 0);
+
+ err = dom_node_get_user_data(priv->parent.node,
+ corestring_dom___ns_key_html_content_data,
+ &htmlc);
+ if ((err == DOM_NO_ERR) && (htmlc != NULL)) {
+ /* At this point we need to get the given cookie string parsed
+ * and inserted into the urldb
+ */
+ bool ok = urldb_set_cookie(cookie_str, /* The cookie string to
set */
+ /* The location to set the cookie
for */
+
llcache_handle_get_url(htmlc->base.llcache),
+ NULL); /* The referer, which we
trust */
+ if (!ok) {
+ NSLOG(netsurf, DEEPDEBUG, "unable to set cookie: %s",
cookie_str);
+ /* However there's no useful way to signal that to JS */
}
} else {
NSLOG(netsurf, INFO,
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=d196dee05b8dc5245da32629bc8f7759cf55a62a
commit d196dee05b8dc5245da32629bc8f7759cf55a62a
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
llcache: Use last_modified instead of date
When sending an If-Modified-Since header we should use the
`last_modified` rather than the `date` property of the cached
object in order to not incorrectly assume things have a modification
date when they do not.
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/llcache.c b/content/llcache.c
index 625e810..ff21d29 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -860,7 +860,7 @@ static nserror llcache_object_refetch(llcache_object
*object)
header_idx++;
}
- if (object->cache.date != 0) {
+ if (object->cache.last_modified != 0) {
/* Maximum length of an RFC 1123 date is 29 bytes */
const size_t len = SLEN("If-Modified-Since: ") + 29 + 1;
@@ -873,7 +873,7 @@ static nserror llcache_object_refetch(llcache_object
*object)
}
snprintf(headers[header_idx], len, "If-Modified-Since: %s",
- rfc1123_date(object->cache.date));
+ rfc1123_date(object->cache.last_modified));
header_idx++;
}
-----------------------------------------------------------------------
Summary of changes:
content/handlers/javascript/duktape/Document.bnd | 34 +++++++++++++++++++++-
content/llcache.c | 4 +--
test/monkey_driver.py | 10 +++++++
test/monkeyfarmer.py | 6 ++--
4 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/content/handlers/javascript/duktape/Document.bnd
b/content/handlers/javascript/duktape/Document.bnd
index bd02068..d9bff0a 100644
--- a/content/handlers/javascript/duktape/Document.bnd
+++ b/content/handlers/javascript/duktape/Document.bnd
@@ -374,7 +374,39 @@ getter Document::cookie()
if (cookie_str != NULL) {
duk_push_string(ctx, cookie_str);
free(cookie_str);
- return 1;
+ } else {
+ duk_push_string(ctx, "");
+ }
+ return 1;
+ } else {
+ NSLOG(netsurf, INFO,
+ "error getting htmlc. parent node:%p htmlc:%p",
+ priv->parent.node, htmlc);
+ }
+ return 0;
+%}
+
+setter Document::cookie()
+%{
+ struct html_content *htmlc;
+ dom_exception err;
+
+ const char * cookie_str = duk_safe_to_string(ctx, 0);
+
+ err = dom_node_get_user_data(priv->parent.node,
+ corestring_dom___ns_key_html_content_data,
+ &htmlc);
+ if ((err == DOM_NO_ERR) && (htmlc != NULL)) {
+ /* At this point we need to get the given cookie string parsed
+ * and inserted into the urldb
+ */
+ bool ok = urldb_set_cookie(cookie_str, /* The cookie string to
set */
+ /* The location to set the cookie
for */
+
llcache_handle_get_url(htmlc->base.llcache),
+ NULL); /* The referer, which we
trust */
+ if (!ok) {
+ NSLOG(netsurf, DEEPDEBUG, "unable to set cookie: %s",
cookie_str);
+ /* However there's no useful way to signal that to JS */
}
} else {
NSLOG(netsurf, INFO,
diff --git a/content/llcache.c b/content/llcache.c
index 625e810..ff21d29 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -860,7 +860,7 @@ static nserror llcache_object_refetch(llcache_object
*object)
header_idx++;
}
- if (object->cache.date != 0) {
+ if (object->cache.last_modified != 0) {
/* Maximum length of an RFC 1123 date is 29 bytes */
const size_t len = SLEN("If-Modified-Since: ") + 29 + 1;
@@ -873,7 +873,7 @@ static nserror llcache_object_refetch(llcache_object
*object)
}
snprintf(headers[header_idx], len, "If-Modified-Since: %s",
- rfc1123_date(object->cache.date));
+ rfc1123_date(object->cache.last_modified));
header_idx++;
}
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 18d915f..7a1bd79 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -299,6 +299,15 @@ def run_test_step_action_stop(ctx, step):
win.stop()
+def run_test_step_action_reload(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
+ win.reload()
+
+
def run_test_step_action_sleep_ms(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
conds = step['conditions']
@@ -540,6 +549,7 @@ STEP_HANDLERS = {
"window-new": run_test_step_action_window_new,
"window-close": run_test_step_action_window_close,
"navigate": run_test_step_action_navigate,
+ "reload": run_test_step_action_reload,
"stop": run_test_step_action_stop,
"sleep-ms": run_test_step_action_sleep_ms,
"block": run_test_step_action_block,
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index e4c6543..f6497fa 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -426,8 +426,10 @@ class BrowserWindow:
def stop(self):
self.browser.farmer.tell_monkey("WINDOW STOP %s" % (self.winid))
- def reload(self):
- self.browser.farmer.tell_monkey("WINDOW RELOAD %s" % self.winid)
+ def reload(self, all=False):
+ all = " ALL" if all else ""
+ self.browser.farmer.tell_monkey("WINDOW RELOAD %s%s" % (self.winid,
all))
+ self.wait_start_loading()
def js_exec(self, src):
self.browser.farmer.tell_monkey("WINDOW EXEC WIN %s %s" % (self.winid,
src))
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org