test_HTMLDocument12.html (5387B)
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2 <html> 3 <head> 4 5 <!-- 6 This test relies on that no cookies exist when the test starts. 7 If this test is failing, add code to clear all cookies to the beginning of the test. 8 --> 9 10 <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 11 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> 12 <title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLDocument12</title> 13 <link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css"> 14 <script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script> 15 <script src="DOMTestCase.js" type="text/javascript"></script> 16 <script type="text/javascript"> 17 // expose test function names 18 function exposeTestFunctionNames() 19 { 20 return ['HTMLDocument12']; 21 } 22 23 var docsLoaded = -1000000; 24 var builder = null; 25 26 // 27 // This function is called by the testing framework before 28 // running the test suite. 29 // 30 // If there are no configuration exceptions, asynchronous 31 // document loading is started. Otherwise, the status 32 // is set to complete and the exception is immediately 33 // raised when entering the body of the test. 34 // 35 function setUpPage() { 36 setUpPageStatus = 'running'; 37 try { 38 // 39 // creates test document builder, may throw exception 40 // 41 builder = createConfiguredBuilder(); 42 43 docsLoaded = 0; 44 45 var docRef = null; 46 if (typeof(this.doc) != 'undefined') { 47 docRef = this.doc; 48 } 49 docsLoaded += preload(docRef, "doc", "document"); 50 51 if (docsLoaded == 1) { 52 setUpPage = 'complete'; 53 } 54 } catch(ex) { 55 catchInitializationError(builder, ex); 56 setUpPage = 'complete'; 57 } 58 } 59 60 61 62 // 63 // This method is called on the completion of 64 // each asychronous load started in setUpTests. 65 // 66 // When every synchronous loaded document has completed, 67 // the page status is changed which allows the 68 // body of the test to be executed. 69 function loadComplete() { 70 if (++docsLoaded == 1) { 71 setUpPageStatus = 'complete'; 72 runJSUnitTests(); 73 SimpleTest.finish(); 74 } 75 } 76 77 78 /** 79 * 80 The cookie attribute returns the cookies associated with this document. 81 82 Retrieve the cookie attribute and examine its value. 83 84 * @author NIST 85 * @author Rick Rivello 86 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-8747038 87 */ 88 function HTMLDocument12() { 89 var success; 90 if(checkInitialization(builder, "HTMLDocument12") != null) return; 91 var nodeList; 92 var vcookie; 93 var doc; 94 95 var docRef = null; 96 if (typeof(this.doc) != 'undefined') { 97 docRef = this.doc; 98 } 99 doc = load(docRef, "doc", "document"); 100 vcookie = doc.cookie; 101 102 assertEquals("cookieLink","",vcookie); 103 104 } 105 106 </script> 107 </head> 108 <body> 109 <h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLDocument12</h2> 110 <p><test name='HTMLDocument12' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'><br> <metadata><br> <title>HTMLDocument02</title> 111 <br> <creator>NIST</creator> 112 <br> <description> 113 The cookie attribute returns the cookies associated with this document. 114 115 Retrieve the cookie attribute and examine its value. 116 </description> 117 <br> <contributor>Rick Rivello</contributor> 118 <br> <date qualifier='created'>2002-04-30</date> 119 <br> <subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-8747038">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-8747038</a>'/> 120 <br></metadata><br> <var name='nodeList' type='NodeList'/><br> <var name='vcookie' type='DOMString'/><br> <var name='doc' type='Document'/><br> <load var='doc' href='document' willBeModified='false'/><br> <cookie interface='HTMLDocument' obj='doc' var='vcookie'/><br> <assertEquals actual='vcookie' expected='""' <a id="cookieLink">id='cookieLink'</a> ignoreCase='false'/><br></test><br> 121 </p> 122 <p> 123 Copyright (c) 2001-2004 World Wide Web Consortium, 124 (Massachusetts Institute of Technology, Institut National de 125 Recherche en Informatique et en Automatique, Keio University). All 126 Rights Reserved. This program is distributed under the W3C's Software 127 Intellectual Property License. This program is distributed in the 128 hope that it will be useful, but WITHOUT ANY WARRANTY; without even 129 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 130 PURPOSE. 131 </p> 132 <p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a> 133 for more details.</p> 134 <iframe name="doc" src="files/document.html"></iframe> 135 <br> 136 </body> 137 </html>