gabrielg-xultestrunner 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.3
|
data/xulapp/application.ini
CHANGED
|
@@ -28,7 +28,7 @@ Object.extend(XULTestCase, {
|
|
|
28
28
|
if (this.__LAST_DEFINED_TESTCASE__) {
|
|
29
29
|
return this.__LAST_DEFINED_TESTCASE__;
|
|
30
30
|
} else {
|
|
31
|
-
throw("
|
|
31
|
+
throw("Wuh Oh");
|
|
32
32
|
}
|
|
33
33
|
} catch (e) {
|
|
34
34
|
this._handleTestLoadError(fileURI, e);
|
|
@@ -38,7 +38,10 @@ Object.extend(XULTestCase, {
|
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
_handleTestLoadError: function(fileURI, e) {
|
|
41
|
-
|
|
41
|
+
// Notify observers we failed and hope for the best
|
|
42
|
+
// FIXME - this sucks error reporting wise
|
|
43
|
+
var observerService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
|
44
|
+
observerService.notifyObservers(null, "xultestrunner-testloaderror", Object.toJSON({file: fileURI, exception: e.toString()}));
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
});
|
|
@@ -29,8 +29,13 @@ var XULTestRunner = Class.create({
|
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
observe: function(subject, topic, data) {
|
|
32
|
-
// Need to pass between observers as JSON to avoid crashes. Wee.
|
|
33
|
-
|
|
32
|
+
// Need to pass between observers as JSON to avoid XPCOM crashes. Wee.
|
|
33
|
+
var data = data.evalJSON();
|
|
34
|
+
if (topic == "xultestrunner-testdone") {
|
|
35
|
+
this._testResults.push(data);
|
|
36
|
+
} else if (topic == "xultestrunner-testloaderror") {
|
|
37
|
+
puts("There was an error loading test '#{file}': #{exception}".interpolate(data));
|
|
38
|
+
}
|
|
34
39
|
this._runNextTest();
|
|
35
40
|
},
|
|
36
41
|
|
|
@@ -84,6 +89,7 @@ var XULTestRunner = Class.create({
|
|
|
84
89
|
_registerObservers: function() {
|
|
85
90
|
var observerService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
|
86
91
|
observerService.addObserver(this, "xultestrunner-testdone", false);
|
|
92
|
+
observerService.addObserver(this, "xultestrunner-testloaderror", false);
|
|
87
93
|
}
|
|
88
94
|
});
|
|
89
95
|
|
data/xultestrunner.gemspec
CHANGED