OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Coverage.CoverageListView = class extends UI.VBox { | 5 Coverage.CoverageListView = class extends UI.VBox { |
6 constructor() { | 6 constructor() { |
7 super(true); | 7 super(true); |
8 /** @type {!Map<!Coverage.URLCoverageInfo, !Coverage.CoverageListView.GridNo
de>} */ | 8 /** @type {!Map<!Coverage.URLCoverageInfo, !Coverage.CoverageListView.GridNo
de>} */ |
9 this._nodeForCoverageInfo = new Map(); | 9 this._nodeForCoverageInfo = new Map(); |
10 this.registerRequiredCSS('coverage/coverageListView.css'); | 10 this.registerRequiredCSS('coverage/coverageListView.css'); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 case 'unusedSize': | 236 case 'unusedSize': |
237 var unusedSize = this._coverageInfo.unusedSize() || 0; | 237 var unusedSize = this._coverageInfo.unusedSize() || 0; |
238 var unusedSizeSpan = cell.createChild('span'); | 238 var unusedSizeSpan = cell.createChild('span'); |
239 var unusedPercentsSpan = cell.createChild('span', 'percent-value'); | 239 var unusedPercentsSpan = cell.createChild('span', 'percent-value'); |
240 unusedSizeSpan.textContent = Number.withThousandsSeparator(unusedSize); | 240 unusedSizeSpan.textContent = Number.withThousandsSeparator(unusedSize); |
241 unusedPercentsSpan.textContent = Common.UIString('%.1f\xa0%%', unusedSiz
e / this._coverageInfo.size() * 100); | 241 unusedPercentsSpan.textContent = Common.UIString('%.1f\xa0%%', unusedSiz
e / this._coverageInfo.size() * 100); |
242 break; | 242 break; |
243 case 'bars': | 243 case 'bars': |
244 var barContainer = cell.createChild('div', 'bar-container'); | 244 var barContainer = cell.createChild('div', 'bar-container'); |
245 var unusedSizeBar = barContainer.createChild('div', 'bar bar-unused-size
'); | 245 var unusedSizeBar = barContainer.createChild('div', 'bar bar-unused-size
'); |
246 unusedSizeBar.style.width = Math.ceil(100 * this._coverageInfo.unusedSiz
e() / this._maxSize) + '%'; | 246 unusedSizeBar.style.width = (100 * this._coverageInfo.unusedSize() / thi
s._maxSize).toFixed(4) + '%'; |
247 var usedSizeBar = barContainer.createChild('div', 'bar bar-used-size'); | 247 var usedSizeBar = barContainer.createChild('div', 'bar bar-used-size'); |
248 usedSizeBar.style.width = Math.floor(100 * this._coverageInfo.usedSize()
/ this._maxSize) + '%'; | 248 usedSizeBar.style.width = (100 * this._coverageInfo.usedSize() / this._m
axSize).toFixed(4) + '%'; |
249 } | 249 } |
250 return cell; | 250 return cell; |
251 } | 251 } |
252 }; | 252 }; |
OLD | NEW |