2012-09-05 10:08:54 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Cross Origin Helper</title>
|
|
|
|
<script type="application/javascript" src="head.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Install an app, check that getSelf() works, and then tell the test page
|
|
|
|
* to continue the tests.
|
|
|
|
*
|
|
|
|
* This page loads on a different origin than the one for the test page,
|
|
|
|
* which enables that page to check the behavior of various API calls when apps
|
|
|
|
* have been installed from multiple origins.
|
|
|
|
*/
|
|
|
|
|
|
|
|
var parent = SpecialPowers.wrap(window).parent;
|
|
|
|
|
|
|
|
confirmNextInstall();
|
|
|
|
navigator.mozApps.install(parent.url2, null).onsuccess = function onInstall() {
|
|
|
|
// Give the test page a reference to the installed app, so it can uninstall it
|
|
|
|
// after it finishes the tests.
|
|
|
|
parent.app2 = this.result;
|
|
|
|
|
|
|
|
navigator.mozApps.getSelf().onsuccess = function onGetSelf() {
|
2012-09-25 08:04:24 -07:00
|
|
|
parent.ok(this.result == null, "getSelf() from app's origin returns null if called from a browser");
|
2012-09-05 10:08:54 -07:00
|
|
|
|
|
|
|
// Tell the test page to continue the tests.
|
|
|
|
parent.postMessage("next", "*");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|