| 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 * Navigates to the test tab, runs the test suite |totalIterations| times, using | 6 * Navigates to the test tab, runs the test suite |totalIterations| times, using |
| 7 * |url|, and expects to see |expectedResult| from each iteration. Checks the | 7 * |url|, and expects to see |expectedResult| from each iteration. Checks the |
| 8 * order and several fields of the events received. | 8 * order and several fields of the events received. |
| 9 */ | 9 */ |
| 10 netInternalsTest.test('NetInternalsTestView', | 10 netInternalsTest.test('NetInternalsTestView', |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 expectFalse(this.seenStartExperiment_, | 105 expectFalse(this.seenStartExperiment_, |
| 106 'Suite stopped while experiment was still running.'); | 106 'Suite stopped while experiment was still running.'); |
| 107 expectEquals(12, this.experimentsRun_, | 107 expectEquals(12, this.experimentsRun_, |
| 108 'Incorrect number of experiments run.'); | 108 'Incorrect number of experiments run.'); |
| 109 checkTestTableRows(this.experimentsRun_); | 109 checkTestTableRows(this.experimentsRun_); |
| 110 | 110 |
| 111 ++this.completedIterations_; | 111 ++this.completedIterations_; |
| 112 if (this.completedIterations_ < this.totalIterations_) { | 112 if (this.completedIterations_ < this.totalIterations_) { |
| 113 this.startTestSuite(); | 113 this.startTestSuite(); |
| 114 } else { | 114 } else { |
| 115 netInternalsTest.testDone(); | 115 asyncTestDone(); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * Checks that there are |expected| rows in the test table. | 121 * Checks that there are |expected| rows in the test table. |
| 122 * @param {number} expectedRows Expected number of rows in the table. | 122 * @param {number} expectedRows Expected number of rows in the table. |
| 123 */ | 123 */ |
| 124 function checkTestTableRows(expectedRows) { | 124 function checkTestTableRows(expectedRows) { |
| 125 netInternalsTest.checkStyledTableRows(SUMMARY_DIV_ID, expectedRows); | 125 netInternalsTest.checkStyledTableRows(SUMMARY_DIV_ID, expectedRows); |
| 126 } | 126 } |
| 127 | 127 |
| 128 netInternalsTest.switchToView('tests'); | 128 netInternalsTest.switchToView('tests'); |
| 129 | 129 |
| 130 // Create observer and start the test. | 130 // Create observer and start the test. |
| 131 var testObserver = new TestObserver(url, expectedResult, totalIterations); | 131 var testObserver = new TestObserver(url, expectedResult, totalIterations); |
| 132 g_browser.addConnectionTestsObserver(testObserver); | 132 g_browser.addConnectionTestsObserver(testObserver); |
| 133 testObserver.startTestSuite(); | 133 testObserver.startTestSuite(); |
| 134 }); | 134 }); |
| OLD | NEW |