aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-03 17:04:36 -0700
committerMisko Hevery2010-04-03 17:04:36 -0700
commita80a61839a66d244c8bb14bbe2975746e02516c8 (patch)
tree5a7b4d9d3e2a7a15ebf55e068782fbf2aa4ac6bf /test/testabilityPatch.js
parent35ca4fcb9c49e505e28669e951e01ddedb01d7db (diff)
downloadangular.js-a80a61839a66d244c8bb14bbe2975746e02516c8.tar.bz2
injection is now working
Diffstat (limited to 'test/testabilityPatch.js')
-rw-r--r--test/testabilityPatch.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 86d139cf..752f8ef2 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -3,7 +3,7 @@ dump = bind(jstd.console, jstd.console.log);
function nakedExpect(obj) {
return expect(angular.fromJson(angular.toJson(obj)));
-};
+}
swfobject = {
createSwf:function() {
@@ -27,15 +27,27 @@ function report(reportTest){
});
}
-MockLocation = function() {
+function MockBrowser() {
this.url = "http://server";
+ this.watches = [];
+}
+MockBrowser.prototype = {
+ getUrl: function(){
+ return this.url;
+ },
+
+ setUrl: function(url){
+ this.url = url;
+ },
+
+ watchUrl: function(fn) {
+ this.watches.push(fn);
+ }
};
-MockLocation.prototype.get = function(){
- return this.url;
-};
-MockLocation.prototype.set = function(url){
- this.url = url;
-};
+
+angularService('$browser', function(){
+ return new MockBrowser();
+});
function childNode(element, index) {
return jqLite(element[0].childNodes[index]);
@@ -80,7 +92,7 @@ function sortedHtml(element) {
}
})(element[0]);
return html;
-};
+}
function isVisible(node) {
var display = node.css('display');