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

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

Issue 1849223002: Blocking synchronous and third party doc.written scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added layout tests and review comments incorporation Created 4 years, 8 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
(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');
6 var src = 'http://localhost:8000/loading/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>');
14 </script>
15 <script>
16 window.addEventListener("load", t.step_func(function() {
17 assert_false(jsLoaded, "third party and sync doc.written scripts are blo cked");
Bryan McQuade 2016/04/05 12:46:11 For this and other tests, let's also assert that t
shivanisha 2016/04/05 20:37:14 It seems asserts provided by testharness.js only w
18 t.done();
19 }));
20 window.addEventListener('beforeunload', function() {
21 internals.setNetworkStateNotifierTestOnly(false);
22 internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrame(false );
23 }, false);
24
25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698