Handle service worker loads through NetworkResourceLoader
[WebKit-https.git] / LayoutTests / fast / events / resize-events.html
1 <html>
2 <head>
3     <style>
4         div.block { height: 400px; border: 1px solid black; margin:10px; }
5     </style>
6     <script>
7         var resizecount = 0;
8         var loaded = false;
9         window.onresize = function() {
10             resizecount++;
11             document.getElementById('count1').innerHTML = resizecount;
12         }
13     </script>
14 </head>
15 <body>
16     <div>
17         Test how many resize events are emitted during page load and dynamic content generation.
18
19         Do not resize the page. It invalidates the test.
20         <p style="text-indent: 10px" id=result1>
21         Resize events (should be 0): <span id=count1>0</span>
22     </div>
23     <div id=expandingblock>
24     </div>
25     <script>
26         if (window.testRunner) {
27             testRunner.waitUntilDone();
28         }
29
30         var blockcount = 0;
31         function addBlock() {
32             var el = document.createElement('div');
33             el.setAttribute('class','block');
34             document.getElementById('expandingblock').appendChild(el);
35             if (++blockcount < 10)
36                 setTimeout(addBlock, 20);
37             else
38                 finish();
39         }
40         function finish() {
41             var result;
42             // No resize events are acceptable.
43             if (resizecount < 1)
44                 result = '<p style="color: green">PASS';
45             else
46                 result = '<p style="color: red">FAIL';
47             var resultElement = document.getElementById('result1')
48             resultElement.innerHTML += result;
49             if (window.testRunner)
50                 testRunner.notifyDone();
51         }
52         onload = addBlock;
53     </script>
54 </body>