| 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);
|
| + });
|
| }
|
|
|