1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/dom-level2-html/test_hasFeature05.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,113 @@ 1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 1.5 +<html> 1.6 +<head> 1.7 +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 1.8 +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> 1.9 +<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/hasFeature05</title> 1.10 +<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css"> 1.11 +<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script> 1.12 +<script src="DOMTestCase.js" type="text/javascript"></script> 1.13 +<script type="text/javascript"> 1.14 +// expose test function names 1.15 +function exposeTestFunctionNames() 1.16 +{ 1.17 +return ['hasFeature05']; 1.18 +} 1.19 + 1.20 +var docsLoaded = -1000000; 1.21 +var builder = null; 1.22 + 1.23 +// 1.24 +// This function is called by the testing framework before 1.25 +// running the test suite. 1.26 +// 1.27 +// If there are no configuration exceptions, asynchronous 1.28 +// document loading is started. Otherwise, the status 1.29 +// is set to complete and the exception is immediately 1.30 +// raised when entering the body of the test. 1.31 +// 1.32 +function setUpPage() { 1.33 + setUpPageStatus = 'running'; 1.34 + try { 1.35 + // 1.36 + // creates test document builder, may throw exception 1.37 + // 1.38 + builder = createConfiguredBuilder(); 1.39 + 1.40 + docsLoaded = 0; 1.41 + 1.42 + if (docsLoaded == 0) { 1.43 + setUpPage = 'complete'; 1.44 + } 1.45 + } catch(ex) { 1.46 + catchInitializationError(builder, ex); 1.47 + setUpPage = 'complete'; 1.48 + } 1.49 + runJSUnitTests(); 1.50 + SimpleTest.finish(); 1.51 +} 1.52 + 1.53 + 1.54 + 1.55 +// 1.56 +// This method is called on the completion of 1.57 +// each asychronous load started in setUpTests. 1.58 +// 1.59 +// When every synchronous loaded document has completed, 1.60 +// the page status is changed which allows the 1.61 +// body of the test to be executed. 1.62 +function loadComplete() { 1.63 + if (++docsLoaded == 0) { 1.64 + setUpPageStatus = 'complete'; 1.65 + } 1.66 +} 1.67 + 1.68 + 1.69 +/** 1.70 +* 1.71 +hasFeature("cOrE", null) should return true. 1.72 + 1.73 +* @author Curt Arnold 1.74 +* @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7 1.75 +*/ 1.76 +function hasFeature05() { 1.77 + var success; 1.78 + if(checkInitialization(builder, "hasFeature05") != null) return; 1.79 + var doc; 1.80 + var domImpl; 1.81 + var version = null; 1.82 + 1.83 + var state; 1.84 + domImpl = getImplementation(); 1.85 +state = domImpl.hasFeature("cOrE",version); 1.86 +assertTrue("hasCore",state); 1.87 + 1.88 +} 1.89 + 1.90 +</script> 1.91 +</head> 1.92 +<body> 1.93 +<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/hasFeature05</h2> 1.94 +<p><test name='hasFeature05' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-2 dom2.xsd'><br> <metadata><br> <title>hasFeature05</title> 1.95 +<br> <creator>Curt Arnold</creator> 1.96 +<br> <description> 1.97 +hasFeature("cOrE", null) should return true. 1.98 +</description> 1.99 +<br> <date qualifier='created'>2004-03-18</date> 1.100 +<br> <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>'/> 1.101 +<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='"cOrE"' version='version'/><br> <assertTrue actual='state' <a id="hasCore">id='hasCore'</a>/><br></test><br> 1.102 +</p> 1.103 +<p> 1.104 + Copyright (c) 2001-2004 World Wide Web Consortium, 1.105 + (Massachusetts Institute of Technology, Institut National de 1.106 + Recherche en Informatique et en Automatique, Keio University). All 1.107 + Rights Reserved. This program is distributed under the W3C's Software 1.108 + Intellectual Property License. This program is distributed in the 1.109 + hope that it will be useful, but WITHOUT ANY WARRANTY; without even 1.110 + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 1.111 + PURPOSE. 1.112 + </p> 1.113 +<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a> 1.114 + for more details.</p> 1.115 +</body> 1.116 +</html>