tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_hasFeature05.html (4549B)


      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/hasFeature05</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 ['hasFeature05'];
     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("cOrE", null) should return true.
     69 
     70 * @author Curt Arnold
     71 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7
     72 */
     73 function hasFeature05() {
     74   var success;
     75    if(checkInitialization(builder, "hasFeature05") != null) return;
     76    var doc;
     77      var domImpl;
     78      var version = null;
     79 
     80      var state;
     81      domImpl = getImplementation();
     82 state = domImpl.hasFeature("cOrE",version);
     83 assertTrue("hasCore",state);
     84 
     85 }
     86 
     87 </script>
     88 </head>
     89 <body>
     90 <h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/hasFeature05</h2>
     91 <p>&lt;test name='hasFeature05' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-2 dom2.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;hasFeature05&lt;/title&gt;
     92 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;Curt Arnold&lt;/creator&gt;
     93 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
     94 hasFeature("cOrE", null) should return true.
     95 &lt;/description&gt;
     96 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2004-03-18&lt;/date&gt;
     97 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;subject resource='<a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>'/&gt;
     98 <br>&lt;/metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='doc' type='Document'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='domImpl' type='DOMImplementation'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='version' type='DOMString' isNull='true'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;var name='state' type='boolean'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;implementation var='domImpl'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hasFeature obj='domImpl' var='state' feature='"cOrE"' version='version'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertTrue actual='state' <a id="hasCore">id='hasCore'</a>/&gt;<br>&lt;/test&gt;<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>