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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/access-storage.php

Issue 2005783005: Re-enable storage for Suborigins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Rebase on ToT 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/access-storage.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/access-storage.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/access-storage.php
new file mode 100644
index 0000000000000000000000000000000000000000..65fb7cb86b2bf9cbced4864067d6d0ece655c490
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/access-storage.php
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<script>
+window.onmessage = function(event) {
+ var storage;
+ var prefix;
+ if (event.data.type == 'localStorage') {
+ storage = localStorage;
+ prefix = 'LOCAL_';
+ } else if (event.data.type == 'sessionStorage') {
+ storage = sessionStorage;
+ prefix = 'SESSION_';
+ } else {
+ assert_unreached('Unknown storage type');
+ }
+ storage.setItem(prefix + "FOO2", "BAR");
+ window.parent.postMessage({ "type": event.data.type, "value": storage.getItem(prefix + "_FOO1") }, '*');
+};
+window.parent.postMessage('ready', '*');
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698