Commit a43f5e08 authored by Roque's avatar Roque

erp5_officejs: attempt to fix unit test appcache sync

parent 7a1b1bc2
...@@ -229,7 +229,7 @@ gadget_officejs_discussion_tool_router.html\n ...@@ -229,7 +229,7 @@ gadget_officejs_discussion_tool_router.html\n
/\n /\n
app/\n app/\n
gadget_officejs_discussion_tool.configuration\n gadget_officejs_discussion_tool.configuration\n
app/gadget_officejs_discussion_tool.configuration\n #app/gadget_officejs_discussion_tool.configuration\n
gadget_officejs_discussion_tool.json\n gadget_officejs_discussion_tool.json\n
gadget_officejs_bootloader.js\n gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n gadget_officejs_bootloader_presentation.html\n
...@@ -734,7 +734,7 @@ NETWORK:\n ...@@ -734,7 +734,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.29931.57668.55773</string> </value> <value> <string>974.30099.13229.45585</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -752,7 +752,7 @@ NETWORK:\n ...@@ -752,7 +752,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1553016192.1</float> <float>1553084611.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
this._take_installer = spec.take_installer || false; this._take_installer = spec.take_installer || false;
this._origin_url = spec.origin_url !== undefined ? this._origin_url = spec.origin_url !== undefined ?
spec.origin_url : window.location.href; spec.origin_url : window.location.href;
console.log("[DEBUG] APPCACHESTORAGE window.location.href:");
console.log(window.location.href);
this._version = spec.version || ""; this._version = spec.version || "";
this._prefix = spec.prefix || "./"; this._prefix = spec.prefix || "./";
this._documents = {}; this._documents = {};
...@@ -138,7 +140,14 @@ ...@@ -138,7 +140,14 @@
if (!error.message) { if (!error.message) {
console.log("error getting the manifest:"); console.log("error getting the manifest:");
console.log(error); console.log(error);
error.message = "Can't get manifest. URL: " + url; var info = " . ";
if (error.currentTarget) {
info += "status: " + error.currentTarget.status;
info += " . response: " + error.currentTarget.response;
} else {
info += "error.currentTarget: " + error.currentTarget;
}
error.message = "Can't get manifest. URL: " + url + info;
} }
throw error; throw error;
}); });
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.30192.60926.39594</string> </value> <value> <string>974.31277.33067.51916</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1553021879.69</float> <float>1553086893.39</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -75,7 +75,8 @@ ...@@ -75,7 +75,8 @@
.declareMethod('createJio', function (jio_options) { .declareMethod('createJio', function (jio_options) {
var gadget = this, var gadget = this,
origin_url = window.location.protocol + "//" + window.location.hostname + window.location.pathname, //origin_url = window.location.protocol + "//" + window.location.hostname + window.location.pathname,
origin_url = window.location.href,
prefix = "./", prefix = "./",
hateoas_script = "hateoas/ERP5Document_getHateoas", hateoas_script = "hateoas/ERP5Document_getHateoas",
// TODO manifest should come from gadget.props.cache_file -add script in html body // TODO manifest should come from gadget.props.cache_file -add script in html body
...@@ -103,12 +104,16 @@ ...@@ -103,12 +104,16 @@
local_sub_storage: {}, local_sub_storage: {},
remote_sub_storage: { remote_sub_storage: {
type: "appcache", type: "appcache",
manifest: manifest, manifest: manifest/*,
origin_url: origin_url origin_url: origin_url*/
} }
}, appcache_storage, }, appcache_storage,
sync_flag = "appcache-stored", sync_flag = "appcache-stored",
configuration_ids_dict = {}; configuration_ids_dict = {};
console.log("[DEBUG] JIO GADGET window.location.href:");
console.log(window.location.href);
console.log("[DEBUG] JIO GADGET generated origin_url:");
console.log(origin_url);
if (jio_options === undefined) { if (jio_options === undefined) {
return; return;
} }
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.30189.58056.44066</string> </value> <value> <string>974.31278.59358.47462</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1553021741.56</float> <float>1553086979.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment