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