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>




-----BEGIN PGP SIGNED MESSAGE-----
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
file:////home/koos/public_html/DOM-javabug/javabug/HTMLAppletElement01.html
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()
returns
/home/koos/public_html/DOM-javabug/javabug/HTMLAppletElement01.html

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

Koos

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

- --- 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/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+HXge72KcVAmwbhARAnryAJ9dJw0C8jPMuVrQp8Gw035yu7WpMQCgplRr
iRruLRDjxTTheoJZINCWFG0=
=1c7d
-----END PGP SIGNATURE-----
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