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.2
1
+ 0.2.3
@@ -1,7 +1,7 @@
1
1
  [App]
2
2
  Name=XULTestRunner
3
- Version=0.2.2
4
- BuildID=859ab1e7-bc8e-42bf-83d0-d84abcba0d48
3
+ Version=0.2.3
4
+ BuildID=badffba7-8ff1-44cc-9ee2-832aa7332e27
5
5
  ID=XULTestRunner@conflagrationjs.org
6
6
  Vendor=Conflagration JS
7
7
 
@@ -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("wuh oh");
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
- puts("There was a problem loading the test case from '" + fileURI + "': " + e);
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
- this._testResults.push(data.evalJSON());
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
 
@@ -1,4 +1,5 @@
1
1
  (function(outerScope){
2
+ // FIXME - make the code stop making my eyes bleed.
2
3
  COMPONENTS = [];
3
4
 
4
5
  var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xultestrunner}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gabriel Gironda"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gabrielg-xultestrunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Gironda