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

Unified Diff: tests/html/cross_frame_test.dart

Issue 11047021: New cross frame base types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regen dart:html Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/html/templates/html/interface/interface_Window.darttemplate ('k') | tests/html/fileapi_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/cross_frame_test.dart
diff --git a/tests/html/cross_frame_test.dart b/tests/html/cross_frame_test.dart
index aadc65b583f6bff664c6574b2aaf3aecab64a393..4021de42eb89c76b719c8c416ca69856ceebaf3b 100644
--- a/tests/html/cross_frame_test.dart
+++ b/tests/html/cross_frame_test.dart
@@ -6,20 +6,55 @@
main() {
useHtmlConfiguration();
- test('contentWindow', () {
- final iframe = new Element.tag('iframe');
- document.body.nodes.add(iframe);
+ final iframe = new Element.tag('iframe');
+ document.body.nodes.add(iframe);
+
+ test('window', () {
+ expect(window is LocalWindow);
+ expect(window.document == document);
+ });
+
+ test('iframe', () {
final frameWindow = iframe.contentWindow;
+ expect(frameWindow is Window);
+ expect(frameWindow is! LocalWindow);
+ expect(frameWindow.parent is LocalWindow);
// Ensure that the frame's document is inaccessible via window.
expect(() => frameWindow.document, throws);
});
test('contentDocument', () {
- final iframe = new Element.tag('iframe');
- document.body.nodes.add(iframe);
-
// Ensure that the frame's document is inaccessible.
expect(() => iframe.contentDocument, throws);
});
+
+ test('location', () {
+ expect(window.location is LocalLocation);
+ final frameLocation = iframe.contentWindow.location;
+ expect(frameLocation is Location);
+ expect(frameLocation is! LocalLocation);
+
+ expect(() => frameLocation.href, throws);
+ expect(() => frameLocation.hash, throws);
+
+ final frameParentLocation = iframe.contentWindow.parent.location;
+ expect(frameParentLocation is LocalLocation);
+ });
+
+ test('history', () {
+ expect(window.history is LocalHistory);
+ final frameHistory = iframe.contentWindow.history;
+ expect(frameHistory is History);
+ expect(frameHistory is! LocalHistory);
+
+ // Valid methods.
+ frameHistory.back();
+ frameHistory.forward();
+
+ expect(() => frameHistory.length, throws);
+
+ final frameParentHistory = iframe.contentWindow.parent.history;
+ expect(frameParentHistory is LocalHistory);
+ });
}
« no previous file with comments | « lib/html/templates/html/interface/interface_Window.darttemplate ('k') | tests/html/fileapi_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698