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

Unified Diff: LayoutTests/dart/security/cross-frame-access.html

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/dart/resources/pong.html ('k') | LayoutTests/dart/security/cross-frame-access-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/security/cross-frame-access.html
diff --git a/LayoutTests/dart/security/cross-frame-access.html b/LayoutTests/dart/security/cross-frame-access.html
deleted file mode 100644
index 942cbc361ed027dd0533aba1fb37e4cefc7efb2c..0000000000000000000000000000000000000000
--- a/LayoutTests/dart/security/cross-frame-access.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<html>
-<body>
-<script type='application/javascript' src='../../../../../dart/client/testing/unittest/test_controller.js'></script>
-<script type=application/dart>
-#import('../../../../../dart/client/testing/unittest/unittest.dart');
-#import('dart:dom');
-
-main() {
- forLayoutTests();
-
- final sameOriginIFrame = document.createElement('iframe');
- sameOriginIFrame.src = 'resources/cross-frame-access-iframe.html';
-
- final crossOriginIFrame = document.createElement('iframe');
- crossOriginIFrame.src = 'data:text/html, <p>test iframe</p>';
-
- asyncTest('WaitForFramesLoad', 2, () {
- frameLoaded(Event e) { callbackDone(); }
- sameOriginIFrame.addEventListener('load', frameLoaded, true);
- document.body.appendChild(sameOriginIFrame);
- crossOriginIFrame.addEventListener('load', frameLoaded, true);
- document.body.appendChild(crossOriginIFrame);
- });
-
- test('DOMWindow', () {
- testDOMWindow(sameOriginIFrame.contentWindow);
- testDOMWindow(crossOriginIFrame.contentWindow);
- });
-
- test('History', () {
- testHistory(sameOriginIFrame.contentWindow.history);
- testHistory(crossOriginIFrame.contentWindow.history);
- });
-
- asyncTest('Location', 2, () {
- testLocation(sameOriginIFrame.contentWindow.location);
- testLocation(crossOriginIFrame.contentWindow.location);
- });
-}
-
-testDOMWindow(DOMWindow targetWindow) {
- // Not allowed methods.
- expectThrow(() => targetWindow.alert('test'));
- expectThrow(() => targetWindow.addEventListener('load', (Event e) {}, true));
- expectThrow(() => targetWindow.find('test', true, true, true, true, true, true));
-
- // Not allowed properties.
- expectThrow(() => targetWindow.contentDocument);
- expectThrow(() => targetWindow.localStorage);
- expectThrow(() => targetWindow.console);
-
- // Allowed methods.
- targetWindow.focus();
- targetWindow.blur();
- targetWindow.close();
-
- // Allowed properties.
- expect(targetWindow.location).isNotNull();
- expect(targetWindow.history).isNotNull();
- expect(targetWindow.parent).isNotNull();
-}
-
-testHistory(History history) {
- // Not allowed properties.
- expectThrow(() => history.length);
-
- // Not allowed methods.
- window.history.pushState('test', 'test', 'test');
- expectThrow(() => history.pushState('test', 'test', 'test'));
- window.history.replaceState('test', 'test', 'test');
- expectThrow(() => history.replaceState('test', 'test', 'test'));
-
- // Allowed method.
- history.back();
- history.forward();
- history.go(-1);
-}
-
-testLocation(Location location) {
- // Not allowed properties.
- expectThrow(() => location.href);
- expectThrow(() => location.protocol);
- expectThrow(() => location.host = 'test');
- expectThrow(() => location.origin);
-
- // Not allowed methods.
- expectThrow(() => location.assign('http://www.webkit.org'));
- expectThrow(() => location.reload());
- expectThrow(() => location.getParameter('test'));
-
- // Allowed properties.
- window.addEventListener('message', (Event e) {
- expect(e.data).equals('navigated');
- window.setTimeout(callbackDone, 0);
- });
- location.href = 'data:text/html, <script>parent.postMessage("navigated", "*")<' + '/script>';
-}
-</script>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/dart/resources/pong.html ('k') | LayoutTests/dart/security/cross-frame-access-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698