1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
4
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
<title>http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetnotations</title>
7
<link href="http://www.w3.org/StyleSheets/activity-home.css" rel="stylesheet" type="text/css">
8
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
9
<script type="text/javascript" src="/MochiKit/packed.js"></script><script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script><script type="text/javascript" src="DOMTestCase.js"></script><script type="text/javascript" src="exclusions.js"></script><script type="text/javascript">
10
// expose test function names
11
function exposeTestFunctionNames()
13
return ['documenttypegetnotations'];
16
var docsLoaded = -1000000;
20
// This function is called by the testing framework before
21
// running the test suite.
23
// If there are no configuration exceptions, asynchronous
24
// document loading is started. Otherwise, the status
25
// is set to complete and the exception is immediately
26
// raised when entering the body of the test.
28
function setUpPage() {
29
setUpPageStatus = 'running';
32
// creates test document builder, may throw exception
34
builder = createConfiguredBuilder();
39
if (typeof(this.doc) != 'undefined') {
42
docsLoaded += preload(docRef, "doc", "staff");
44
if (docsLoaded == 1) {
45
setUpPage = 'complete';
48
catchInitializationError(builder, ex);
49
setUpPage = 'complete';
54
// This method is called on the completion of
55
// each asychronous load started in setUpTests.
57
// When every synchronous loaded document has completed,
58
// the page status is changed which allows the
59
// body of the test to be executed.
60
function loadComplete() {
61
if (++docsLoaded == 1) {
62
setUpPageStatus = 'complete';
69
var docName = 'documenttypegetnotations';
74
SimpleTest.waitForExplicitFinish();
75
addLoadEvent(setUpPage);
76
function testFails (test) {
83
function markTodos() {
84
if (todoTests[docName]) {
85
// mark the failures as todos
86
var failures = filter(testFails, SimpleTest._tests);
87
// shouldn't be 0 failures
88
todo(SimpleTest._tests != 0 && failures == 0, "test marked todo should fail somewhere");
92
function runJSUnitTests() {
93
builder = createConfiguredBuilder();
95
forEach(exposeTestFunctionNames(),
101
ok(false, "Test threw exception: " + ex);
108
The "getNotations()" method creates a NamedNodeMap that
109
contains all the notations declared in the DTD.
111
Retrieve the Document Type for this document and create
112
a NamedNodeMap object of all the notations. There
113
should be two items in the list (notation1 and notation2).
117
* @author Curt Arnold
118
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF
120
function documenttypegetnotations() {
122
if(checkInitialization(builder, "documenttypegetnotations") != null) return;
128
var actual = new Array();
130
expected = new Array();
131
expected[0] = "notation1";
132
expected[1] = "notation2";
136
if (typeof(this.doc) != 'undefined') {
139
doc = load(docRef, "doc", "staff");
140
docType = doc.doctype;
142
assertNotNull("docTypeNotNull",docType);
143
notationList = docType.notations;
145
assertNotNull("notationsNotNull",notationList);
146
for(var indexN65627 = 0;indexN65627 < notationList.length; indexN65627++) {
147
notation = notationList.item(indexN65627);
148
notationName = notation.nodeName;
150
actual[actual.length] = notationName;
153
assertEqualsCollection("names",expected,actual);
160
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/documenttypegetnotations</h2>
163
Copyright (c) 2001-2004 World Wide Web Consortium,
164
(Massachusetts Institute of Technology, European Research Consortium
165
for Informatics and Mathematics, Keio University). All
166
Rights Reserved. This work is distributed under the <a href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">W3C(r) Software License</a> in the
167
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
168
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.