Index: LayoutTests/http/tests/security/xssAuditor/viewsource-script-tag.html |
diff --git a/LayoutTests/http/tests/security/xssAuditor/viewsource-script-tag.html b/LayoutTests/http/tests/security/xssAuditor/viewsource-script-tag.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..df81ce165f18257dc2aef0b232d69c8a9b1f4608 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/xssAuditor/viewsource-script-tag.html |
@@ -0,0 +1,18 @@ |
+<!DOCTYPE html> |
+<html> |
+<iframe id="x" name="x"></iframe> |
+<script> |
+var frame = document.getElementById('x'); |
+if (window.testRunner) { |
+ testRunner.waitUntilDone(); |
+ testRunner.setXSSAuditorEnabled(true); |
+ testRunner.dumpAsMarkup(); |
+ testRunner.dumpChildFramesAsMarkup(); |
+ testRunner.setViewSourceForFrame('x', true); |
+ frame.onload = testRunner.notifyDone.bind(testRunner); |
+} |
+frame.src = '/security/xssAuditor/resources/echo-intertag.pl?q=%3cscript%3ealert(/xss/)%3c/script%3e'; |
+</script> |
+<p>This test passes if the iframe is rendered in view-source mode such that script doesn't execute and |
+instead the "alert(/xss/)" is in a highlighted span.</p> |
+</html> |