3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script type="text/javascript">
7 function testAutoSize(widths, minPercent, maxPercent)
9 InspectorTest.addResult("Auto sizing " + JSON.stringify(widths) + ", minPercent=" + minPercent + ", maxPercent=" + maxPercent);
10 var result = WebInspector.DataGrid.prototype._autoSizeWidths(widths, minPercent, maxPercent);
11 InspectorTest.addResult(" " + JSON.stringify(result));
14 testAutoSize([198, 2, 400], 90);
15 testAutoSize([1000], 5);
16 testAutoSize([10], 5);
17 testAutoSize([1000, 1000], 5);
18 testAutoSize([30, 30, 30, 30], 5);
19 testAutoSize([1, 100, 100, 100], 25);
20 testAutoSize([100, 100, 100, 100], 25);
21 testAutoSize([1, 1, 1, 100], 25);
22 testAutoSize([1, 100, 100], 25, 40);
23 testAutoSize([100, 100, 100], 25, 40);
24 testAutoSize([1, 1, 100], 25, 40);
26 // https://bugs.webkit.org/show_bug.cgi?id=101363
27 testAutoSize([3, 10, 7, 7, 13, 13, 9, 10, 15, 15, 20, 20, 14, 14, 12, 12, 12, 10, 9, 14, 10, 6, 7, 10, 18], 5);
28 InspectorTest.completeTest();
33 <body onload="runTest()">
34 <p>Tests DataGrid column auto size calculation.</p>
35 <a href="https://bugs.webkit.org/show_bug.cgi?id=101363">Bug 101363</a>