| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 test('replaceState', () { | 66 test('replaceState', () { |
| 67 expect(() { | 67 expect(() { |
| 68 var length = window.history.length; | 68 var length = window.history.length; |
| 69 | 69 |
| 70 window.history.replaceState(null, document.title, '?foo=baz'); | 70 window.history.replaceState(null, document.title, '?foo=baz'); |
| 71 expect(window.history.length, length); | 71 expect(window.history.length, length); |
| 72 expect(window.location.href.endsWith('foo=baz'), isTrue); | 72 expect(window.location.href.endsWith('foo=baz'), isTrue); |
| 73 }, expectation); | 73 }, expectation); |
| 74 }); | 74 }); |
| 75 | 75 |
| 76 test('popstatevent', () { |
| 77 expect(() { |
| 78 var event = new Event.eventType('PopStateEvent', 'popstate'); |
| 79 expect(event is PopStateEvent, true); |
| 80 }, expectation); |
| 81 }); |
| 82 |
| 76 test('hashchangeevent', () { | 83 test('hashchangeevent', () { |
| 77 var expectation = HashChangeEvent.supported ? returnsNormally : throws; | 84 var expectation = HashChangeEvent.supported ? returnsNormally : throws; |
| 78 expect(() { | 85 expect(() { |
| 79 var event = new HashChangeEvent('change', oldUrl:'old', newUrl: 'new'); | 86 var event = new HashChangeEvent('change', oldUrl:'old', newUrl: 'new'); |
| 80 expect(event is HashChangeEvent, true); | 87 expect(event is HashChangeEvent, true); |
| 81 expect(event.oldUrl, 'old'); | 88 expect(event.oldUrl, 'old'); |
| 82 expect(event.newUrl, 'new'); | 89 expect(event.newUrl, 'new'); |
| 83 }, expectation); | 90 }, expectation); |
| 84 }); | 91 }); |
| 85 }); | 92 }); |
| 86 } | 93 } |
| OLD | NEW |