Bug 1370468 - Files for frame-ancestor tests including userpass added and also testcase added in TestCSPParser draft
authorvinoth <cegvinoth@gmail.com>
Mon, 04 Sep 2017 13:48:41 +0200
changeset 658598 c88d638d10b3fae5a204a6c0bc857ed05d22e1a7
parent 658461 c7a53893c9674d5d8b0894e8209840ec9bc867d2
child 729705 26351a8a9d7b285b47a8b2d7e8d5b3745d4754cd
push id77822
push userbmo:cegvinoth@gmail.com
push dateMon, 04 Sep 2017 11:49:21 +0000
bugs1370468
milestone57.0a1
Bug 1370468 - Files for frame-ancestor tests including userpass added and also testcase added in TestCSPParser MozReview-Commit-ID: 72t912jRXsP
dom/security/test/csp/file_frameancestors_userpass.html
dom/security/test/csp/file_frameancestors_userpass_frame_a.html
dom/security/test/csp/file_frameancestors_userpass_frame_b.html
dom/security/test/csp/file_frameancestors_userpass_frame_c.html
dom/security/test/csp/file_frameancestors_userpass_frame_d.html
dom/security/test/gtest/TestCSPParser.cpp
--- 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" },