supergoldorak / kuda

Automatically exported from code.google.com/p/kuda
GNU General Public License v2.0
0 stars 0 forks source link

hemi.loader.loadModel does not trigger Javascript alert when expected #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When attempting to load a json file with an incorrect url a javascript alert is 
not triggered as expected. 

in: hemi.loader.loadModel()

see the clause:

if (exception) {
    alert('Loading failed: ' + exception);
} else if (opt_callback) {
    opt_callback(pack, parent);
}

The alert will never be triggered if an incorrect url is supplied.  In this 
case an error occurs in archive_request.js in the function 
o3d.ArchiveRequest.prototype.send();

The various try-catch blocks seem not to trap this as an exception and the 
intended alert is never displayed.

Original issue reported on code.google.com by raj...@gmail.com on 17 May 2011 at 12:20

GoogleCodeExporter commented 9 years ago
I put the unit tests online.

http://dev/kuda/public/unit_tests/

look at the failures to in test 4 to see what I cam talking about. I will 
commit the unit tests when I get the go-ahead from John P

Original comment by raj...@gmail.com on 17 May 2011 at 2:36

GoogleCodeExporter commented 9 years ago
Taking ownership to fix.

Original comment by erik.kit...@gmail.com on 17 May 2011 at 10:55

GoogleCodeExporter commented 9 years ago
Fixed: Added check for exception message so it can be passed up to calling 
functions.

Original comment by erik.kit...@gmail.com on 17 May 2011 at 10:56

GoogleCodeExporter commented 9 years ago
Great Erik, Thanks! I just verified this with a new unit test (Unit 2).
you can run it by going here. 

http://labs.rajdye.com/superb/kuda/unit_tests/

You will not see the alert because the jqUnit framework intercepts the alert 
dialog and verifies everything the text of the error message.

Original comment by raj...@gmail.com on 18 May 2011 at 2:56

GoogleCodeExporter commented 9 years ago
Thanks for setting up a test framework and writing these unit tests Raj! They 
are a huge help!

Original comment by erik.kit...@gmail.com on 18 May 2011 at 4:14

GoogleCodeExporter commented 9 years ago
Haha, usually I am not the person writing unit tests on a team usually I am the 
one annoyed by unit tests, so I am glad that they are a help.

Original comment by raj...@gmail.com on 20 May 2011 at 1:06

GoogleCodeExporter commented 9 years ago

Original comment by raj...@gmail.com on 20 May 2011 at 1:06