W3C home > Mailing lists > Public > www-dom-ts@w3.org > January 2003

JSUnit bug with file:// urls (patch)

From: David Faure <faure@kde.org>
Date: Thu, 9 Jan 2003 08:42:55 -0500 (EST)
To: edward@jsunit.net, www-dom-ts@w3.org
Cc: mueller@kde.org
Message-Id: <200301091424.46706.faure@kde.org>

Hash: SHA1

Koos Vriezen found out why Java applets couldn't be loaded in the latest
version of the DOM testsuite.

The reason is that an invalid URL is being created by jsUnitTestManager.js
Only file:/path and file:///path are valid file urls.
In file://blah and file:////blah, blah is a hostname (as specified in RFC 2396 IIRC)

This is a bug in JSUnit, details and patch below. Please apply to
both JSUnit and the DOMTS copy of it.

(Another problem is that the default page-load timeout value of "10" is a bit 
small for Konqueror, when it needs to load the java support, for the first test
that uses java. I get a timeout, but if I use a bigger value it works. Needs to
be improved on our side, obviously, but this is important for anyone who tries
to run the test and sees a timeout...)

- ----------  Forwarded Message  ----------

Subject: Re: Java applet not found (problem in the official DOM testsuite)
Date: Saturday 21 December 2002 17:55
From: Koos Vriezen <koos.vriezen@xs4all.nl>
To: <kfm-devel@kde.org>

Running it with the JS Debugger I see that in kickOffTests() the call to
top.testManager.resolveUserEnteredTestFileName() returns
The test in

 if (userEnteredTestFileName.indexOf("http://") == 0 || userEnteredTestFileName.indexOf("file:///") == 0)
    return userEnteredTestFileName;
  return getTestFileProtocol()+this.getTestFileName();

fails and getTestFileProtocol() return file:/// and this.getTestFileName()

I suspect the result of 'Browse' should be a file:///xxxx instead.


- -------------------------------------------------------

- --- jsUnitTestManager.js~       Tue Nov 26 16:30:36 2002
+++ jsUnitTestManager.js        Thu Jan  9 11:35:49 2003
@@ -676,7 +676,7 @@
   var protocol = top.document.location.protocol;

   if (protocol == 'file:')
- -    return 'file:///';
+    return 'file://';

   if (protocol == 'http:')
     return 'http://';

- --
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Klarälvdalens Datakonsult AB, Platform-independent software solutions
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2.1 is available - http://download.kde.org/stable/koffice-1.2.1/
Version: GnuPG v1.0.7 (GNU/Linux)

Received on Monday, 20 January 2003 18:21:36 UTC

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