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

Side by Side Diff: LayoutTests/http/tests/security/create-document-change-domain.html

Issue 50573004: Don't set document.domain to an IP address fragment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: missing weboriginexport header Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="/js-test-resources/js-test-pre.js"></script> 2 <script src="/js-test-resources/js-test-pre.js"></script>
3 <script> 3 <script>
4
5 description('Tests that different documents created using createDocument do not share the underlying domain'); 4 description('Tests that different documents created using createDocument do not share the underlying domain');
5 if (window.internals)
6 internals.settings.setTreatIPAddressAsDomain(true);
6 7
7 var doc = document.implementation.createDocument(null, 'one', null); 8 var doc = document.implementation.createDocument(null, 'one', null);
8 var doc2 = document.implementation.createHTMLDocument('title');
9 shouldBeEqualToString('document.domain', '127.0.0.1'); 9 shouldBeEqualToString('document.domain', '127.0.0.1');
10 shouldBeEqualToString('doc.domain', '127.0.0.1'); 10 shouldBeEqualToString('doc.domain', '127.0.0.1');
11 shouldBeEqualToString('doc2.domain', '127.0.0.1');
12
13 doc.domain = '0.0.1';
14 shouldBeEqualToString('document.domain', '127.0.0.1');
15 shouldBeEqualToString('doc.domain', '0.0.1');
16 shouldBeEqualToString('doc2.domain', '127.0.0.1');
17 11
18 document.domain = '0.1'; 12 document.domain = '0.1';
19 shouldBeEqualToString('document.domain', '0.1'); 13 shouldBeEqualToString('document.domain', '0.1');
20 shouldBeEqualToString('doc.domain', '0.0.1'); 14 shouldBeEqualToString('doc.domain', '127.0.0.1');
21 shouldBeEqualToString('doc2.domain', '127.0.0.1');
22
23 doc2.domain = '1';
24 shouldBeEqualToString('document.domain', '0.1');
25 shouldBeEqualToString('doc.domain', '0.0.1');
26 shouldBeEqualToString('doc2.domain', '1');
27
28 </script> 15 </script>
29 <script src="/js-test-resources/js-test-post.js"></script> 16 <script src="/js-test-resources/js-test-post.js"></script>
30 </html> 17 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698