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 | 5 |
6 function test() | 6 function test() |
7 { | 7 { |
8 InspectorTest.runTestSuite([ | 8 InspectorTest.runTestSuite([ |
| 9 function remove(next) |
| 10 { |
| 11 var testArrays = [ |
| 12 [], [], [], |
| 13 [1], [1], [1], |
| 14 [1, 2, 3, 4, 5, 4, 3, 2, 1], [1, 3, 4, 5, 4, 3, 2, 1], [1, 3, 4,
5, 4, 3, 1], |
| 15 [2, 2, 2, 2, 2], [2, 2, 2, 2], [], |
| 16 [2, 2, 2, 1, 2, 2, 3, 2], [2, 2, 1, 2, 2, 3, 2], [1, 3] |
| 17 ]; |
| 18 for (var i = 0; i < testArrays.length; i += 3) { |
| 19 var actual = testArrays[i].slice(0); |
| 20 var expected = testArrays[i + 1]; |
| 21 actual.remove(2, true); |
| 22 InspectorTest.assertEquals(JSON.stringify(expected), JSON.string
ify(actual), "remove(2, true) passed"); |
| 23 actual = testArrays[i].slice(0); |
| 24 expected = testArrays[i + 2]; |
| 25 actual.remove(2, false); |
| 26 InspectorTest.assertEquals(JSON.stringify(expected), JSON.string
ify(actual), "remove(2, false) passed"); |
| 27 } |
| 28 next(); |
| 29 }, |
| 30 |
9 function orderedMergeIntersect(next) | 31 function orderedMergeIntersect(next) |
10 { | 32 { |
11 function comparator(a, b) | 33 function comparator(a, b) |
12 { | 34 { |
13 return a - b; | 35 return a - b; |
14 } | 36 } |
15 function count(a, x) | 37 function count(a, x) |
16 { | 38 { |
17 return a.upperBound(x) - a.lowerBound(x); | 39 return a.upperBound(x) - a.lowerBound(x); |
18 } | 40 } |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 </script> | 423 </script> |
402 </head> | 424 </head> |
403 | 425 |
404 <body onload="runTest()"> | 426 <body onload="runTest()"> |
405 <p> | 427 <p> |
406 This test checks Web Inspector utilities. | 428 This test checks Web Inspector utilities. |
407 </p> | 429 </p> |
408 | 430 |
409 </body> | 431 </body> |
410 </html> | 432 </html> |
OLD | NEW |