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

« back to all changes in this revision

Viewing changes to mozilla/embedding/qa/jstests/accessibility/html/htmlfieldsetwithlegend.html

  • 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
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 
2
<html>
 
3
<title> nsIAccessible Interface Test Case </title>
 
4
<!-- Descrpt: Test nsIAccessible Interface attributes and methods
 
5
     for HTML FIELDSET WITH LEGEND Node
 
6
     Author: dsirnapalli@netscape.com
 
7
     Created:03.01.02
 
8
     Last Updated:06.25.02.
 
9
 
 
10
   - The contents of this file are subject to the Mozilla Public
 
11
   - License Version 1.1 (the "License"); you may not use this file
 
12
   - except in compliance with the License. You may obtain a copy of
 
13
   - the License at http://www.mozilla.org/MPL/
 
14
   -
 
15
   - Software distributed under the License is distributed on an "AS
 
16
   - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
17
   - implied. See the License for the specific language governing
 
18
   - rights and limitations under the License.
 
19
   -
 
20
   - The Original Code is Mozilla Communicator Test Cases.
 
21
   -
 
22
   - The Initial Developer of the Original Code is Netscape Communications
 
23
   - Corp.  Portions created by Netscape Communications Corp. are
 
24
   - Copyright (C) 1999 Netscape Communications Corp.  All
 
25
   - Rights Reserved.
 
26
   -
 
27
   - Contributor(s):
 
28
  -->
 
29
<head>
 
30
 
 
31
<script type="text/javascript" src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/accesslib.js"> </script>
 
32
<script type="text/javascript" src="http://www.mozilla.org/quality/embed/jstests/accessibility/jslib/bridge.js"> </script>
 
33
 
 
34
<script type="text/javascript">
 
35
 
 
36
function getDomNodeFieldset()
 
37
{
 
38
 try{
 
39
  netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 
40
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
41
 
 
42
  var node = document.getElementsByTagName("form").item(0);
 
43
  arr = new Array(5);
 
44
  arr = node.elements;
 
45
  return arr[0];
 
46
 }
 
47
 catch(e){
 
48
  alert("Exception: " + e);
 
49
 }
 
50
}
 
51
 
 
52
function executeTestCase()
 
53
{
 
54
  var domNode = getDomNodeFieldset();
 
55
  accNode = getAccessibleNode(domNode);
 
56
  setTimeout("constructResults();", 2000);
 
57
}
 
58
 
 
59
function constructResults()
 
60
{
 
61
 try{
 
62
  netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
 
63
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
64
 
 
65
  var name = getName();
 
66
  var role = getRole();
 
67
  var state = getState();
 
68
  var value = getValue();
 
69
  var newvalue = value.toString();
 
70
  var keyboardShortcut = getAccKeyboardShortcut();
 
71
 
 
72
  var expectedName      = "Customer Identification";
 
73
  var expectedRole      = "20";
 
74
  var expectedState     = "0";
 
75
  var expectedValue     = "NS_ERROR_NOT_IMPLEMENTED";
 
76
  var expectedkeyboardShortcut = "Alt+f";
 
77
 
 
78
  var row0 = new Array("Property/Method", "Expected Values", "Actual Values", "Result");
 
79
  var row1 = new Array("Name->", expectedName, name);
 
80
  var row2 = new Array("Role->", expectedRole, role);
 
81
  var row3 = new Array("State->", expectedState, state);
 
82
  var row4 = new Array("Value->", expectedValue, value);
 
83
  var row5 = new Array("accKeyboardShortcut->", expectedkeyboardShortcut, keyboardShortcut);
 
84
 
 
85
  row = new Array(row0, row1, row2, row3, row4, row5);
 
86
 
 
87
  if (name == expectedName)                 row1[3] = "PASS"; else row1[3] = "FAIL";
 
88
  if (role == expectedRole)                 row2[3] = "PASS"; else row2[3] = "FAIL";
 
89
  if (state == expectedState)               row3[3] = "PASS"; else row3[3] = "FAIL";
 
90
  if (newvalue.match(expectedValue))        row4[3] = "PASS"; else row4[3] = "FAIL";
 
91
  if (keyboardShortcut == expectedkeyboardShortcut)
 
92
                                            row5[3] = "PASS"; else row5[3] = "FAIL";
 
93
 
 
94
  appendTableRes();
 
95
  if(!isRunningStandalone())
 
96
    WriteResults(res);
 
97
  else
 
98
    submitToCookie();
 
99
 }
 
100
 catch(e){
 
101
  alert("Exception**: " + e);
 
102
 }
 
103
}
 
104
 
 
105
</script>
 
106
</head>
 
107
<body>
 
108
 
 
109
<script type="text/javascript">
 
110
cookieName = "nsIAccessibleTestFieldsetWithLegendNode";
 
111
res = "<b><u> Results for HTML Fieldset(with Legend) Node:</u></b><br><br>";
 
112
 
 
113
if(readCookie(cookieName) == null)
 
114
{
 
115
  <!-- Test HTML FieldSet(with Legend) -->
 
116
  document.write('<br>');
 
117
  document.write('<b>Testing HTML FieldSet(with Legend) for Accessibility..</b><br><br>');
 
118
  document.write('<br>');
 
119
  document.write('<form action="http://www.democompany.com/cgi-bin/postquery.pl" method="post" enctype="multipart/form-data">');
 
120
 
 
121
  document.write('<fieldset accesskey="f">');
 
122
  document.write('<legend>Customer Identification</legend>');
 
123
  document.write('<br><br>');
 
124
  document.write('<label>Customer Name:</label>');
 
125
  document.write('<input type="text" name="CustomerName" size="25">');
 
126
  document.write('<br><br>');
 
127
  document.write('<label>Password:</label>');
 
128
  document.write('<input type="password" name="CustomerID" size="8" maxlength="8">');
 
129
  document.write('<br>');
 
130
  document.write('</fieldset>');
 
131
  document.write('</form>');
 
132
 
 
133
  setTimeout("executeTestCase();", 2000);
 
134
}
 
135
else
 
136
{
 
137
  var cookieValue = readCookie(cookieName);
 
138
  eraseCookie(cookieName);
 
139
  document.write(cookieValue);
 
140
}
 
141
 
 
142
</script>
 
143
</body>
 
144
</html>
 
 
b'\\ No newline at end of file'