| <!DOCTYPE html> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="support/helper.sub.js"></script> |
| <body> |
| <script> |
| test(t => { |
| var url = TrustedURL.create(location.href + "#xxx"); |
| location.assign(url); |
| assert_equals("" + url, location.href, "location href"); |
| }, "Basic processing: safe URL, safe construction."); |
| |
| test(t => { |
| var url = TrustedURL.unsafelyCreate(location.href + "#xxx"); |
| location.assign(url); |
| assert_equals("" + url, location.href, "location href"); |
| }, "Basic processing: safe URL, unsafe construction."); |
| </script> |