blob: 5254840a048580e2f300362b0629759d6404d843 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  | 
BrowserTest = TestCase('BrowserTest');
BrowserTest.prototype.testUrlWatcher = function () {
  expectAsserts(2);
  var location = {href:"http://server", hash:""};
  var watcher = new Browser(location, {});
  watcher.delay = 1;
  watcher.watchUrl(function(url){
    assertEquals('http://getangular.test', url);
  });
  watcher.setTimeout = function(fn, delay){
    assertEquals(1, delay);
    location.href = "http://getangular.test";
    watcher.setTimeout = function(fn, delay) {
    };
    fn();
  };
  watcher.startUrlWatcher();
};
FunctionTest = TestCase("FunctionTest");
FunctionTest.prototype.testEscapeHtml = function () {
  assertEquals("<div>&amp;</div>", escapeHtml('<div>&</div>'));
};
  |