Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/html/browsers/history/the-location-interface/location-protocol-setter.html

Issue 2614953003: Import wpt@eeecf3e14368d4ab5221cde688003dedeca30dba (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/html/browsers/history/the-location-interface/location-protocol-setter.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/history/the-location-interface/location-protocol-setter.html b/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/history/the-location-interface/location-protocol-setter.html
new file mode 100644
index 0000000000000000000000000000000000000000..ef92f7ab0f889b88b48ea9ddba54e4fbeb254943
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/history/the-location-interface/location-protocol-setter.html
@@ -0,0 +1,106 @@
+<!doctype html>
+<title>Set location.protocol to broken schemes</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<iframe src="data:text/html,<script>
+onmessage = (e) => {
+ let results = [];
+ e.data.forEach((val) => {
+ try {
+ location.protocol = val;
+ results.push('failure')
+ } catch(e) {
+ results.push(e.name)
+ }
+ });
+ parent.postMessage(results, '*')
+}
+</script>"></iframe>
+<iframe srcdoc="<script>
+onmessage = (e) => {
+ let results = [];
+ e.data.forEach((val) => {
+ try {
+ location.protocol = val;
+ results.push('failure')
+ } catch(e) {
+ results.push(e.name)
+ }
+ });
+ parent.postMessage(results, '*')
+}
+</script>"></iframe>
+<script>
+ let broken = [
+ '\x00',
+ '\x01',
+ '\x0A',
+ '\x20',
+ '\x21',
+ '\x7F',
+ '\x80',
+ '\xFF',
+ ':',
+ '†',
+ '\x00x',
+ '\x01x',
+ '\x0Ax',
+ '\x20x',
+ '\x21x',
+ '\x7Fx',
+ '\x80x',
+ '\xFFx',
+ ':x',
+ '†x',
+ '\x00X',
+ '\x01X',
+ '\x0AX',
+ '\x20X',
+ '\x21X',
+ '\x7FX',
+ '\x80X',
+ '\xFFX',
+ ':X',
+ '†X',
+ 'x\x00',
+ 'x\x01',
+ 'x\x0A',
+ 'x\x20',
+ 'x\x21',
+ 'x\x7F',
+ 'x\x80',
+ 'x\xFF',
+ 'x†',
+ 'X\x00',
+ 'X\x01',
+ 'X\x0A',
+ 'X\x20',
+ 'X\x21',
+ 'X\x7F',
+ 'X\x80',
+ 'X\xFF',
+ 'X†',
+ 'a\x0A',
+ 'a+-.\x0A'
+ ]
+ ;broken.forEach((val) => {
+ test(() => {
+ assert_throws("SyntaxError", () => { location.protocol = val })
+ }, encodeURI(val) + " (percent-encoded) is not a scheme")
+ })
+ let c = 0
+ async_test((t) => {
+ self.onload = t.step_func(() => {
+ self.onmessage = t.step_func((e) => {
+ assert_array_equals(e.data, ("SyntaxError ".repeat(49) + "SyntaxError").split(" "))
+ c++
+ if(c === 2) {
+ t.done()
+ }
+ })
+ self[0].postMessage(broken, "*")
+ self[1].postMessage(broken, "*")
+ })
+ }, "Equivalent tests for data URL and srcdoc <iframe>s")
+</script>

Powered by Google App Engine
This is Rietveld 408576698