accessible/tests/mochitest/elm/test_nsApplicationAcc.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <html>
michael@0 2
michael@0 3 <head>
michael@0 4 <title>application accessible name</title>
michael@0 5 <link rel="stylesheet" type="text/css"
michael@0 6 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 7 <script type="application/javascript"
michael@0 8 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9
michael@0 10 <script type="application/javascript"
michael@0 11 src="../common.js"></script>
michael@0 12 <script type="application/javascript"
michael@0 13 src="../role.js"></script>
michael@0 14
michael@0 15 <script type="application/javascript">
michael@0 16 function doTest()
michael@0 17 {
michael@0 18 var accessible = getApplicationAccessible();
michael@0 19 if (!accessible) {
michael@0 20 SimpleTest.finish();
michael@0 21 return;
michael@0 22 }
michael@0 23
michael@0 24 var bundleServ =
michael@0 25 Components.classes["@mozilla.org/intl/stringbundle;1"].
michael@0 26 getService(Components.interfaces.nsIStringBundleService);
michael@0 27 var brandBundle =
michael@0 28 bundleServ.createBundle("chrome://branding/locale/brand.properties");
michael@0 29
michael@0 30 var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
michael@0 31 getService(Components.interfaces.nsIXULAppInfo);
michael@0 32
michael@0 33 // nsIAccessible::name
michael@0 34 var applicationName = "";
michael@0 35 if (LINUX || SOLARIS) {
michael@0 36 applicationName = appInfo.name;
michael@0 37 } else {
michael@0 38 try {
michael@0 39 applicationName = brandBundle.GetStringFromName("brandShortName");
michael@0 40 } catch(e) {
michael@0 41 }
michael@0 42
michael@0 43 if (applicationName == "")
michael@0 44 applicationName = "Gecko based application";
michael@0 45 }
michael@0 46 is (accessible.name, applicationName, "wrong application accessible name");
michael@0 47
michael@0 48 // nsIAccessibleApplication
michael@0 49 is(accessible.appName, appInfo.name, "Wrong application name");
michael@0 50 is(accessible.appVersion, appInfo.version, "Wrong application version");
michael@0 51 is(accessible.platformName, "Gecko", "Wrong platform name");
michael@0 52 is(accessible.platformVersion, appInfo.platformVersion,
michael@0 53 "Wrong platform version");
michael@0 54
michael@0 55 SimpleTest.finish();
michael@0 56 }
michael@0 57
michael@0 58 SimpleTest.waitForExplicitFinish();
michael@0 59 addA11yLoadEvent(doTest);
michael@0 60 </script>
michael@0 61 </head>
michael@0 62 <body>
michael@0 63 <a target="_blank"
michael@0 64 href="https://bugzilla.mozilla.org/show_bug.cgi?id=456121"
michael@0 65 title="nsApplicationAccessible::GetName does not return a default value when brand.properties does not exist">
michael@0 66 Mozilla Bug 454211
michael@0 67 </a>
michael@0 68
michael@0 69 <p id="display"></p>
michael@0 70 <div id="content" style="display: none"></div>
michael@0 71 <pre id="test">
michael@0 72 </pre>
michael@0 73
michael@0 74 </body>
michael@0 75 </html>

mercurial