зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 54da01870611 (bug 920481) for test_webapps_actor.html timeouts on a CLOSED TREE
This commit is contained in:
Родитель
1df19015c8
Коммит
f7d2621ce9
|
@ -418,41 +418,12 @@ WebappsActor.prototype = {
|
|||
zipFile.moveTo(installDir, "application.zip");
|
||||
|
||||
let origin = "app://" + id;
|
||||
let manifestURL = origin + "/manifest.webapp";
|
||||
|
||||
// Refresh application.zip content (e.g. reinstall app), as done here:
|
||||
// http://hg.mozilla.org/mozilla-central/annotate/aaefec5d34f8/dom/apps/src/Webapps.jsm#l1125
|
||||
// Do it in parent process for the simulator
|
||||
let jar = installDir.clone();
|
||||
jar.append("application.zip");
|
||||
Services.obs.notifyObservers(jar, "flush-cache-entry", null);
|
||||
|
||||
// And then in app content process
|
||||
// This function will be evaluated in the scope of the content process
|
||||
// frame script. That will flush the jar cache for this app and allow
|
||||
// loading fresh updated resources if we reload its document.
|
||||
let FlushFrameScript = function (path) {
|
||||
let jar = Components.classes["@mozilla.org/file/local;1"]
|
||||
.createInstance(Components.interfaces.nsILocalFile);
|
||||
jar.initWithPath(path);
|
||||
let obs = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
obs.notifyObservers(jar, "flush-cache-entry", null);
|
||||
};
|
||||
for each (let frame in self._appFrames()) {
|
||||
if (frame.getAttribute("mozapp") == manifestURL) {
|
||||
let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
|
||||
mm.loadFrameScript("data:," +
|
||||
encodeURIComponent("(" + FlushFrameScript.toString() + ")" +
|
||||
"('" + jar.path + "')"), false);
|
||||
}
|
||||
}
|
||||
|
||||
// Create a fake app object with the minimum set of properties we need.
|
||||
let app = {
|
||||
origin: origin,
|
||||
installOrigin: origin,
|
||||
manifestURL: manifestURL,
|
||||
manifestURL: origin + "/manifest.webapp",
|
||||
appStatus: appType,
|
||||
receipts: aReceipts,
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче