Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <p> Load a bunch of frames containing videos. | |
| 2 <script> | |
| 3 var url = new URL(location); | |
| 4 var urls = url.searchParams.get('urls').split(','); | |
| 5 var numFrames = urls.length; | |
| 6 var numSubresources = parseInt(url.searchParams.get('numSubresources'), 10); | |
| 7 function createFrames() { | |
| 8 for (var i = 0; i < numFrames; i++) { | |
| 9 var frame = document.createElement('iframe'); | |
| 10 frame.src = | |
| 11 "/cross-site/example.com/site_isolation/subframe_resources.html?url=" + | |
| 12 urls[i] + "&numSubresources=" + numSubresources; | |
| 13 document.body.appendChild(frame); | |
| 14 } | |
| 15 } | |
| 16 | |
| 17 // Wait for |numFrame| messages. Each message is received when a given frame | |
| 18 // finishes (errors/completes) all of its subresources. | |
| 19 var numMessages = 0; | |
| 20 window.addEventListener('message', function(e) { | |
| 21 numMessages++; | |
| 22 if (numMessages == numFrames) | |
| 23 window.domAutomationController.send(true); | |
|
mmenke
2017/01/30 23:03:51
Can this happen before ExecuteScriptAndExtractBool
Charlie Harrison
2017/01/31 20:19:32
It cannot hapen before ExecuteScriptAndExtractBool
| |
| 24 }); | |
| 25 </script> | |
| OLD | NEW |