Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 var t = async_test('Makes sure synchronous third-party scripts in document.w rite are blocked'); | |
|
Bryan McQuade
2016/04/05 12:46:11
Since these scripts are loaded synchronously you m
shivanisha
2016/04/05 20:37:14
Sounds good. changing to sync.
| |
| 6 var src = './resources/js-loaded.js'; | |
| 7 var jsLoaded = false; | |
| 8 if (window.internals){ | |
| 9 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(true) ; | |
| 10 internals.setNetworkStateNotifierTestOnly(true); | |
| 11 internals.setNetworkConnectionInfo('cellular2g', 2.0); | |
| 12 } | |
| 13 document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>'); | |
|
Bryan McQuade
2016/04/05 12:46:11
though it makes the test a bit longer, i tend to l
shivanisha
2016/04/05 20:37:14
sounds good. Added 4 tests in 1 html file:
cross
| |
| 14 </script> | |
| 15 <script> | |
| 16 window.addEventListener("load", t.step_func(function() { | |
| 17 assert_true(jsLoaded, "Same domain doc.written scripts are not blocked") ; | |
| 18 t.done(); | |
| 19 })); | |
| 20 window.addEventListener('beforeunload', function() { | |
| 21 internals.setNetworkStateNotifierTestOnly(false); | |
| 22 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(false ); | |
| 23 }, false); | |
| 24 </script> | |
| OLD | NEW |