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

Unified Diff: LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html

Issue 1327263002: Modifies WindowProxy::setSecurityToken so that the frame's SecurityOrigin is taken into account whe… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added layout test. Created 5 years, 3 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
Index: LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html
diff --git a/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html b/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html
new file mode 100644
index 0000000000000000000000000000000000000000..c3a13504e48cf9632dea9f14b8546d270ae7f3a2
--- /dev/null
+++ b/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-parent-isolated-world.html
@@ -0,0 +1,32 @@
+<html>
jochen (gone - plz use gerrit) 2015/09/14 08:56:35 nit. add <!DOCTYPE html>
epertoso 2015/09/14 09:13:50 Done.
+<body>
+<script>
+testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
+runTestInWorld(2, 'accessParentDocument');
+
+function runTestInWorld(worldId, funcName)
+{
+ testRunner.evaluateScriptInIsolatedWorld(
+ worldId, String(eval(funcName)) + "\n" + funcName + "();");
+}
+
+function accessParentDocument()
+{
+ function debug(message) {
+ window.parent.postMessage(JSON.stringify({ 'type' : 'debug', 'message' : message }), '*');
+ }
+ function finish() {
+ window.parent.postMessage(JSON.stringify({ 'type' : 'finish' }), '*');
+ }
+ var description = 'Parent document access from isolated world is not allowed.'
+ try {
+ var doc = window.parent.document;
+ debug('FAIL ' + description);
+ } catch (e) {
+ debug('PASS ' + description);
+ }
+ finish();
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698