Import Cobalt 19.master.0.203780

Includes the following patches:
  https://cobalt-review.googlesource.com/c/cobalt/+/5210
    by errong.leng@samsung.com
  https://cobalt-review.googlesource.com/c/cobalt/+/5270
    by linus.wang@samsung.com
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-default.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-default.sub.html
new file mode 100644
index 0000000..9222a8d
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-default.sub.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
+    <title>child-src-about-blank-allowed-by-default</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+ 
+    <!-- enforcing policy:
+child-src 'none'; object-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self';
+-->
+    <p>These frames should not be blocked by Content-Security-Policy.
+        It&apos;s pointless to block about:blank iframes because
+        blocking a frame just results in displaying about:blank anyway!
+    </p>
+    <iframe src="about:blank"></iframe>
+    <object type="text/html" data="about:blank"></object>
+
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=false"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-default.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-default.sub.html.sub.headers
new file mode 100644
index 0000000..68b2fb2
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-default.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-about-blank-allowed-by-default={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src 'none'; object-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-scheme.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-scheme.sub.html
new file mode 100644
index 0000000..d94eff6
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-scheme.sub.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
+    <title>child-src-about-blank-allowed-by-scheme</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+ 
+    <!-- enforcing policy:
+child-src about:; script-src 'self' 'unsafe-inline'; connect-src 'self';
+-->
+    <p>This frame should not be blocked by Content-Security-Policy.
+    </p>
+    <iframe src="about:blank"></iframe>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=false"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-scheme.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-scheme.sub.html.sub.headers
new file mode 100644
index 0000000..9ff84d6
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-about-blank-allowed-by-scheme.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-about-blank-allowed-by-scheme={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src about:; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-allowed.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-allowed.sub.html
new file mode 100644
index 0000000..12a075a
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-allowed.sub.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <title>child-src-allowed</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src='../support/logTest.sub.js?logs=["PASS IFrame %231 generated a load event."]'></script>
+    <script>
+        window.addEventListener("message", function(event) {
+            alert_assert(event.data);
+        }, false);
+
+        var t_alert = async_test('Expecting alerts: ["PASS"]');
+        var expected_alerts = ["PASS"];
+
+        function alert_assert(msg) {
+            t_alert.step(function() {
+                if (msg.match(/^FAIL/i)) {
+                    assert_unreached(msg);
+                    t_alert.done();
+                }
+                for (var i = 0; i < expected_alerts.length; i++) {
+                    if (expected_alerts[i] == msg) {
+                        assert_true(expected_alerts[i] == msg);
+                        expected_alerts.splice(i, 1);
+                        if (expected_alerts.length == 0) {
+                            t_alert.done();
+                        }
+                        return;
+                    }
+                }
+                assert_unreached('unexpected alert: ' + msg);
+                t_alert.done();
+            });
+        }
+
+    </script>
+    <!-- enforcing policy:
+Content-Security-Policy: child-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self';
+-->
+    <p>
+        This iframe should be allowed.
+    </p>
+    <script>
+        window.wasPostTestScriptParsed = true;
+        var loads = 0;
+
+        function loadEvent() {
+            loads++;
+            log("PASS " + "IFrame #" + loads + " generated a load event.");
+        }
+
+    </script>
+</head>
+
+<body>
+    <iframe src="/content-security-policy/blink-contrib/resources/postmessage-pass.html" onload="loadEvent()"></iframe>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=false"></script>
+</body>
+
+</html>
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-allowed.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-allowed.sub.html.sub.headers
new file mode 100644
index 0000000..7eb8d76
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-allowed.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-allowed={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-blocked.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-blocked.sub.html
new file mode 100644
index 0000000..e32cc0a
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-blocked.sub.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
+    <title>child-src-blocked</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src='../support/logTest.sub.js?logs=["PASS IFrame %231 generated a load event."]'></script>
+    <script>
+        window.addEventListener("message", function(event) {
+            alert_assert(event.data);
+        }, false);
+
+        function alert_assert(msg) {
+            t_log.step(function() {
+                if (msg.match(/^FAIL/i)) {
+                    assert_unreached(msg);
+                    t_log.done();
+                }
+                for (var i = 0; i < expected_alerts.length; i++) {
+                    if (expected_alerts[i] == msg) {
+                        assert_true(expected_alerts[i] == msg);
+                        expected_alerts.splice(i, 1);
+                        if (expected_alerts.length == 0) {
+                            t_log.done();
+                        }
+                        return;
+                    }
+                }
+                assert_unreached('unexpected alert: ' + msg);
+                t_log.done();
+            });
+        }
+
+    </script>
+    <!-- enforcing policy:
+child-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self';
+-->
+    <p>
+        IFrames blocked by CSP should generate a 'load', not 'error' event, regardless of blocked state. This means they appear to be normal cross-origin loads, thereby not leaking URL information directly to JS.
+    </p>
+    <script>
+        window.wasPostTestScriptParsed = true;
+        var loads = 0;
+
+        function loadEvent() {
+            loads++;
+            log("PASS " + "IFrame #" + loads + " generated a load event.");
+        }
+
+    </script>
+</head>
+
+<body>
+    <iframe src="/content-security-policy/blink-contrib/resources/postmessage-fail.html" onload="loadEvent()" onerror="log('FAIL')"></iframe>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=true&amp;reportField=violated-directive&amp;reportValue=child-src%20&apos;none&apos;"></script>
+</body>
+
+</html>
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-blocked.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-blocked.sub.html.sub.headers
new file mode 100644
index 0000000..961d18a
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-blocked.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-blocked={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-conflicting-frame-src.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-conflicting-frame-src.sub.html
new file mode 100644
index 0000000..b681253
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-conflicting-frame-src.sub.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>child-src-blocked</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src='../support/logTest.sub.js?logs=["PASS IFrame %231 generated a load event."]'></script>
+    <script>
+        window.addEventListener("message", function(event) {
+            alert_assert(event.data);
+        }, false);
+
+        function alert_assert(msg) {
+            t_log.step(function() {
+                if (msg.match(/^FAIL/i)) {
+                    assert_unreached(msg);
+                    t_log.done();
+                }
+                for (var i = 0; i < expected_alerts.length; i++) {
+                    if (expected_alerts[i] == msg) {
+                        assert_true(expected_alerts[i] == msg);
+                        expected_alerts.splice(i, 1);
+                        if (expected_alerts.length == 0) {
+                            t_log.done();
+                        }
+                        return;
+                    }
+                }
+                assert_unreached('unexpected alert: ' + msg);
+                t_log.done();
+            });
+        }
+
+    </script>
+    <!-- enforcing policy:
+frame-src 'none'; child-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self';
+-->
+    <p>
+        A more permissive child-src should not relax restrictions from a less-
+        permissive frame-src.  Directives still combine for least privilege, even when
+        one obsoletes another.
+    </p>
+    <script>
+        window.wasPostTestScriptParsed = true;
+        var loads = 0;
+
+        function loadEvent() {
+            loads++;
+            log("PASS " + "IFrame #" + loads + " generated a load event.");
+        }
+
+    </script>
+</head>
+
+<body>
+    <iframe src="/content-security-policy/blink-contrib/resources/postmessage-fail.html" onload="loadEvent()" onerror="log('FAIL')"></iframe>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=true&amp;reportField=violated-directive&amp;reportValue=frame-src%20&apos;none&apos;"></script>
+</body>
+
+</html>
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-conflicting-frame-src.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-conflicting-frame-src.sub.html.sub.headers
new file mode 100644
index 0000000..9c3ce84
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-conflicting-frame-src.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-conflicting-frame-src={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: frame-src 'none'; child-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-cross-origin-load.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-cross-origin-load.sub.html
new file mode 100644
index 0000000..b6f3e51
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-cross-origin-load.sub.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
+    <title>child-src-cross-origin-load</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src='../support/logTest.sub.js?logs=["PASS IFrame %231 generated a load event.","PASS IFrame %232 generated a load event.","PASS IFrame %233 generated a load event."]'></script>
+    <script>
+        window.addEventListener("message", function(event) {
+            alert_assert(event.data);
+        }, false);
+
+        var t_alert = async_test('Expecting alerts: ["PASS","PASS"]');
+        var expected_alerts = ["PASS", "PASS"];
+
+        function alert_assert(msg) {
+            t_alert.step(function() {
+                if (msg.match(/^FAIL/i)) {
+                    assert_unreached(msg);
+                    t_alert.done();
+                }
+                for (var i = 0; i < expected_alerts.length; i++) {
+                    if (expected_alerts[i] == msg) {
+                        assert_true(expected_alerts[i] == msg);
+                        expected_alerts.splice(i, 1);
+                        if (expected_alerts.length == 0) {
+                            t_alert.done();
+                        }
+                        return;
+                    }
+                }
+                assert_unreached('unexpected alert: ' + msg);
+                t_alert.done();
+            });
+        }
+
+    </script>
+    <!-- enforcing policy:
+child-src 'self' http://www1.{{host}}:{{ports[http][0]}}; script-src 'self' 'unsafe-inline'; connect-src 'self';
+-->
+    <p>
+        IFrames blocked by CSP should generate a 'load', not 'error' event, regardless of blocked state. This means they appear to be normal cross-origin loads, thereby not leaking URL information directly to JS.
+    </p>
+    <script>
+        window.wasPostTestScriptParsed = true;
+        var loads = 0;
+
+        function loadEvent() {
+            loads++;
+            log("PASS " + "IFrame #" + loads + " generated a load event.");
+            if (loads == 3)
+                log("TEST COMPLETE");
+        }
+
+    </script>
+</head>
+
+<body>
+    <iframe src="/content-security-policy/blink-contrib/resources/postmessage-pass.html" onload="loadEvent()"></iframe>
+    <iframe src="http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/blink-contrib/resources/postmessage-pass.html" onload="loadEvent()"></iframe>
+    <iframe src="http://www2.{{host}}:{{ports[http][0]}}/content-security-policy/blink-contrib/resources/postmessage-fail.html" onload="loadEvent()" onerror="log('FAIL')"></iframe>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=true&amp;reportField=violated-directive&amp;reportValue=child-src%20&apos;self&apos;"></script>
+</body>
+
+</html>
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-cross-origin-load.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-cross-origin-load.sub.html.sub.headers
new file mode 100644
index 0000000..53527c1
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-cross-origin-load.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-cross-origin-load={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src 'self' http://www1.{{host}}:{{ports[http][0]}}; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-allowed.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-allowed.sub.html
new file mode 100644
index 0000000..361d097
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-allowed.sub.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <title>child-src-worker-allowed</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src="../support/logTest.sub.js?logs=[]"></script>
+    <script src='../support/alertAssert.sub.js?alerts=["PASS"]'></script>
+    <!-- enforcing policy:
+child-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-inline'; connect-src 'self';
+-->
+
+</head>
+
+<body>
+    <script>
+        try {
+            var foo = new Worker('http://{{host}}:{{ports[http][0]}}/content-security-policy/blink-contrib/resources/post-message.js');
+            foo.onmessage = function(event) {
+                alert_assert("PASS");
+            };
+        } catch (e) {
+            alert_assert(e);
+        }
+
+    </script>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=false"></script>
+</body>
+
+</html>
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-allowed.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-allowed.sub.html.sub.headers
new file mode 100644
index 0000000..4ddb39e
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-allowed.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-worker-allowed={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-blocked.sub.html b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-blocked.sub.html
new file mode 100644
index 0000000..d8908b1
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-blocked.sub.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <title>child-src-worker-blocked</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src="../support/logTest.sub.js?logs=[]"></script>
+    <script src='../support/alertAssert.sub.js?alerts=["PASS"]'></script>
+    <!-- enforcing policy:
+child-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-inline'; connect-src 'self';
+-->
+
+</head>
+
+<body>
+    <script>
+        try {
+            var foo = new Worker('http://{{host}}:{{ports[http][0]}}/content-security-policy/blink-contrib/resources/post-message.js');
+            foo.onmessage = function(event) {
+                alert_assert("FAIL");
+            };
+        } catch (e) {
+            alert_assert("PASS");
+        }
+
+    </script>
+    <div id="log"></div>
+    <script async defer src="../support/checkReport.sub.js?reportExists=true&amp;reportField=violated-directive&amp;reportValue=child-src%20&apos;none&apos;"></script>
+</body>
+</html>
diff --git a/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-blocked.sub.html.sub.headers b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-blocked.sub.html.sub.headers
new file mode 100644
index 0000000..685d6dc
--- /dev/null
+++ b/src/third_party/web_platform_tests/content-security-policy/child-src/child-src-worker-blocked.sub.html.sub.headers
@@ -0,0 +1,6 @@
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+Cache-Control: no-store, no-cache, must-revalidate
+Cache-Control: post-check=0, pre-check=0, false
+Pragma: no-cache
+Set-Cookie: child-src-worker-blocked={{$id:uuid()}}; Path=/content-security-policy/child-src
+Content-Security-Policy: child-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'; report-uri /content-security-policy/support/report.py?op=put&reportID={{$id}}