OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /** | 5 /** |
6 * This view displays the progress and results from the "connection tester". | 6 * This view displays the progress and results from the "connection tester". |
7 * | 7 * |
8 * - Has an input box to specify the URL. | 8 * - Has an input box to specify the URL. |
9 * - Has a button to start running the tests. | 9 * - Has a button to start running the tests. |
10 * - Shows the set of experiments that have been run so far, and their | 10 * - Shows the set of experiments that have been run so far, and their |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 addTextNode(dtCell, '?'); | 95 addTextNode(dtCell, '?'); |
96 | 96 |
97 // We will fill in result cells with actual values (to replace the | 97 // We will fill in result cells with actual values (to replace the |
98 // placeholder '?') once the test has completed. For now we just | 98 // placeholder '?') once the test has completed. For now we just |
99 // save references to these cells. | 99 // save references to these cells. |
100 this.currentExperimentRow_ = { | 100 this.currentExperimentRow_ = { |
101 experimentCell: experimentCell, | 101 experimentCell: experimentCell, |
102 dtCell: dtCell, | 102 dtCell: dtCell, |
103 resultCell: resultCell, | 103 resultCell: resultCell, |
104 passFailCell: passFailCell, | 104 passFailCell: passFailCell, |
105 startTime: (new Date()).getTime() | 105 startTime: timeutil.getCurrentTime() |
106 }; | 106 }; |
107 | 107 |
108 addTextNode(experimentCell, 'Fetch ' + experiment.url); | 108 addTextNode(experimentCell, 'Fetch ' + experiment.url); |
109 | 109 |
110 if (experiment.proxy_settings_experiment || | 110 if (experiment.proxy_settings_experiment || |
111 experiment.host_resolver_experiment) { | 111 experiment.host_resolver_experiment) { |
112 var ul = addNode(experimentCell, 'ul'); | 112 var ul = addNode(experimentCell, 'ul'); |
113 | 113 |
114 if (experiment.proxy_settings_experiment) { | 114 if (experiment.proxy_settings_experiment) { |
115 var li = addNode(ul, 'li'); | 115 var li = addNode(ul, 'li'); |
116 addTextNode(li, experiment.proxy_settings_experiment); | 116 addTextNode(li, experiment.proxy_settings_experiment); |
117 } | 117 } |
118 | 118 |
119 if (experiment.host_resolver_experiment) { | 119 if (experiment.host_resolver_experiment) { |
120 var li = addNode(ul, 'li'); | 120 var li = addNode(ul, 'li'); |
121 addTextNode(li, experiment.host_resolver_experiment); | 121 addTextNode(li, experiment.host_resolver_experiment); |
122 } | 122 } |
123 } | 123 } |
124 }, | 124 }, |
125 | 125 |
126 /** | 126 /** |
127 * Callback for when an individual test in the suite has finished. | 127 * Callback for when an individual test in the suite has finished. |
128 */ | 128 */ |
129 onCompletedConnectionTestExperiment: function(experiment, result) { | 129 onCompletedConnectionTestExperiment: function(experiment, result) { |
130 var r = this.currentExperimentRow_; | 130 var r = this.currentExperimentRow_; |
131 | 131 |
132 var endTime = (new Date()).getTime(); | 132 var endTime = timeutil.getCurrentTime(); |
133 | 133 |
134 r.dtCell.innerHTML = ''; | 134 r.dtCell.innerHTML = ''; |
135 addTextNode(r.dtCell, (endTime - r.startTime)); | 135 addTextNode(r.dtCell, (endTime - r.startTime)); |
136 | 136 |
137 r.resultCell.innerHTML = ''; | 137 r.resultCell.innerHTML = ''; |
138 | 138 |
139 if (result == 0) { | 139 if (result == 0) { |
140 r.passFailCell.style.color = 'green'; | 140 r.passFailCell.style.color = 'green'; |
141 addTextNode(r.passFailCell, 'PASS'); | 141 addTextNode(r.passFailCell, 'PASS'); |
142 } else { | 142 } else { |
(...skipping 10 matching lines...) Expand all Loading... |
153 * Callback for when the last test in the suite has finished. | 153 * Callback for when the last test in the suite has finished. |
154 */ | 154 */ |
155 onCompletedConnectionTestSuite: function() { | 155 onCompletedConnectionTestSuite: function() { |
156 var p = addNode(this.summaryDiv_, 'p'); | 156 var p = addNode(this.summaryDiv_, 'p'); |
157 addTextNode(p, 'Completed connection test suite suite'); | 157 addTextNode(p, 'Completed connection test suite suite'); |
158 } | 158 } |
159 }; | 159 }; |
160 | 160 |
161 return TestView; | 161 return TestView; |
162 })(); | 162 })(); |
OLD | NEW |