diff options
| author | Misko Hevery | 2010-08-13 10:01:53 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-08-13 10:01:53 -0700 |
| commit | f6ff0521ad3f298687f7105211ee9cc20a21707c (patch) | |
| tree | 4367aa6d53832db608a0de2df9d3b42a5ffc97db /src | |
| parent | 5c14a35e6210fb8500456b3b4ca026cfeb889776 (diff) | |
| parent | f6527bd53c1d80c7db549b22ecf3aa02e96cda1f (diff) | |
| download | angular.js-f6ff0521ad3f298687f7105211ee9cc20a21707c.tar.bz2 | |
Merge branch 'master' of github.com:angular/angular.js
Diffstat (limited to 'src')
| -rw-r--r-- | src/scenario/DSL.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/scenario/DSL.js b/src/scenario/DSL.js index 3b049dc6..a64f8548 100644 --- a/src/scenario/DSL.js +++ b/src/scenario/DSL.js @@ -1,5 +1,6 @@ angular.scenario.dsl.browser = { navigateTo: function(url){ + var location = this.location; return $scenario.addFuture('Navigate to: ' + url, function(done){ var self = this; this.testFrame.load(function(){ @@ -15,8 +16,22 @@ angular.scenario.dsl.browser = { this.testFrame[0].contentWindow.location.reload(); } else { this.testFrame.attr('src', url); + location.setLocation(url); } }); + }, + location: { + href: "", + hash: "", + toEqual: function(url) { + return (this.hash == "" ? (url == this.href) : + (url == (this.href + "/#/" + this.hash))); + }, + setLocation: function(url) { + var urlParts = url.split("/#/"); + this.href = urlParts[0] || ""; + this.hash = urlParts[1] || ""; + } } }; |
