2010-04-04 00:04:36 +00:00
|
|
|
BrowserTest = TestCase('BrowserTest');
|
2010-04-01 00:56:16 +00:00
|
|
|
|
2010-04-04 00:04:36 +00:00
|
|
|
BrowserTest.prototype.testUrlWatcher = function () {
|
2010-04-01 00:56:16 +00:00
|
|
|
expectAsserts(2);
|
|
|
|
|
var location = {href:"http://server", hash:""};
|
2010-04-06 03:53:33 +00:00
|
|
|
var watcher = new Browser(location, {});
|
2010-04-01 00:56:16 +00:00
|
|
|
watcher.delay = 1;
|
2010-04-04 00:04:36 +00:00
|
|
|
watcher.watchUrl(function(url){
|
2010-04-01 00:56:16 +00:00
|
|
|
assertEquals('http://getangular.test', url);
|
|
|
|
|
});
|
|
|
|
|
watcher.setTimeout = function(fn, delay){
|
|
|
|
|
assertEquals(1, delay);
|
|
|
|
|
location.href = "http://getangular.test";
|
|
|
|
|
watcher.setTimeout = function(fn, delay) {
|
|
|
|
|
};
|
|
|
|
|
fn();
|
|
|
|
|
};
|
2010-04-04 00:04:36 +00:00
|
|
|
watcher.startUrlWatcher();
|
2010-04-01 00:56:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FunctionTest = TestCase("FunctionTest");
|
|
|
|
|
|
|
|
|
|
FunctionTest.prototype.testEscapeHtml = function () {
|
|
|
|
|
assertEquals("<div>&amp;</div>", escapeHtml('<div>&</div>'));
|
|
|
|
|
};
|