test_hasFeature01.html (4631B)
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2 <html> 3 <head> 4 <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> 6 <title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/hasFeature01</title> 7 <link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css"> 8 <script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script> 9 <script src="DOMTestCase.js" type="text/javascript"></script> 10 <script type="text/javascript"> 11 // expose test function names 12 function exposeTestFunctionNames() 13 { 14 return ['hasFeature01']; 15 } 16 17 var docsLoaded = -1000000; 18 var builder = null; 19 20 // 21 // This function is called by the testing framework before 22 // running the test suite. 23 // 24 // If there are no configuration exceptions, asynchronous 25 // document loading is started. Otherwise, the status 26 // is set to complete and the exception is immediately 27 // raised when entering the body of the test. 28 // 29 function setUpPage() { 30 setUpPageStatus = 'running'; 31 try { 32 // 33 // creates test document builder, may throw exception 34 // 35 builder = createConfiguredBuilder(); 36 37 docsLoaded = 0; 38 39 if (docsLoaded == 0) { 40 setUpPage = 'complete'; 41 } 42 } catch(ex) { 43 catchInitializationError(builder, ex); 44 setUpPage = 'complete'; 45 } 46 runJSUnitTests(); 47 SimpleTest.finish(); 48 } 49 50 51 52 // 53 // This method is called on the completion of 54 // each asychronous load started in setUpTests. 55 // 56 // When every synchronous loaded document has completed, 57 // the page status is changed which allows the 58 // body of the test to be executed. 59 function loadComplete() { 60 if (++docsLoaded == 0) { 61 setUpPageStatus = 'complete'; 62 } 63 } 64 65 66 /** 67 * 68 hasFeature("hTmL", null) should return true. 69 70 * @author Curt Arnold 71 * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 72 */ 73 function hasFeature01() { 74 var success; 75 // if(checkInitialization(builder, "hasFeature01") != null) return; 76 var doc; 77 var domImpl; 78 var version = null; 79 80 var state; 81 domImpl = getImplementation(); 82 state = domImpl.hasFeature("hTmL",version); 83 assertTrue("hasHTMLnull",state); 84 85 } 86 87 </script> 88 </head> 89 <body> 90 <h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/hasFeature01</h2> 91 <p><test name='hasFeature01' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'><br> <metadata><br> <title>hasFeature01</title> 92 <br> <creator>Curt Arnold</creator> 93 <br> <description> 94 hasFeature("hTmL", null) should return true. 95 </description> 96 <br> <date qualifier='created'>2004-03-18</date> 97 <br> <subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7</a>'/> 98 <br></metadata><br> <var name='doc' type='Document'/><br> <var name='domImpl' type='DOMImplementation'/><br> <var name='version' type='DOMString' isNull='true'/><br> <var name='state' type='boolean'/><br> <implementation var='domImpl'/><br> <hasFeature obj='domImpl' var='state' feature='"hTmL"' version='version'/><br> <assertTrue actual='state' <a id="hasHTMLnull">id='hasHTMLnull'</a>/><br></test><br> 99 </p> 100 <p> 101 Copyright (c) 2001-2004 World Wide Web Consortium, 102 (Massachusetts Institute of Technology, Institut National de 103 Recherche en Informatique et en Automatique, Keio University). All 104 Rights Reserved. This program is distributed under the W3C's Software 105 Intellectual Property License. This program is distributed in the 106 hope that it will be useful, but WITHOUT ANY WARRANTY; without even 107 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 108 PURPOSE. 109 </p> 110 <p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a> 111 for more details.</p> 112 </body> 113 </html>