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

Unified Diff: third_party/WebKit/LayoutTests/fast/domurl/url-constructor.html

Issue 1860623002: Add support for URL.searchParams getter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/domurl/url-search.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/domurl/url-constructor.html
diff --git a/third_party/WebKit/LayoutTests/fast/domurl/url-constructor.html b/third_party/WebKit/LayoutTests/fast/domurl/url-constructor.html
index c379f3821985a1eb24e81b32fffbacece17ef815..0128c0c561a14ee99ec47b0e3d5f4731667683cb 100644
--- a/third_party/WebKit/LayoutTests/fast/domurl/url-constructor.html
+++ b/third_party/WebKit/LayoutTests/fast/domurl/url-constructor.html
@@ -3,15 +3,15 @@
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
-
-function assertThrows(func, expected) {
+function assert_type_error(func, expected) {
try {
func();
} catch (ex) {
+ assert_true(ex instanceof TypeError);
assert_equals(String(ex), expected);
return;
}
- assert_true(false, 'Expected an exception with string: ' + expected);
+ assert_true(false, 'Expected a TypeError exception with string: ' + expected);
}
test(function() {
@@ -28,27 +28,29 @@ test(function() {
}, 'Valid URLs');
test(function() {
- assertThrows(function() {
- new URL();
- }, 'TypeError: Failed to construct \'URL\': 1 argument required, but only 0 present.');
- assertThrows(function() {
- new URL('');
- }, 'TypeError: Failed to construct \'URL\': Invalid URL');
- assertThrows(function() {
- new URL('','about:blank');
- }, 'TypeError: Failed to construct \'URL\': Invalid URL');
- assertThrows(function() {
- new URL('abc');
- }, 'TypeError: Failed to construct \'URL\': Invalid URL');
- assertThrows(function() {
- new URL('//abc');
- }, 'TypeError: Failed to construct \'URL\': Invalid URL');
- assertThrows(function() {
- new URL('http:///www.domain.com/', 'abc');
- }, 'TypeError: Failed to construct \'URL\': Invalid base URL');
- assertThrows(function() {
- new URL('http:///www.domain.com/', null);
- }, 'TypeError: Failed to construct \'URL\': Invalid base URL');
+ assert_type_error(
+ function() { new URL(); },
+ 'TypeError: Failed to construct \'URL\': 1 argument required, but only 0 present.');
+ assert_type_error(
+ function() { new URL(''); },
+ 'TypeError: Failed to construct \'URL\': Invalid URL');
+ assert_type_error(
+ function() { new URL('','about:blank'); },
+ 'TypeError: Failed to construct \'URL\': Invalid URL');
+ assert_type_error(
+ function() { new URL('abc'); },
+ 'TypeError: Failed to construct \'URL\': Invalid URL');
+ assert_type_error(
+ function() { new URL('//abc'); },
+ 'TypeError: Failed to construct \'URL\': Invalid URL');
+ assert_type_error(
+ function() { new URL('http:///www.domain.com/', 'abc'); },
+ 'TypeError: Failed to construct \'URL\': Invalid base URL');
+ assert_type_error(
+ function() { new URL('http:///www.domain.com/', null); },
+ 'TypeError: Failed to construct \'URL\': Invalid base URL');
+ assert_type_error(
+ function() { new URL('//abc', null); },
+ 'TypeError: Failed to construct \'URL\': Invalid base URL');
}, 'Invalid URL parameters');
-
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/domurl/url-search.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698