(t, fraction)
| 54 | // checkWidth checks that the width of the box with text t is approximately |
| 55 | // the specified fraction of the total width. |
| 56 | function checkWidth(t, fraction) { |
| 57 | test.setContext("checkWidth", t, fraction); |
| 58 | const r = rect(t); |
| 59 | if (!r) return; |
| 60 | const expect = (chartRect.width - 2*PADDING) * fraction; |
| 61 | if (r.width < expect*0.95 || r.width > expect*1.05) { |
| 62 | test.err("bad width", r.width, "expecting ~", expect); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // Fake profile has the following stacks: |
| 67 | // 100 F1 F2 F3 |
no test coverage detected
searching dependent graphs…