Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: LayoutTests/inspector/utilities.html

Issue 199793022: DevTools: Fix a bug in Array.remove (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Turned back to a simple version. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/utilities-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/utilities-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698