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 reloadTestSuccess = false; | 5 var reloadTestSuccess = false; |
6 </script> | 6 </script> |
7 | 7 |
8 <script> | 8 <script> |
9 test(function () { | 9 test(function () { |
10 assert_true(window.internals !== null); | 10 assert_true(window.internals !== null); |
11 }, "window.internals is required for the test to run"); | 11 }, "window.internals is required for the test to run"); |
12 | 12 |
13 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConn
ections(true); | 13 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConn
ections(true); |
14 internals.setNetworkStateNotifierTestOnly(true); | 14 internals.setNetworkConnectionInfoOverride(true, 'cellular2g', 1.0); |
15 internals.setNetworkConnectionInfo('cellular2g', 1.0); | |
16 internals.evictAllResources(); | 15 internals.evictAllResources(); |
17 | 16 |
18 window.addEventListener('beforeunload', function() { | 17 window.addEventListener('beforeunload', function() { |
19 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlow
Connections(false); | 18 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlow
Connections(false); |
20 internals.setNetworkStateNotifierTestOnly(false); | 19 internals.clearNetworkConnectionInfoOverride(); |
21 // Remove localStorage items, just in case they haven't been | 20 // Remove localStorage items, just in case they haven't been |
22 // already removed, due to test failure. | 21 // already removed, due to test failure. |
23 if (window.localStorage.getItem("errorCount") !== null) { | 22 if (window.localStorage.getItem("errorCount") !== null) { |
24 window.localStorage.removeItem("errorCount"); | 23 window.localStorage.removeItem("errorCount"); |
25 } | 24 } |
26 | 25 |
27 if (window.localStorage.getItem("successCount") !== null) { | 26 if (window.localStorage.getItem("successCount") !== null) { |
28 window.localStorage.removeItem("successCount"); | 27 window.localStorage.removeItem("successCount"); |
29 } | 28 } |
30 }, false); | 29 }, false); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 internals.forceReload(false); | 72 internals.forceReload(false); |
74 } | 73 } |
75 | 74 |
76 </script> | 75 </script> |
77 | 76 |
78 <script> | 77 <script> |
79 test(function () { | 78 test(function () { |
80 assert_true(reloadTestSuccess); | 79 assert_true(reloadTestSuccess); |
81 }, "cross origin doc.written scripts are not blocked in a page reload"); | 80 }, "cross origin doc.written scripts are not blocked in a page reload"); |
82 </script> | 81 </script> |
OLD | NEW |