tenfourfox/dom/apps/tests/test_manifest_helper.xul
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

53 lines
1.6 KiB
XML

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1042881
-->
<window title="Mozilla Bug 1042881"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1042881"
target="_blank">Mozilla Bug 1042881</a>
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
/** Test for Bug 1042881 **/
Components.utils.import("resource://gre/modules/AppsUtils.jsm");
// Test that we get the right launch path from manifests similar to
// twitter's one.
var manifest = {
"version":"1.0",
"name":"Twitter",
"installs_allowed_from":["*"],
"developer":{
"name":"Twitter",
"url":"http://twitter.com"
},
"icons":{
"30":"/images/larrybird-30.png",
"60":"/images/larrybird-60.png",
"128":"/images/larrybird-128.png"
}
}
var helper = new ManifestHelper(manifest, "https://mobile.twitter.com",
"https://mobile.twitter.com/cache/twitter.webapp");
SimpleTest.is(helper.fullLaunchPath(), "https://mobile.twitter.com/");
SimpleTest.is(helper.iconURLForSize(60),
"https://mobile.twitter.com/images/larrybird-60.png");
]]>
</script>
</window>