| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta charset="utf-8" /> | 4 <meta charset="utf-8" /> |
| 5 <title>shrink resource timing buffer size</title> | 5 <title>This test validates the behavior of shrink resource timing buffer
size.</title> |
| 6 <link rel="author" title="Intel" href="http://www.intel.com/" /> | 6 <link rel="author" title="Intel" href="http://www.intel.com/" /> |
| 7 <link rel="help" href="http://www.w3.org/TR/resource-timing/#performance
resourcetiming"/> | 7 <link rel="help" href="http://www.w3.org/TR/resource-timing/#performance
resourcetiming"/> |
| 8 <script src="/w3c/resources/testharness.js"></script> | 8 <script src="/w3c/resources/testharness.js"></script> |
| 9 <script src="/w3c/resources/testharnessreport.js"></script> | 9 <script src="/w3c/resources/testharnessreport.js"></script> |
| 10 <script src="/w3c/webperf/resources/webperftestharness.js"></script> | 10 <script src="/w3c/webperf/resources/webperftestharness.js"></script> |
| 11 <script src="/w3c/webperf/resources/webperftestharnessextension.js"></sc
ript> | 11 <script src="/w3c/webperf/resources/webperftestharnessextension.js"></sc
ript> |
| 12 <script> | 12 <script> |
| 13 setup({ explicit_done: true }); | 13 setup({ explicit_done: true }); |
| 14 var context = new PerformanceContext(performance); | 14 var context = new PerformanceContext(performance); |
| 15 function onload_test() | 15 function onload_test() |
| 16 { | 16 { |
| 17 var entry_list_before_shrink = context.getEntriesByType('resourc
e'); | 17 var entry_list_before_shrink = context.getEntriesByType('resourc
e'); |
| 18 context.setResourceTimingBufferSize(0); | 18 context.setResourceTimingBufferSize(0); |
| 19 var entry_list_after_shrink = context.getEntriesByType('resource
'); | 19 var entry_list_after_shrink = context.getEntriesByType('resource
'); |
| 20 | 20 |
| 21 test_greater_than(entry_list_before_shrink.length, 0, "There sho
uld be entries in resource timing buffer!"); | 21 test_greater_than(entry_list_before_shrink.length, 0, "There sho
uld be entries in resource timing buffer!"); |
| 22 test_equals(JSON.stringify(entry_list_before_shrink), JSON.strin
gify(entry_list_after_shrink), "Resource timing buffer should never been changed
even buffer size is shrunk!"); | 22 test_equals(JSON.stringify(entry_list_before_shrink), JSON.strin
gify(entry_list_after_shrink), "Resource timing buffer should never been changed
even buffer size is shrunk!"); |
| 23 | 23 |
| 24 context.clearResourceTimings(); | 24 context.clearResourceTimings(); |
| 25 test_equals(context.getEntriesByType('resource').length, 0, "The
re should be no entries in resource timing buffer after clearResourceTimings"); | 25 test_equals(context.getEntriesByType('resource').length, 0, "The
re should be no entries in resource timing buffer after clearResourceTimings"); |
| 26 done(); | 26 done(); |
| 27 } | 27 } |
| 28 </script> | 28 </script> |
| 29 </head> | 29 </head> |
| 30 <body onload=onload_test()> | 30 <body onload=onload_test()> |
| 31 <h1>Description</h1> | |
| 32 <p>This test validates the behavior of shrink resource timing buffer siz
e.</p> | |
| 33 </body> | 31 </body> |
| 34 </html> | 32 </html> |
| OLD | NEW |