OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2015 The Chromium Authors. All rights reserved. | 3 Copyright 2015 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <script src="/jquery/jquery-2.1.4.min.js"></script> | 8 <script src="/jquery/jquery-2.1.4.min.js"></script> |
9 <script src="/flot/jquery.flot.min.js"></script> | 9 <script src="/flot/jquery.flot.min.js"></script> |
10 <script src="/flot/jquery.flot.crosshair.min.js"></script> | 10 <script src="/flot/jquery.flot.crosshair.min.js"></script> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 test('unseletected has displayName', function() { | 98 test('unseletected has displayName', function() { |
99 testing_common.mockChartJson(dromaeoCharts); | 99 testing_common.mockChartJson(dromaeoCharts); |
100 const chart = createChart(); | 100 const chart = createChart(); |
101 this.addHTMLOutput(chart); | 101 this.addHTMLOutput(chart); |
102 chart.addSeriesGroup(dromaeoCharts.graphParams); | 102 chart.addSeriesGroup(dromaeoCharts.graphParams); |
103 assert.strictEqual(chart.seriesGroupList[0].tests[0].displayName, 'dom'); | 103 assert.strictEqual(chart.seriesGroupList[0].tests[0].displayName, 'dom'); |
104 assert.strictEqual(chart.seriesGroupList[0].tests[1].displayName, | 104 assert.strictEqual(chart.seriesGroupList[0].tests[1].displayName, |
105 'http___dromaeo.com?dom-attr'); | 105 'http___dromaeo.com?dom-attr'); |
106 }, testOptions); | 106 }, testOptions); |
107 | 107 |
| 108 let originalUriGetQueryString; |
| 109 const testOptionsUri = { |
| 110 setUp() { |
| 111 originalUriGetQueryString = uri.getQueryString; |
| 112 }, |
| 113 tearDown() { |
| 114 testing_common.clearXhrMock(); |
| 115 testing_common.clearFixture(); |
| 116 uri.getQueryString = originalUriGetQueryString; |
| 117 } |
| 118 }; |
| 119 |
| 120 test('showTooltip uses uri bug_id', function() { |
| 121 uri.getQueryString = function() { return '?bug_id=123'; }; |
| 122 |
| 123 testing_common.mockChartJson( |
| 124 dromaeoCharts, dromaeoCharts.graphSelectedJson); |
| 125 testing_common.mockChartJson( |
| 126 sunspiderCharts, sunspiderCharts.graphSelectedJson); |
| 127 const chart = createChart(); |
| 128 this.addHTMLOutput(chart); |
| 129 chart.addSeriesGroup(dromaeoCharts.graphParams); |
| 130 chart.addSeriesGroup(sunspiderCharts.graphParams); |
| 131 chart.showTooltip(0, 0); |
| 132 assert.strictEqual(chart.$.tooltip.bugId, '123'); |
| 133 }, testOptionsUri); |
| 134 |
108 test('populateTestPicker', function() { | 135 test('populateTestPicker', function() { |
109 testing_common.mockChartJson(dromaeoCharts); | 136 testing_common.mockChartJson(dromaeoCharts); |
110 const chart = createChart(); | 137 const chart = createChart(); |
111 this.addHTMLOutput(chart); | 138 this.addHTMLOutput(chart); |
112 chart.addSeriesGroup(dromaeoCharts.graphParams); | 139 chart.addSeriesGroup(dromaeoCharts.graphParams); |
113 let ptpEventCount = 0; | 140 let ptpEventCount = 0; |
114 chart.addEventListener('populateTestPicker', function() { | 141 chart.addEventListener('populateTestPicker', function() { |
115 ++ptpEventCount; | 142 ++ptpEventCount; |
116 }); | 143 }); |
117 let orpEventCount = 0; | 144 let orpEventCount = 0; |
118 chart.addEventListener('openReportPage', function() { | 145 chart.addEventListener('openReportPage', function() { |
119 ++orpEventCount; | 146 ++orpEventCount; |
120 }); | 147 }); |
121 const ptpButton = tr.ui.b.findDeepElementMatching(chart, | 148 const ptpButton = tr.ui.b.findDeepElementMatching(chart, |
122 'paper-button[title="Populate test picker"]'); | 149 'paper-button[title="Populate test picker"]'); |
123 ptpButton.click(); | 150 ptpButton.click(); |
124 assert.strictEqual(ptpEventCount, 1); | 151 assert.strictEqual(ptpEventCount, 1); |
125 assert.strictEqual(orpEventCount, 1); | 152 assert.strictEqual(orpEventCount, 1); |
126 }, testOptions); | 153 }, testOptions); |
127 }); | 154 }); |
128 </script> | 155 </script> |
OLD | NEW |