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/hc_nodevalue07</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 ['hc_nodevalue07'];
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();
35
checkFeature("XML", null);
40
if (typeof(this.doc) != 'undefined') {
43
docsLoaded += preload(docRef, "doc", "hc_staff");
45
if (docsLoaded == 1) {
46
setUpPage = 'complete';
49
catchInitializationError(builder, ex);
50
setUpPage = 'complete';
55
// This method is called on the completion of
56
// each asychronous load started in setUpTests.
58
// When every synchronous loaded document has completed,
59
// the page status is changed which allows the
60
// body of the test to be executed.
61
function loadComplete() {
62
if (++docsLoaded == 1) {
63
setUpPageStatus = 'complete';
70
var docName = 'hc_nodevalue07';
75
SimpleTest.waitForExplicitFinish();
76
addLoadEvent(setUpPage);
77
function testFails (test) {
84
function markTodos() {
85
if (todoTests[docName]) {
86
// mark the failures as todos
87
var failures = filter(testFails, SimpleTest._tests);
88
// shouldn't be 0 failures
89
todo(SimpleTest._tests != 0 && failures == 0, "test marked todo should fail somewhere");
93
function runJSUnitTests() {
94
builder = createConfiguredBuilder();
96
forEach(exposeTestFunctionNames(),
102
ok(false, "Test threw exception: " + ex);
109
An Entity is accessed, setNodeValue is called with a non-null argument, but getNodeValue
110
should still return null.
112
* @author Curt Arnold
113
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080
114
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2
116
function hc_nodevalue07() {
118
if(checkInitialization(builder, "hc_nodevalue07") != null) return;
126
if (typeof(this.doc) != 'undefined') {
129
doc = load(docRef, "doc", "hc_staff");
130
docType = doc.doctype;
136
(builder.contentType == "text/html")
140
assertNotNull("docTypeNotNull",docType);
141
nodeMap = docType.entities;
143
assertNotNull("entitiesNotNull",nodeMap);
144
newNode = nodeMap.getNamedItem("alpha");
145
assertNotNull("entityNotNull",newNode);
146
newValue = newNode.nodeValue;
148
assertNull("initiallyNull",newValue);
149
newNode.nodeValue = "This should have no effect";
151
newValue = newNode.nodeValue;
153
assertNull("nullAfterAttemptedChange",newValue);
162
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue07</h2>
165
Copyright (c) 2001-2004 World Wide Web Consortium,
166
(Massachusetts Institute of Technology, European Research Consortium
167
for Informatics and Mathematics, Keio University). All
168
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
169
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
170
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
172
<iframe name="doc" src="files/hc_staff.html"></iframe>