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

Side by Side Diff: pkg/dev_compiler/test/codegen/lib/html/cross_frame_test.dart

Issue 2413073002: Start cleaning up the HTML tests. (Closed)
Patch Set: Unfork expect.dart. Created 4 years, 2 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
OLDNEW
1 library CrossFrameTest;
2 import 'package:unittest/unittest.dart';
3 import 'package:unittest/html_config.dart';
4 import 'dart:html'; 1 import 'dart:html';
5 2
3 import 'package:minitest/minitest.dart';
4
6 main() { 5 main() {
7 useHtmlConfiguration();
8
9 var isWindowBase = predicate((x) => x is WindowBase, 'is a WindowBase'); 6 var isWindowBase = predicate((x) => x is WindowBase, 'is a WindowBase');
10 var isWindow = predicate((x) => x is Window, 'is a Window'); 7 var isWindow = predicate((x) => x is Window, 'is a Window');
11 var isLocationBase = predicate((x) => x is LocationBase, 'is a LocationBase'); 8 var isLocationBase = predicate((x) => x is LocationBase, 'is a LocationBase');
12 var isLocation = 9 var isLocation =
13 predicate((x) => x is Location, 'is a Location'); 10 predicate((x) => x is Location, 'is a Location');
14 var isHistoryBase = predicate((x) => x is HistoryBase, 'is a HistoryBase'); 11 var isHistoryBase = predicate((x) => x is HistoryBase, 'is a HistoryBase');
15 var isHistory = predicate((x) => x is History, 'is a History'); 12 var isHistory = predicate((x) => x is History, 'is a History');
16 13
17 final iframe = new Element.tag('iframe'); 14 final iframe = new IFrameElement();
18 document.body.append(iframe); 15 document.body.append(iframe);
19 16
20 test('window', () { 17 test('window', () {
21 expect(window, isWindow); 18 expect(window, isWindow);
22 expect(window.document, document); 19 expect(window.document, document);
23 }); 20 });
24 21
25 test('iframe', () { 22 test('iframe', () {
26 final frameWindow = iframe.contentWindow; 23 final frameWindow = iframe.contentWindow;
27 expect(frameWindow, isWindowBase); 24 expect(frameWindow, isWindowBase);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 63
67 // Valid methods. 64 // Valid methods.
68 frameHistory.forward(); 65 frameHistory.forward();
69 66
70 expect(() => frameHistory.length, throws); 67 expect(() => frameHistory.length, throws);
71 68
72 final frameParentHistory = iframe.contentWindow.parent.history; 69 final frameParentHistory = iframe.contentWindow.parent.history;
73 expect(frameParentHistory, isHistory); 70 expect(frameParentHistory, isHistory);
74 }); 71 });
75 } 72 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/codegen/lib/html/client_rect_test.dart ('k') | pkg/dev_compiler/test/codegen/lib/html/crypto_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698