APIs accepting null folder object (e.g. addFile, addDir) don't return error.

RESOLVED WONTFIX

Status

Core Graveyard
Installer: XPInstall Engine
P3
minor
RESOLVED WONTFIX
18 years ago
2 years ago

People

(Reporter: David Epstein, Assigned: dveditz)

Tracking

Trunk
x86
Windows NT

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
Linux and Win. builds 2000-06-26-08-M17.
1. Run Linux or Win build.
2. Go to http://jimbob/trigger3.html
3. Select one of the Mac getFolder() cases. examples: 
a_getfolder_1_macctrlpanel.xpi, a_getfolder_1_macextension.xpi
4. Press Trigger. Then OK.
5. Check logfile.
Result: Script cancels, but no error is returned to log file.
Expected: Post the error to the log file.
Note: I added a logComment to the script and found that -208 is returned. This 
is an OK error since, for example, "Mac Control Panel" is an invalid parameter 
when run on a non-Mac platform. 

log files:

-------------------------------------------------------------------------------
http://jimbob/jars/a_getfolder_1_macctrlpanel.xpi  --  06/26/2000 16:35:21
-------------------------------------------------------------------------------

     Acceptance: a_getfolder_1_macctrlpanel
     --------------------------------------


     Install cancelled by script
     Finished Installation  06/26/2000 16:35:21

-------------------------------------------------------------------------------
file:///C|/XPIStage/test/test.xpi  --  06/27/2000 11:24:24
-------------------------------------------------------------------------------

     Acceptance: a_getfolder_1_macctrlpanel
     --------------------------------------

     ** returned value = -208

     Install cancelled by script
     Finished Installation  06/27/2000 11:24:24

install script:

regName = "getfolder_1_macctrlpanel";
jarSrc = "smrtupdt.txt";
var vi = "1.0.1.19";

initInstall("Acceptance: a_getfolder_1_macctrlpanel", regName, vi, 0);
f = getFolder("Mac Control Panel");
err = addFile(regName, jarSrc, f, jarSrc);
logComment("returned value = " + err);

if (0 == getLastError())
	performInstall();
else
	cancelInstall();
(Assignee)

Comment 1

18 years ago
getFolder() does not return errors nor print them in the log, it simply returns 
a null. It does not distinguish between a folder that might be OK in some other 
environment and total garbage, it should return null instead of a valid folder 
object in both cases. 

You should probably get in the habit of logging the return value from 
getFolder() in your tests just as you log error values elsewhere. The -208 
error is from addFile() because you passed a null, it doesn't distinguish 
between typing in the word null in the script or a variable set to null.

Unless I'm misunderstanding the bug this is the way it's supposed to work.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

18 years ago
my mistake with the logComment. It should have been capturing the return value 
of getFolder(). It is returning null.

file:///C|/XPIStage/test/test.xpi  --  06/27/2000 12:16:15
-------------------------------------------------------------------------------

     Acceptance: a_getfolder_1_macctrlpanel
     --------------------------------------

     ** return value from get folder = null

     Install cancelled by script
     Finished Installation  06/27/2000 12:16:16
Status: RESOLVED → VERIFIED
(Reporter)

Comment 3

18 years ago
Reopened bug. Summary reworded. The real problem here is that when getFolder 
returns a null folder object, and the object is passed to an API that accepts 
it (addFile, addDirectory, registerChrome, setPackageFolder, Patch) error isn't 
returned by XP. Expecting -208 to be returned.

created 43965.xpi on http://jimbob/bugs (this is the AddDir case).

some sample script snippets:

regName = "getfolder_1_macctrlpanel";
jarSrc = "smrtupdt.txt";
var vi = "1.0.1.19";

initInstall("Acceptance: a_getfolder_1_macctrlpanel", regName, vi, 0);
f = getFolder("Mac Control Panel");
logComment("return value from get folder = " + f);
err = addFile(regName, jarSrc, f, jarSrc);
logComment("addFile error = " + err);

if (0 == getLastError())
	performInstall();
else
	cancelInstall();

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

...
err = registerChrome(PACKAGE, null);
...


Status: VERIFIED → REOPENED
QA Contact: jimmylee → depstein
Resolution: INVALID → ---
Summary: Mac target folders don't return error when run on other platforms → APIs accepting null folder object (e.g. addFile, addDir) don't return error.

Comment 4

17 years ago
Updating QA Contact.
QA Contact: depstein → jimmylee

Updated

16 years ago
Status: REOPENED → ASSIGNED
(Reporter)

Comment 5

14 years ago
Test case can be triggered from
http://www.mozilla.org/quality/smartupdate/xpinstall-trigger.html
Just select one of the Mac Getfolder items from the Acceptance Test Case menu
(e.g. a_getfolder_1_macctrlpanel, a_getfolder_1_macextension)
(Assignee)

Comment 6

10 years ago
The xpinstall script engine has been removed from the trunk, bugs in it are obsolete.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago10 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.