<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
<!--

Copyright (c) 2004 World Wide Web Consortium, 
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University).  All 
Rights Reserved.  This program is distributed under the W3C's Software
Intellectual Property License.  This program is distributed in the 
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  

See W3C License http://www.w3.org/Consortium/Legal/ for more details.

-->
<!DOCTYPE test SYSTEM "dom3.dtd">


<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="domconfigerrorhandler1">
  <metadata>
    <title>domconfigerrorhandler1</title>
    <creator>Curt Arnold</creator>
    <description>Checks behavior of "error-handler" configuration parameter.</description>
	<date qualifier="created">2004-01-10</date>
	<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#parameter-error-handler"/>
	<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#DOMConfiguration-getParameter"/>
	<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#DOMConfiguration-setParameter"/>
    <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=544"/>
  </metadata>
  <var name="domImpl" type="DOMImplementation"/>
  <var name="doc" type="Document"/>
  <var name="domConfig" type="DOMConfiguration"/>
  <var name="nullDocType" type="DocumentType" isNull="true"/>
  <var name="canSet" type="boolean"/>
  <var name="origHandler" type="DOMErrorHandler"/>
  <var name="state" type="DOMErrorHandler"/>
  <var name="parameter" type="DOMString" value='"eRrOr-handler"'/>
  <var name="errorHandler" type="DOMErrorHandler">
      <handleError>
      	  <return value="true"/>
      </handleError>
  </var>
  <implementation var="domImpl"/>
  <createDocument var="doc" obj="domImpl" namespaceURI='"http://www.w3.org/1999/xhtml"' qualifiedName='"html"' doctype="nullDocType"/>
  <domConfig var="domConfig" obj="doc" interface="Document"/>
  <getParameter var="origHandler" obj="domConfig" name="parameter"/>
  <canSetParameter var="canSet" obj="domConfig" name="parameter" value="errorHandler"/>
  <assertTrue actual="canSet" id="canSetNewHandler"/>
  <canSetParameter var="canSet" obj="domConfig" name="parameter" value="origHandler"/>
  <assertTrue actual="canSet" id="canSetOrigHandler"/>  
  <setParameter obj="domConfig" name="parameter" value="errorHandler"/>
  <getParameter var="state" obj="domConfig" name="parameter"/>
  <assertSame expected="errorHandler" actual="state" id="setToNewHandlerEffective"/>
  <setParameter obj="domConfig" name="parameter" value="origHandler"/>
  <getParameter var="state" obj="domConfig" name="parameter"/>
  <assertSame expected="origHandler" actual="state" id="setToOrigHandlerEffective"/>
  <canSetParameter var="canSet" obj="domConfig" name="parameter" value="true"/>
  <!--  
     should return false for strongly typed languages
     however if weakly typed, then should be consistent with setParameter
  -->
  <if><isTrue value="canSet"/>
  	  <setParameter obj="domConfig" name="parameter" value="true"/>
  </if>
</test>





