dom/tests/mochitest/dom-level2-html/test_hasFeature03.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/hasFeature03</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 ['hasFeature03'];
    15 }
    17 var docsLoaded = -1000000;
    18 var builder = null;
    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();
    37       docsLoaded = 0;
    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 }
    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 }
    66 /**
    67 * 
    68 hasFeature("xhTmL", null) should return true if hasFeature("XML", null) returns true.
    70 * @author Curt Arnold
    71 * @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7
    72 */
    73 function hasFeature03() {
    74    var success;
    75     if(checkInitialization(builder, "hasFeature03") != null) return;
    76     var doc;
    77       var domImpl;
    78       var version = null;
    80       var state;
    81       var hasXML;
    82       domImpl = getImplementation();
    83 hasXML = domImpl.hasFeature("XML",version);
    84 state = domImpl.hasFeature("xhTmL",version);
    85 assertEquals("hasXHTML",hasXML,state);
    87 }
    89 </script>
    90 </head>
    91 <body>
    92 <h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/hasFeature03</h2>
    93 <p>&lt;test name='hasFeature03' 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;hasFeature03&lt;/title&gt;
    94 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;creator&gt;Curt Arnold&lt;/creator&gt;
    95 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;description&gt;
    96 hasFeature("xhTmL", null) should return true if hasFeature("XML", null) returns true.
    97 &lt;/description&gt;
    98 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;date qualifier='created'&gt;2004-03-18&lt;/date&gt;
    99 <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;
   100 <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;var name='hasXML' 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='hasXML' feature='"XML"' version='version'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hasFeature obj='domImpl' var='state' feature='"xhTmL"' version='version'/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;assertEquals actual='state' expected='hasXML' ignoreCase='false' <a id="hasXHTML">id='hasXHTML'</a>/&gt;<br>&lt;/test&gt;<br>
   101 </p>
   102 <p>
   103 			Copyright (c) 2001-2004 World Wide Web Consortium,
   104 			(Massachusetts Institute of Technology, Institut National de
   105 			Recherche en Informatique et en Automatique, Keio University). All
   106 			Rights Reserved. This program is distributed under the W3C's Software
   107 			Intellectual Property License. This program is distributed in the
   108 			hope that it will be useful, but WITHOUT ANY WARRANTY; without even
   109 			the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
   110 			PURPOSE.
   111 			</p>
   112 <p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a> 
   113  for more details.</p>
   114 </body>
   115 </html>

mercurial