gecko-dev/dom/tests/mochitest/webapps
Mike Conley 448f596abf Bug 1077168 - Cancel in-flight Webapp install jobs from windows that change location. r=myk.
Installing a Webapp is an asynchronous job, and there is a pocket of time
between when web content requests to install an app and before the browser
displays an installation prompt that the outer window of the content can
browse away. This pocket of time is typically used by XHR to request the
web app resources and verify their contents.

This pocket of time is, essentially, bug 771294, and is a bit of a security
problem.

This problem was originally patched over on Desktop by checking in the parent
process that the outer window was still at the same URI as it had been when it
made the request. I'm not entirely sure if Android / B2G made similar checks.

With separated content processes, however, the browser front-end can no longer
performantly check to ensure that the outer window is at the same URI.

We solve this problem by sending up a message in the content process when
the location of an outer window making use of navigator.mozApps changes.
We hold a Map of "actions" mapping to in-flight installs mapped by the
outer window ID of the requesting content. When we notice a location
change, we mark those actions as cancelled. When the XHR returns, we have
it check the state of its actions, and if they're cancelled, it aborts
further action.

Normally, this wouldn't be necessary, since any XHR initiated by the
content window would be cancelled once the location changed, but in
this case, the XHR is occurring in Webapps.jsm, and is not influenced
by the outer window of the content.

--HG--
extra : rebase_source : 5f95002a21c96c5cbf3dca8ca265400448251b43
2015-02-10 13:18:47 -05:00
..
apps Bug 939048 - Part d: Move mochitests to manifests in dom/tests/mochitest/webapps/apps; r=jst 2013-12-31 10:06:10 +01:00
chrome.ini Bug 960837 - Use the basic receipt check introduced in bug 757226 for installations. r=fabrice 2014-01-23 09:46:20 -05:00
cross_origin.html Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
file_bug_779982.html Bug 922187 - Properly catch exceptions in checkInstalled and fire the error callback on the DOM request. r=myk 2014-06-25 01:51:28 +02:00
file_bug_779982.js Bug 993326 - Automatically restore apps launchable value. r=fabrice 2014-04-17 16:43:04 -04:00
head.js Bug 1077168 - Cancel in-flight Webapp install jobs from windows that change location. r=myk. 2015-02-10 13:18:47 -05:00
install_and_redirect_helper.xul
mochitest.ini Bug 982828 - [e10s] Disable mochitest-plain tests that don't pass in e10s (r=ted) 2014-03-13 21:38:19 -07:00
test_bug_765063.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_bug_771294.xul Bug 1077168 - Cancel in-flight Webapp install jobs from windows that change location. r=myk. 2015-02-10 13:18:47 -05:00
test_bug_779982.html
test_cross_origin.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_getNotInstalled.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_install_app.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_install_errors.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_install_utf8.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_launch_paths.xul Bug 1000315 - Part 7: App tests automatically confirm uninstallation. r=myk 2014-06-11 14:33:02 -07:00
test_list_api.xul Bug 1000305 - Part 2 - imported patch bug-1000305-fix-part2. r=mcmanus 2015-02-09 08:39:07 -05:00