Bug 1370468 - Files for frame-ancestor tests including userpass added and also testcase added in TestCSPParser
MozReview-Commit-ID: 72t912jRXsP
--- a/dom/security/test/csp/file_frameancestors_userpass.html
+++ b/dom/security/test/csp/file_frameancestors_userpass.html
@@ -1,10 +1,10 @@
<html>
- <head>
- <title>CSP frame ancestors tests</title>
- </head>
- <body>
- <tt>Nested Frames</tt><br/>
- <iframe src='http://sampleuser:samplepass@mochi.test:8888/tests/dom/security/test/csp/file_frameancestors_userpass_frame_a.html'></iframe><br/>
- <iframe src='http://sampleuser:samplepass@example.com/tests/dom/security/test/csp/file_frameancestors_userpass_frame_b.html'></iframe><br/>
- </body>
+<head>
+ <title>CSP frame ancestors tests</title>
+</head>
+<body>
+ <tt>Nested Frames</tt><br/>
+ <iframe src='http://sampleuser:samplepass@mochi.test:8888/tests/dom/security/test/csp/file_frameancestors_userpass_frame_a.html'></iframe><br/>
+ <iframe src='http://sampleuser:samplepass@example.com/tests/dom/security/test/csp/file_frameancestors_userpass_frame_b.html'></iframe><br/>
+</body>
</html>
--- a/dom/security/test/csp/file_frameancestors_userpass_frame_a.html
+++ b/dom/security/test/csp/file_frameancestors_userpass_frame_a.html
@@ -1,12 +1,12 @@
<html>
- <head>
- <title>Nested frame</title>
- <script>
- parent.parent.postMessage({call: "frameLoaded", testname: "frame_a", uri: window.location.toString()}, "*");
- </script>
- </head>
- <body>
- <tt>IFRAME A</tt><br/>
- <iframe src='http://sampleuser:samplepass@mochi.test:8888/tests/dom/security/test/csp/file_frameancestors_userpass_frame_c.html'></iframe><br/>
- </body>
+<head>
+ <title>Nested frame</title>
+ <script>
+ parent.parent.postMessage({call: "frameLoaded", testname: "frame_a", uri: window.location.toString()}, "*");
+ </script>
+</head>
+<body>
+ <tt>IFRAME A</tt><br/>
+ <iframe src='http://sampleuser:samplepass@mochi.test:8888/tests/dom/security/test/csp/file_frameancestors_userpass_frame_c.html'></iframe><br/>
+</body>
</html>
--- a/dom/security/test/csp/file_frameancestors_userpass_frame_b.html
+++ b/dom/security/test/csp/file_frameancestors_userpass_frame_b.html
@@ -1,12 +1,12 @@
<html>
- <head>
- <title>Nested frame</title>
- <script>
- parent.parent.postMessage({call: "frameLoaded", testname: "frame_b", uri: window.location.toString()}, "*");
- </script>
- </head>
- <body>
- <tt>IFRAME B</tt><br/>
- <iframe src='http://sampleuser:samplepass@example.com/tests/dom/security/test/csp/file_frameancestors_userpass_frame_d.html'></iframe><br/>
- </body>
+<head>
+ <title>Nested frame</title>
+ <script>
+ parent.parent.postMessage({call: "frameLoaded", testname: "frame_b", uri: window.location.toString()}, "*");
+ </script>
+</head>
+<body>
+ <tt>IFRAME B</tt><br/>
+ <iframe src='http://sampleuser:samplepass@example.com/tests/dom/security/test/csp/file_frameancestors_userpass_frame_d.html'></iframe><br/>
+</body>
</html>
--- a/dom/security/test/csp/file_frameancestors_userpass_frame_c.html
+++ b/dom/security/test/csp/file_frameancestors_userpass_frame_c.html
@@ -1,8 +1,8 @@
<html>
- <head>
- <title>Nested frame</title>
- </head>
- <body>
- Nested frame C content
- </body>
+<head>
+ <title>Nested frame</title>
+</head>
+<body>
+ Nested frame C content
+</body>
</html>
--- a/dom/security/test/csp/file_frameancestors_userpass_frame_d.html
+++ b/dom/security/test/csp/file_frameancestors_userpass_frame_d.html
@@ -1,8 +1,8 @@
<html>
- <head>
- <title>Nested frame</title>
- </head>
- <body>
- Nested frame D content
- </body>
+<head>
+ <title>Nested frame</title>
+</head>
+<body>
+ Nested frame D content
+</body>
</html>
--- a/dom/security/test/gtest/TestCSPParser.cpp
+++ b/dom/security/test/gtest/TestCSPParser.cpp
@@ -794,17 +794,17 @@ TEST(CSPParser, GoodGeneratedPolicies)
"frame-ancestors http://www.selfuri.com" },
{ "frame-ancestors http://self.com:88",
"frame-ancestors http://self.com:88" },
{ "frame-ancestors http://a.b.c.d.e.f.g.h.i.j.k.l.x.com",
"frame-ancestors http://a.b.c.d.e.f.g.h.i.j.k.l.x.com" },
{ "frame-ancestors https://self.com:34",
"frame-ancestors https://self.com:34" },
{ "frame-ancestors http://sampleuser:samplepass@example.com",
- "frame-ancestors http://sampleuser:samplepass@example.com" },
+ "frame-ancestors 'none'" },
{ "default-src 'none'; frame-ancestors 'self'",
"default-src 'none'; frame-ancestors http://www.selfuri.com" },
{ "frame-ancestors http://self:80",
"frame-ancestors http://self:80" },
{ "frame-ancestors http://self.com/bar",
"frame-ancestors http://self.com/bar" },
{ "default-src 'self'; frame-ancestors 'self'",
"default-src http://www.selfuri.com; frame-ancestors http://www.selfuri.com" },