| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Service Worker: URL Length Limits</title> | 2 <title>Service Worker: URL Length Limits</title> |
| 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 src="../resources/test-helpers.js"></script> | 5 <script src="../resources/test-helpers.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 // URLs longer than this are rejected by Chromium IPC. | 8 // URLs longer than this are rejected by Chromium IPC. |
| 9 var max_url_chars = 2 * 1024 * 1024; | 9 var max_url_chars = 2 * 1024 * 1024; |
| 10 var long_url = location.href + '/' + Array(max_url_chars).join('x'); | 10 var long_url = location.href + '/' + Array(max_url_chars).join('x'); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 async_test(function(t) { | 30 async_test(function(t) { |
| 31 navigator.serviceWorker.unregister(long_url). | 31 navigator.serviceWorker.unregister(long_url). |
| 32 then(t.unreached_func('unregistering a long scope url should fail')). | 32 then(t.unreached_func('unregistering a long scope url should fail')). |
| 33 catch(t.step_func(function(reason) { | 33 catch(t.step_func(function(reason) { |
| 34 assert_equals(reason.name, 'SecurityError'); | 34 assert_equals(reason.name, 'SecurityError'); |
| 35 t.done(); | 35 t.done(); |
| 36 })); | 36 })); |
| 37 }, 'Exceedingly long scope URLs are rejected by unregister()'); | 37 }, 'Exceedingly long scope URLs are rejected by unregister()'); |
| 38 | 38 |
| 39 async_test(function(t) { |
| 40 navigator.serviceWorker.getRegistration(long_url). |
| 41 then(t.unreached_func('getRegistration with a long url should fail')). |
| 42 catch(t.step_func(function(reason) { |
| 43 assert_equals(reason.name, 'SecurityError'); |
| 44 t.done(); |
| 45 })); |
| 46 }, 'Exceedingly long document URLs are rejected by getRegistration()'); |
| 47 |
| 39 </script> | 48 </script> |
| OLD | NEW |