Diff
Modified: branches/safari-603-branch/LayoutTests/ChangeLog (210704 => 210705)
--- branches/safari-603-branch/LayoutTests/ChangeLog 2017-01-13 06:10:15 UTC (rev 210704)
+++ branches/safari-603-branch/LayoutTests/ChangeLog 2017-01-13 06:10:17 UTC (rev 210705)
@@ -1,5 +1,26 @@
2017-01-12 Matthew Hanson <matthew_han...@apple.com>
+ Merge r210611. rdar://problem/29471892
+
+ 2017-01-11 Joseph Pecoraro <pecor...@apple.com>
+
+ REGRESSION: LayoutTest inspector/debugger/csp-exceptions.html is a flaky failure
+ https://bugs.webkit.org/show_bug.cgi?id=165292
+ <rdar://problem/29471892>
+
+ Reviewed by Geoffrey Garen.
+
+ * inspector/debugger/csp-exceptions-expected.txt:
+ * inspector/debugger/csp-exceptions.html:
+ * inspector/debugger/resources/csp-exception-iframe.html:
+ Improve the test to handle all console messages more carefully,
+ including outputing the console messages to test them as well.
+
+ * platform/mac-wk2/TestExpectations:
+ Unskip the test, it should no longer be flakey.
+
+2017-01-12 Matthew Hanson <matthew_han...@apple.com>
+
Merge r210610. rdar://problem/15307582
2017-01-11 Brent Fulgham <bfulg...@apple.com>
Modified: branches/safari-603-branch/LayoutTests/inspector/debugger/csp-exceptions-expected.txt (210704 => 210705)
--- branches/safari-603-branch/LayoutTests/inspector/debugger/csp-exceptions-expected.txt 2017-01-13 06:10:15 UTC (rev 210704)
+++ branches/safari-603-branch/LayoutTests/inspector/debugger/csp-exceptions-expected.txt 2017-01-13 06:10:17 UTC (rev 210705)
@@ -9,7 +9,10 @@
PASS: CSP Exception caused by script evaluation should pause.
Uncaught exception in test page: EvalError: Refused to evaluate a string as _javascript_ because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
[csp-exceptions.html:11]
+PASS: CSP Exception Console Message: EvalError: Refused to evaluate a string as _javascript_ because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".
+
-- Running test case: TriggerCSPExceptionOutsideOfScript
PASS: CSP Exception caused outside of script evaluation should not pause.
+PASS: CSP Exception Console Message: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.
Modified: branches/safari-603-branch/LayoutTests/inspector/debugger/csp-exceptions.html (210704 => 210705)
--- branches/safari-603-branch/LayoutTests/inspector/debugger/csp-exceptions.html 2017-01-13 06:10:15 UTC (rev 210704)
+++ branches/safari-603-branch/LayoutTests/inspector/debugger/csp-exceptions.html 2017-01-13 06:10:17 UTC (rev 210705)
@@ -8,7 +8,7 @@
TestPage.needToSanitizeUncaughtExceptionURLs = true;
function triggerCSPExceptionInsideScript() {
- eval("console.log('CSP should prevent this')");
+ eval("console.log('Inside Script - CSP should prevent this')");
}
function triggerCSPExceptionOutsideScript() {
@@ -28,8 +28,14 @@
InspectorTest.evaluateInPage("setTimeout(triggerCSPExceptionInsideScript)");
WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
InspectorTest.pass("CSP Exception caused by script evaluation should pause.");
- WebInspector.debuggerManager.resume().then(resolve, reject);
+ WebInspector.debuggerManager.resume();
});
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.assert(event.data.message.level === WebInspector.ConsoleMessage.MessageLevel.Error);
+ InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText);
+ resolve();
+ });
}
});
@@ -38,14 +44,18 @@
description: "Trigger a CSP Exception outside of script should not pause or crash.",
test(resolve, reject) {
InspectorTest.evaluateInPage("setTimeout(triggerCSPExceptionOutsideScript)");
+ let didPause = false;
let tempPauseFailListener = WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
+ didPause = true;
InspectorTest.fail("CSP Exception caused outside of script evaluation should not pause, but did.");
WebInspector.debuggerManager.resume();
reject();
});
- WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.Paused, tempPauseFailListener, null);
- InspectorTest.pass("CSP Exception caused outside of script evaluation should not pause.");
+ InspectorTest.assert(event.data.message.level === WebInspector.ConsoleMessage.MessageLevel.Error);
+ InspectorTest.expectFalse(didPause, "CSP Exception caused outside of script evaluation should not pause.");
+ InspectorTest.pass("CSP Exception Console Message: " + event.data.message.messageText);
resolve();
});
}
@@ -52,6 +62,7 @@
});
DebuggerAgent.setPauseOnExceptions("all");
+
suite.runTestCasesAndFinish();
}
</script>
Modified: branches/safari-603-branch/LayoutTests/inspector/debugger/resources/csp-exception-iframe.html (210704 => 210705)
--- branches/safari-603-branch/LayoutTests/inspector/debugger/resources/csp-exception-iframe.html 2017-01-13 06:10:15 UTC (rev 210704)
+++ branches/safari-603-branch/LayoutTests/inspector/debugger/resources/csp-exception-iframe.html 2017-01-13 06:10:17 UTC (rev 210705)
@@ -4,6 +4,6 @@
<meta http-equiv="Content-Security-Policy" content="script-src 'none'">
</head>
<body>
-<script>console.log("CSP should prevent this");</script>
+<script>console.log("Inside Frame - CSP should prevent this");</script>
</body>
</html>
Modified: branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations (210704 => 210705)
--- branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations 2017-01-13 06:10:15 UTC (rev 210704)
+++ branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations 2017-01-13 06:10:17 UTC (rev 210705)
@@ -546,7 +546,6 @@
webkit.org/b/163604 inspector/debugger/breakpoint-action-eval.html [ Pass Timeout ]
webkit.org/b/161774 inspector/debugger/breakpoint-columns.html [ Pass Failure ]
-webkit.org/b/165292 inspector/debugger/csp-exceptions.html [ Pass Failure ]
webkit.org/b/159447 [ Debug ] inspector/debugger/tail-deleted-frames-from-vm-entry.html [ Pass Failure ]
webkit.org/b/165582 inspector/worker/debugger-scripts.html [ Pass Failure ]