W3C home > Mailing lists > Public > www-dom-ts@w3.org > February 2002

Re: Modified jsUnitRunner that injects jsUnitCore.js into test case

From: Rick Rivello <richard.rivello@nist.gov>
Date: Mon, 4 Feb 2002 14:48:25 -0500
Message-ID: <024401c1adb4$e9054600$573b0681@sdct.nist.gov>
To: "Curt Arnold" <carnold@houston.rr.com>, <www-dom-ts@w3.org>
I'm now getting an error when trying to
run the level2 html tests through JSUNIT.
Is it possible the changes made over the
weekend are causing this problem?

On IE  I get the following error

Line: 48
Char: 9
Error: Object doesn't support this property or method.
Code: 0
URL: file://c:\cygwin\home\Administrator\2001\DOM-Test-Suite\lib\jsunit\app\main.html

  ----- Original Message ----- 
  From: Curt Arnold 
  To: www-dom-ts@w3.org 
  Cc: edward@jsunit.net ; jsunit@yahoogroups.com 
  Sent: Friday, February 01, 2002 4:53 AM
  Subject: Modified jsUnitRunner that injects jsUnitCore.js into test case

  I've attached a modified jsUnitRunner.js and main.html that will "inject" the contents of jsUnitCore.js and jsUnitUtility.js (extracted from an inline script element in main.html) into a test case if jsUnitCore.js isn't referenced.  Code has been tested on IE 6/Win XP and Mozilla 0.9.7.

  The modifications should have no affect on existing cases that have explicit <script> elements for jsUnitCore.js.

  For cases that want to omit the explicit <script> elements (and the undesirable fixing of the relative location of test to test framework), the test case must contain a isLoaded() method that returns true when the case is fully loaded.  For the DOM TS work, this would be embedded in the DOMTestCase.js file.  For other use, you could add the following boilerplate code into the test:

  var isTestPageLoaded=false;

  function isLoaded() {
  return isTestPageLoaded;
  function newOnLoadEvent() {


  I had originally tried adding elements like <script src=".../jsUnitCore.js"/> but Netscape would not load the external resource early enough without throwing in an annoying alert(), hence the slightly undesireable duplication of jsUnitCore.js code within main.html.

  I've also included variants of jsUnit's internal tests, but without the external script elements.
Received on Monday, 4 February 2002 14:49:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:04 UTC