OLD | NEW |
1 #library('HistoryTest'); | 1 #library('HistoryTest'); |
2 #import('../../../testing/unittest/unittest.dart'); | 2 #import('../../../testing/unittest/unittest_dom.dart'); |
3 #import('dart:dom'); | 3 #import('dart:dom'); |
4 | 4 |
5 main() { | 5 main() { |
6 forLayoutTests(); | 6 forLayoutTests(); |
7 test('History', () { | 7 test('History', () { |
8 window.history.pushState(null, document.title, '?foo=bar'); | 8 window.history.pushState(null, document.title, '?foo=bar'); |
9 expect(window.history.length).equals(2); | 9 expect(window.history.length).equals(2); |
10 window.history.back(); | 10 window.history.back(); |
11 expect(window.location.href.endsWith('foo=bar')).isTrue(); | 11 expect(window.location.href.endsWith('foo=bar')).isTrue(); |
12 | 12 |
13 window.history.replaceState(null, document.title, '?foo=baz'); | 13 window.history.replaceState(null, document.title, '?foo=baz'); |
14 Expect.equals(2, window.history.length); | 14 Expect.equals(2, window.history.length); |
15 expect(window.location.href.endsWith('foo=baz')).isTrue(); | 15 expect(window.location.href.endsWith('foo=baz')).isTrue(); |
16 }); | 16 }); |
17 } | 17 } |
OLD | NEW |