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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 test(() => {
6 const xhr = new XMLHttpRequest();
7 assert_throws('SyntaxError', () => {
8 xhr.open('GET', '//[');
9 });
10 }, '//[');
11
12 test(() => {
13 const xhr = new XMLHttpRequest();
14 assert_throws('SyntaxError', () => {
15 xhr.open('GET', 'ftp:');
16 });
17 }, 'Just ftp scheme');
18
19 test(() => {
20 const xhr = new XMLHttpRequest();
21 assert_throws('SyntaxError', () => {
22 xhr.open('GET', 'http:////////////');
23 });
24 }, 'Lots of slashes');
25
26 test(() => {
27 const xhr = new XMLHttpRequest();
28 assert_throws('SyntaxError', () => {
29 xhr.open('GET', 'http://u:p@/');
30 });
31 }, 'Credentials only authority');
32
33 test(() => {
34 const xhr = new XMLHttpRequest();
35 assert_throws('SyntaxError', () => {
36 xhr.open('GET', 'http://localhost:1291x/');
37 });
38 }, 'Non digit in port');
39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698