| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 function initialize_SegmentsMerge() { | 5 function initialize_SegmentsMerge() { |
| 6 | 6 |
| 7 InspectorTest.preloadModule("coverage"); | 7 InspectorTest.preloadModule("coverage"); |
| 8 | 8 |
| 9 } | 9 } |
| 10 | 10 |
| 11 function test() | 11 function test() |
| 12 { | 12 { |
| 13 testAndDump([], []); | 13 testAndDump([], []); |
| 14 testAndDump([{end: 10, count: 1, depth: 1}], []); | 14 testAndDump([{end: 10, count: 1}], []); |
| 15 testAndDump([{end: 10, count: 1, depth: 1}], [{end: 10, count: 1, depth: 1}]
); | 15 testAndDump([{end: 10, count: 1}], [{end: 10, count: 1}]); |
| 16 testAndDump([{end: 10, count: 1, depth: 1}], [{end: 20, count: 1, depth: 1}]
); | 16 testAndDump([{end: 10, count: 1}], [{end: 20, count: 1}]); |
| 17 testAndDump([{end: 10, count: 1, depth: 1}, {end: 20, count: 1, depth: 1}],
[]); | 17 testAndDump([{end: 10, count: 1}, {end: 20, count: 1}], []); |
| 18 testAndDump([{end: 30, count: 1, depth: 1}], [{end: 10, count: undefined, de
pth: 0}, {end: 20, count: 2, depth: 1}]); | 18 testAndDump([{end: 30, count: 1}], [{end: 10, count: undefined}, {end: 20, c
ount: 2}]); |
| 19 testAndDump([{end: 30, count: undefined, depth: 0}], [{end: 10, count: undef
ined, depth: 0}, {end: 20, count: 2, depth: 1}]); | 19 testAndDump([{end: 30, count: undefined}], [{end: 10, count: undefined}, {en
d: 20, count: 2}]); |
| 20 | 20 |
| 21 InspectorTest.completeTest(); | 21 InspectorTest.completeTest(); |
| 22 | 22 |
| 23 function testAndDump(a, b) | 23 function testAndDump(a, b) |
| 24 { | 24 { |
| 25 dumpSegments("A: ", a); | 25 dumpSegments("A: ", a); |
| 26 dumpSegments("B: ", b); | 26 dumpSegments("B: ", b); |
| 27 | 27 |
| 28 var mergedAB = Coverage.CoverageInfo._mergeCoverage(a, b); | 28 var mergedAB = Coverage.CoverageInfo._mergeCoverage(a, b); |
| 29 dumpSegments("merged: ", mergedAB); | 29 dumpSegments("merged: ", mergedAB); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 function rangesEqual(a, b) | 40 function rangesEqual(a, b) |
| 41 { | 41 { |
| 42 if (a.length !== b.length) | 42 if (a.length !== b.length) |
| 43 return false; | 43 return false; |
| 44 | 44 |
| 45 for (var i = 0; i < a.length; i++) { | 45 for (var i = 0; i < a.length; i++) { |
| 46 if (a[i].end !== b[i].end) | 46 if (a[i].end !== b[i].end) |
| 47 return false; | 47 return false; |
| 48 if (a[i].count !== b[i].count) | 48 if (a[i].count !== b[i].count) |
| 49 return false; | 49 return false; |
| 50 if (a[i].depth !== b[i].depth) | |
| 51 return false; | |
| 52 } | 50 } |
| 53 return true; | 51 return true; |
| 54 } | 52 } |
| 55 } | 53 } |
| 56 | 54 |
| 57 </script> | 55 </script> |
| 58 </head> | 56 </head> |
| 59 | 57 |
| 60 <body onload="runTest()"> | 58 <body onload="runTest()"> |
| 61 <p>Tests the merge of disjoint segment lists in CoverageModel.</p> | 59 <p>Tests the merge of disjoint segment lists in CoverageModel.</p> |
| 62 | 60 |
| 63 </body> | 61 </body> |
| 64 </html> | 62 </html> |
| OLD | NEW |