| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script> | 4 <script> |
| 5 var src = 'http://localhost:8000/loading/resources/js-loaded.js'; | 5 var src = 'http://localhost:8000/loading/resources/js-loaded.js?conn-type'; |
| 6 var jsLoaded = false; | 6 var jsLoaded = false; |
| 7 var loadSuccess = false; | 7 var loadSuccess = false; |
| 8 if (window.internals) { | 8 if (window.internals) { |
| 9 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlow
Connections(true); | 9 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlow
Connections(true); |
| 10 internals.setNetworkStateNotifierTestOnly(true); | 10 internals.setNetworkStateNotifierTestOnly(true); |
| 11 internals.setNetworkConnectionInfo('cellular3g', 2.0); | 11 internals.setNetworkConnectionInfo('cellular3g', 2.0); |
| 12 internals.evictAllResources(); | 12 internals.evictAllResources(); |
| 13 | 13 |
| 14 window.addEventListener('beforeunload', function() { | 14 window.addEventListener('beforeunload', function() { |
| 15 internals.setNetworkStateNotifierTestOnly(false); | 15 internals.setNetworkStateNotifierTestOnly(false); |
| 16 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOn
SlowConnections(false); | 16 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOn
SlowConnections(false); |
| 17 }, false); | 17 }, false); |
| 18 } | 18 } |
| 19 document.write('<scr' + 'ipt src="' + src + '" onload="loadSuccess=true"></s
cr' + 'ipt>'); | 19 document.write('<scr' + 'ipt src="' + src + '" onload="loadSuccess=true"></s
cr' + 'ipt>'); |
| 20 </script> | 20 </script> |
| 21 <script> | 21 <script> |
| 22 test(function () { | 22 test(function () { |
| 23 assert_true(jsLoaded); | 23 assert_true(jsLoaded); |
| 24 assert_true(loadSuccess); | 24 assert_true(loadSuccess); |
| 25 }, "Document.written scripts are not blocked in a fast connection"); | 25 }, "Document.written scripts are not blocked in a fast connection"); |
| 26 </script> | 26 </script> |
| OLD | NEW |