~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/embedding/qa/jstests/accessibility/xul/xulgroupbox.xul

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
 
3
     for XUL GROUPBOX Node
 
4
     Author: dsirnapalli@netscape.com
 
5
     Created:05.28.02
 
6
     Last Updated:06.13.02.
 
7
 
 
8
   - The contents of this file are subject to the Mozilla Public
 
9
   - License Version 1.1 (the "License"); you may not use this file
 
10
   - except in compliance with the License. You may obtain a copy of
 
11
   - the License at http://www.mozilla.org/MPL/
 
12
   -
 
13
   - Software distributed under the License is distributed on an "AS
 
14
   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
15
   - implied. See the License for the specific language governing
 
16
   - rights and limitations under the License.
 
17
   -
 
18
   - The Original Code is Mozilla Communicator Test Cases.
 
19
   -
 
20
   - The Initial Developer of the Original Code is Netscape Communications
 
21
   - Corp.  Portions created by Netscape Communications Corp. are
 
22
   - Copyright (C) 1999 Netscape Communications Corp.  All
 
23
   - Rights Reserved.
 
24
   -
 
25
   - Contributor(s):
 
26
  -->
 
27
 
 
28
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 
29
<window
 
30
  id="groupbox-window"
 
31
  title="XUL Groupbox"
 
32
  xmlns:html="http://www.w3.org/1999/xhtml"
 
33
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
34
 
 
35
  <html:script src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/accesslib.js"> </html:script>
 
36
  <html:script src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/bridge.js"> </html:script>
 
37
 
 
38
  <html:script>
 
39
  <![CDATA[
 
40
 
 
41
  function getDomNodeGroupbox()
 
42
  {
 
43
    try{
 
44
      netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 
45
      netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
46
  
 
47
      var node = document.getElementsByTagName("groupbox").item(0);
 
48
      return node;
 
49
    }
 
50
    catch(e){
 
51
      alert("Exception: " + e);
 
52
    }
 
53
  }  
 
54
 
 
55
  function executeTestCase()
 
56
  {
 
57
    var domNode = getDomNodeGroupbox();
 
58
    accNode = getAccessibleNode(domNode);
 
59
    setTimeout("constructResults();", 2000);
 
60
  }
 
61
 
 
62
  function constructResults()
 
63
  {
 
64
   try{
 
65
    netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 
66
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
67
  
 
68
    var name = getName();
 
69
    var role = getRole();
 
70
    var state = getState();
 
71
    var value = getValue();
 
72
    var newvalue = value.toString();
 
73
    var keyboardShortcut = getAccKeyboardShortcut();
 
74
 
 
75
    var expectedName          = "Answer";
 
76
    var expectedRole          = "20";
 
77
    var expectedState         = "0";
 
78
    var expectedValue         = "NS_ERROR_NOT_IMPLEMENTED";
 
79
    var expectedkeyboardShortcut = "Alt+g";
 
80
 
 
81
    var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
 
82
    var row1 = new Array("Name->", expectedName, name);
 
83
    var row2 = new Array("Role->", expectedRole, role);
 
84
    var row3 = new Array("State->", expectedState, state);
 
85
    var row4 = new Array("Value->", expectedValue, value);
 
86
    var row5 = new Array("accKeyboardShortcut->", expectedkeyboardShortcut, keyboardShortcut);
 
87
 
 
88
    row = new Array(row0, row1, row2, row3, row4, row5);
 
89
 
 
90
    if (name == expectedName)                 row1[3] = "PASS"; else row1[3] = "FAIL";
 
91
    if (role == expectedRole)                 row2[3] = "PASS"; else row2[3] = "FAIL";
 
92
    if (state == expectedState)               row3[3] = "PASS"; else row3[3] = "FAIL";
 
93
    if (newvalue.match(expectedValue))        row4[3] = "PASS"; else row4[3] = "FAIL";
 
94
    if (keyboardShortcut == expectedkeyboardShortcut)
 
95
                                              row5[3] = "PASS"; else row5[3] = "FAIL";
 
96
 
 
97
    appendTableRes();
 
98
    WriteResults(res);    
 
99
   }
 
100
   catch(e){
 
101
    alert("Exception**: " + e);
 
102
   }
 
103
  }  
 
104
 
 
105
  ]]>
 
106
  </html:script>
 
107
 
 
108
  <box orient="vertical" flex="1">  
 
109
    <description>
 
110
      <html:b> Testing XUL Groupbox for Accessibility.. </html:b>
 
111
    </description>
 
112
    <groupbox accesskey="g">
 
113
      <caption label="Answer"/>
 
114
      <description value="Banana"/>
 
115
      <description value="Tangerine"/>
 
116
      <description value="Phone Booth"/>
 
117
      <description value="Kiwi"/>
 
118
    </groupbox>
 
119
  </box>
 
120
 
 
121
  <html:script>
 
122
  <![CDATA[
 
123
    res = "<b><u> Results for XUL Groupbox Node:</u></b><br><br>";
 
124
 
 
125
    setTimeout("executeTestCase();", 2000);
 
126
  ]]>
 
127
  </html:script>  
 
128
</window>
 
 
b'\\ No newline at end of file'