diff options
| author | Andres Ornelas | 2010-05-27 11:26:23 -0700 |
|---|---|---|
| committer | Andres Ornelas | 2010-05-27 11:26:23 -0700 |
| commit | cb5d21192787985bbff20b369e885639de253345 (patch) | |
| tree | 127c401a80e03ac4f6ad657ddbc1dfe6841d0f2a /src/scenario | |
| parent | 177873df86b6b069892184f24518959e7cef33cd (diff) | |
| download | angular.js-cb5d21192787985bbff20b369e885639de253345.tar.bz2 | |
extracted switchRouteMatcher and added necessary libraries to angular-scenario
Diffstat (limited to 'src/scenario')
| -rw-r--r-- | src/scenario/DSL.js | 2 | ||||
| -rw-r--r-- | src/scenario/Runner.js | 32 |
2 files changed, 18 insertions, 16 deletions
diff --git a/src/scenario/DSL.js b/src/scenario/DSL.js index f1b9c226..b318e99c 100644 --- a/src/scenario/DSL.js +++ b/src/scenario/DSL.js @@ -4,8 +4,8 @@ angular.scenario.dsl.browser = { var self = this; self.testFrame.load(function(){ self.testFrame.unbind(); - self.testDocument = jQuery(self.testWindow.document); self.testWindow = self.testFrame[0].contentWindow; + self.testDocument = jQuery(self.testWindow.document); self.$browser = self.testWindow.angular.service.$browser(); self.notifyWhenNoOutstandingRequests = bind(self.$browser, self.$browser.notifyWhenNoOutstandingRequests); self.notifyWhenNoOutstandingRequests(done); diff --git a/src/scenario/Runner.js b/src/scenario/Runner.js index 68c3ff65..da6e2c39 100644 --- a/src/scenario/Runner.js +++ b/src/scenario/Runner.js @@ -48,7 +48,6 @@ angular.scenario.Runner.prototype = { jQuery(this).toggleClass('collapsed'); }); this.testFrame = body.find('#testView iframe'); - this.testWindow = this.testFrame[0].contentWindow; function logger(parent) { var container; return function(type, text) { @@ -100,27 +99,30 @@ angular.scenario.Runner.prototype = { execute: function(name, callback) { var spec = this.specs[name], + self = this, result = { - passed: false, - failed: false, - finished: false, - fail: function(error) { - result.passed = false; - result.failed = true; - result.error = error; - result.log('fail', isString(error) ? error : toJson(error)).fail(); - } - }; - specThis = { + passed: false, + failed: false, + finished: false, + fail: function(error) { + result.passed = false; + result.failed = true; + result.error = error; + result.log('fail', isString(error) ? error : toJson(error)).fail(); + } + }, + specThis = createScope({ result: result, - testWindow: this.testWindow, - testFrame: this.testFrame - }; + testFrame: this.testFrame, + testWindow: this.testWindow + }, angularService, {}); + this.self = specThis; var stepLogger = this.logger('spec', name); spec.nextStepIndex = 0; function done() { result.finished = true; stepLogger.close(); + self.self = null; (callback||noop).call(specThis); } function next(){ |
