summaryrefslogtreecommitdiff
path: root/chromium/third_party/catapult/tracing/tracing/value/ui/iteration_info_span.html
blob: 6b7d52be4b17040454c19923c82137b6e23a35f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/ui/base/table.html">

<dom-module id="tr-v-ui-iteration-info-span">
  <template>
    <tr-ui-b-table id="table"></tr-ui-b-table>
  </template>
</dom-module>
<script>
'use strict';
Polymer({
  is: 'tr-v-ui-iteration-info-span',

  ready: function() {
    this.diagnostic_ = undefined;
    this.$.table.showHeader = false;
    this.$.table.tableColumns = [
      {
        value: function(row) {
          return row[0];
        },
      },
      {
        value: function(row) {
          return row[1];
        }
      }
    ];
  },

  get diagnostic() {
    return this.diagnostic_;
  },

  set diagnostic(d) {
    this.diagnostic_ = d;
    this.updateContents_();
  },

  updateContents_: function() {
    if (this.diagnostic === undefined) {
      this.$.table.tableRows = [];
      return;
    }

    var rows = [];

    if (this.diagnostic.osVersion) {
      rows.push(['OS version', this.diagnostic.osVersion]);
    }
    if (this.diagnostic.productVersion) {
      rows.push(['product version', this.diagnostic.productVersion]);
    }
    if (this.diagnostic.benchmarkName) {
      rows.push(['benchmark name', this.diagnostic.benchmarkName]);
    }
    if (this.diagnostic.benchmarkStart) {
      rows.push(['benchmark start', this.diagnostic.benchmarkStartString]);
    }
    if (this.diagnostic.storyUrl) {
      rows.push(['url', this.diagnostic.storyUrl]);
    }
    if (this.diagnostic.storyDisplayName) {
      rows.push(['story', this.diagnostic.storyDisplayName]);
    }
    if (this.diagnostic.storysetRepeatCounter !== undefined) {
      rows.push(['storyset repeat', this.diagnostic.storysetRepeatCounter]);
    }
    if (this.diagnostic.storyRepeatCounter !== undefined) {
      rows.push(['story repeat', this.diagnostic.storyRepeatCounter]);
    }
    if (this.diagnostic.label) {
      rows.push(['label', this.diagnostic.label]);
    }
    if (this.diagnostic.storyGroupingKeys &&
        (tr.b.dictionaryLength(this.diagnostic.storyGroupingKeys) > 0)) {
      var gov = document.createElement('tr-ui-a-generic-object-view');
      gov.object = this.diagnostic.storyGroupingKeys;
      rows.push(['grouping keys', gov]);
    }
    this.$.table.tableRows = rows;
  }
});
</script>