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

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

Issue 1905553002: Expose toString() as enumerable on some objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sof-tidy-idl-pars
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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/js/toString-dontEnum.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url"> 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url">
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 function assert_type_error(func, expected) { 6 function assert_type_error(func, expected) {
7 try { 7 try {
8 func(); 8 func();
9 } catch (ex) { 9 } catch (ex) {
10 assert_true(ex instanceof TypeError); 10 assert_true(ex instanceof TypeError);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 assert_type_error( 46 assert_type_error(
47 function() { new URL('http:///www.domain.com/', 'abc'); }, 47 function() { new URL('http:///www.domain.com/', 'abc'); },
48 'TypeError: Failed to construct \'URL\': Invalid base URL'); 48 'TypeError: Failed to construct \'URL\': Invalid base URL');
49 assert_type_error( 49 assert_type_error(
50 function() { new URL('http:///www.domain.com/', null); }, 50 function() { new URL('http:///www.domain.com/', null); },
51 'TypeError: Failed to construct \'URL\': Invalid base URL'); 51 'TypeError: Failed to construct \'URL\': Invalid base URL');
52 assert_type_error( 52 assert_type_error(
53 function() { new URL('//abc', null); }, 53 function() { new URL('//abc', null); },
54 'TypeError: Failed to construct \'URL\': Invalid base URL'); 54 'TypeError: Failed to construct \'URL\': Invalid base URL');
55 }, 'Invalid URL parameters'); 55 }, 'Invalid URL parameters');
56
57 test(function() {
58 function assert_enumerable(p) {
59 assert_true(p in URL.prototype);
60 assert_true(URL.prototype.propertyIsEnumerable(p));
61 }
62
63 assert_true('URL' in self);
64
65 // TODO: uncomment when implemented.
66 // assert_true('domainToASCII' in URL);
67 // assert_true('domainToUnicode' in URL);
68
69 // Arguably better failure stacks to spell them out this way..
70 assert_enumerable('toString');
71 assert_enumerable('origin');
72 assert_enumerable('protocol');
73 assert_enumerable('username');
74 assert_enumerable('password');
75 assert_enumerable('host');
76 assert_enumerable('hostname');
77 assert_enumerable('port');
78 assert_enumerable('pathname');
79 assert_enumerable('search');
80 assert_enumerable('searchParams');
81 assert_enumerable('hash');
82 }, 'URL interface');
56 </script> 83 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/js/toString-dontEnum.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698