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