| Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-with-invalid-argument-is-noop.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-with-invalid-argument-is-noop.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-with-invalid-argument-is-noop.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1c9445dc2321c72b7e6de78d841d390c293bf48a
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/open-with-invalid-argument-is-noop.html
|
| @@ -0,0 +1,49 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +async_test(t => {
|
| + const xhr = new XMLHttpRequest();
|
| + xhr.open('GET', 'resources/get.txt');
|
| + xhr.onload = t.step_func(() => {
|
| + assert_equals(xhr.responseText, 'PASS');
|
| + t.done();
|
| + });
|
| +
|
| + assert_throws('SyntaxError', () => {
|
| + xhr.open('FOO BAR', 'nonexistent');
|
| + }, 'open() should throw for a SyntaxError for an invalid method');
|
| +
|
| + xhr.send();
|
| +}, 'open() with an invalid method is no-op');
|
| +
|
| +async_test(t => {
|
| + const xhr = new XMLHttpRequest();
|
| + xhr.open('GET', 'resources/get.txt');
|
| + xhr.onload = t.step_func(() => {
|
| + assert_equals(xhr.responseText, 'PASS');
|
| + t.done();
|
| + });
|
| +
|
| + assert_throws('SecurityError', () => {
|
| + xhr.open('CONNECT', 'nonexistent');
|
| + }, 'open() should throw for a SecurityError for a forbidden method');
|
| +
|
| + xhr.send();
|
| +}, 'open() with a forbidden method is no-op');
|
| +
|
| +async_test(t => {
|
| + const xhr = new XMLHttpRequest();
|
| + xhr.open('GET', 'resources/get.txt');
|
| + xhr.onload = t.step_func(() => {
|
| + assert_equals(xhr.responseText, 'PASS');
|
| + t.done();
|
| + });
|
| +
|
| + assert_throws('SyntaxError', () => {
|
| + xhr.open('GET', 'http://localhost:foobar/');
|
| + }, 'open() should throw for a SyntaxError for an invalid URL');
|
| +
|
| + xhr.send();
|
| +}, 'open() with an invalid URL is no-op');
|
| +</script>
|
|
|