Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: tests/html/history_test.dart

Issue 12025027: Cleaning up event constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698