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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload.html

Issue 2087293003: [DevTools] Network.emulateNetworkConditions now affects NetworkStateNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck Created 4 years, 5 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
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698