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

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

Issue 12036060: Fixing tests after event constructor change. (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
« no previous file with comments | « no previous file | tests/html/serialized_script_value_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 69
70 test('hashchangeevent', () { 70 test('hashchangeevent', () {
71 var event = new HashChangeEvent('change', oldUrl:'old', newUrl: 'new'); 71 expect(() {
72 expect(event is HashChangeEvent, true); 72 var event = new HashChangeEvent('change', oldUrl:'old', newUrl: 'new');
73 expect(event.oldUrl, 'old'); 73 expect(event is HashChangeEvent, true);
74 expect(event.newUrl, 'new'); 74 expect(event.oldUrl, 'old');
75 expect(event.newUrl, 'new');
76 }, expectation);
75 }); 77 });
76 }); 78 });
77 } 79 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/serialized_script_value_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698