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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator.html

Issue 2800053003: v8binding: Makes xss-DENIED-window-name-navigator deterministic. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator.html b/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator.html
index 8edcd8a92421956533b4bbbf6026048ff4c436f0..31759a844f83c69d2affc3b42c162abc7ea24092 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator.html
@@ -1,36 +1,51 @@
+<pre id="iframe1-srcdoc" style="display: none;">
+&lt;script&gt;
+try {
+ top.navigator;
+ console.log('FAIL');
+} catch (e) {
+ console.log("iframe1: " + e.toString());
+}
+this.x = 7;
+window.name = 'navigator';
+try {
+ top.navigator;
+ console.log('FAIL');
+} catch (e) {
+ console.log("iframe1: " + e.toString());
+}
+&lt;/script&gt;
+</pre>
+
+<pre id="iframe2-srcdoc" style="display: none;">
+&lt;script&gt;
+try {
+ top.navigator;
+ console.log('FAIL');
+} catch (e) {
+ console.log("iframe2: " + e.toString());
+}
+&lt;/script&gt;
+</pre>
+
<script>
if (window.testRunner)
testRunner.dumpAsText();
+
+function createIFrame(srcdoc) {
+ var iframe = document.createElement('iframe');
+ iframe.sandbox = "allow-scripts";
+ iframe.srcdoc = srcdoc;
+ return iframe;
+}
+
+var iframe1 = createIFrame(
+ document.getElementById('iframe1-srcdoc').textContent);
+var iframe2 = createIFrame(
+ document.getElementById('iframe2-srcdoc').textContent);
+
+iframe1.addEventListener('load', () => {
+ document.body.appendChild(iframe2);
+}, false);
+document.body.appendChild(iframe1);
</script>
-<iframe
- sandbox="allow-scripts"
- srcdoc="
-<script>
- try {
- top.navigator;
- console.log('FAIL');
- } catch (e) {
- console.log(e.toString());
- }
- this.x = 7;
- window.name = 'navigator';
- try {
- top.navigator;
- console.log('FAIL');
- } catch (e) {
- console.log(e.toString());
- }
-</script>"
-></iframe>
-<iframe
- sandbox="allow-scripts"
- srcdoc="
-<script>
- try {
- top.navigator;
- console.log('FAIL');
- } catch (e) {
- console.log(e.toString());
- }
-</script>"
-></iframe>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-name-navigator-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698