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

Unified Diff: third_party/WebKit/LayoutTests/fast/xmlhttprequest/invalid-url.html

Issue 2297483002: Make XMLHttpRequest.open() throw for invalid URLs (Closed)
Patch Set: Addressed #12 Created 4 years, 3 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/fast/xmlhttprequest/invalid-url.html
diff --git a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/invalid-url.html b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/invalid-url.html
new file mode 100644
index 0000000000000000000000000000000000000000..4ef3885ec7e3007b581514d42c95902360236009
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/invalid-url.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ const xhr = new XMLHttpRequest();
+ assert_throws('SyntaxError', () => {
+ xhr.open('GET', '//[');
+ });
+}, '//[');
+
+test(() => {
+ const xhr = new XMLHttpRequest();
+ assert_throws('SyntaxError', () => {
+ xhr.open('GET', 'ftp:');
+ });
+}, 'Just ftp scheme');
+
+test(() => {
+ const xhr = new XMLHttpRequest();
+ assert_throws('SyntaxError', () => {
+ xhr.open('GET', 'http:////////////');
+ });
+}, 'Lots of slashes');
+
+test(() => {
+ const xhr = new XMLHttpRequest();
+ assert_throws('SyntaxError', () => {
+ xhr.open('GET', 'http://u:p@/');
+ });
+}, 'Credentials only authority');
+
+test(() => {
+ const xhr = new XMLHttpRequest();
+ assert_throws('SyntaxError', () => {
+ xhr.open('GET', 'http://localhost:1291x/');
+ });
+}, 'Non digit in port');
+</script>

Powered by Google App Engine
This is Rietveld 408576698