OLD | NEW |
1 library HistoryTest; | 1 library HistoryTest; |
2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import '../../pkg/unittest/lib/unittest.dart'; |
3 import '../../pkg/unittest/lib/html_individual_config.dart'; | 3 import '../../pkg/unittest/lib/html_individual_config.dart'; |
4 import 'dart:html'; | 4 import 'dart:html'; |
5 | 5 |
6 /// Waits for a callback once, then removes the event handler. | 6 /// Waits for a callback once, then removes the event handler. |
7 void expectAsync1Once(EventListenerList list, void callback(arg)) { | 7 void expectAsync1Once(EventListenerList list, void callback(arg)) { |
8 var fn = null; | 8 var fn = null; |
9 fn = expectAsync1((arg) { | 9 fn = expectAsync1((arg) { |
10 list.remove(fn); | 10 list.remove(fn); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 test('replaceState', () { | 60 test('replaceState', () { |
61 expect(() { | 61 expect(() { |
62 var length = window.history.length; | 62 var length = window.history.length; |
63 | 63 |
64 window.history.replaceState(null, document.title, '?foo=baz'); | 64 window.history.replaceState(null, document.title, '?foo=baz'); |
65 expect(window.history.length, length); | 65 expect(window.history.length, length); |
66 expect(window.location.href.endsWith('foo=baz'), isTrue); | 66 expect(window.location.href.endsWith('foo=baz'), isTrue); |
67 }, expectation); | 67 }, expectation); |
68 }); | 68 }); |
| 69 |
| 70 test('hashchangeevent', () { |
| 71 var event = new HashChangeEvent('change', oldUrl:'old', newUrl: 'new'); |
| 72 expect(event is HashChangeEvent, true); |
| 73 expect(event.oldUrl, 'old'); |
| 74 expect(event.newUrl, 'new'); |
| 75 }); |
69 }); | 76 }); |
70 } | 77 } |
OLD | NEW |