| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * @fileoverview This file contains tests for creating and loading log files. | 6 * @fileoverview This file contains tests for creating and loading log files. |
| 7 * It also tests the stop capturing button, since it both creates and then loads | 7 * It also tests the stop capturing button, since it both creates and then loads |
| 8 * a log dump. | 8 * a log dump. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 }, | 119 }, |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Loads the received log and completes the Task. | 122 * Loads the received log and completes the Task. |
| 123 * @param {string} logDumpText Log received from the browser process. | 123 * @param {string} logDumpText Log received from the browser process. |
| 124 */ | 124 */ |
| 125 onLogReceived_: function(logDumpText) { | 125 onLogReceived_: function(logDumpText) { |
| 126 assertEquals('string', typeof logDumpText); | 126 assertEquals('string', typeof logDumpText); |
| 127 expectTrue(SourceTracker.getInstance().getPrivacyStripping()); | 127 expectTrue(SourceTracker.getInstance().getPrivacyStripping()); |
| 128 | 128 |
| 129 var expectedResult = 'The log file is missing clientInfo.numericDate.\n' + | 129 var expectedResult = 'Log loaded.'; |
| 130 'Synthesizing export date as time of last event captured.\n' + | |
| 131 'Log loaded.'; | |
| 132 | 130 |
| 133 if (this.truncate_) { | 131 if (this.truncate_) { |
| 134 expectedResult = | 132 expectedResult = |
| 135 'Log file truncated. Events may be missing.\n' + expectedResult; | 133 'Log file truncated. Events may be missing.\n' + expectedResult; |
| 136 } | 134 } |
| 137 | 135 |
| 138 logDumpText = logDumpText.substring(0, logDumpText.length - this.truncate_); | 136 logDumpText = logDumpText.substring(0, logDumpText.length - this.truncate_); |
| 139 expectEquals(expectedResult, log_util.loadLogFile(logDumpText, 'log.txt')); | 137 expectEquals(expectedResult, log_util.loadLogFile(logDumpText, 'log.txt')); |
| 140 expectFalse(SourceTracker.getInstance().getPrivacyStripping()); | 138 expectFalse(SourceTracker.getInstance().getPrivacyStripping()); |
| 141 | 139 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 taskQueue.addFunctionTask(checkViewsAfterLogLoaded); | 275 taskQueue.addFunctionTask(checkViewsAfterLogLoaded); |
| 278 taskQueue.addFunctionTask(checkPrivacyStripping.bind(null, true)); | 276 taskQueue.addFunctionTask(checkPrivacyStripping.bind(null, true)); |
| 279 taskQueue.addFunctionTask(checkActiveView.bind(null, EventsView.TAB_ID)); | 277 taskQueue.addFunctionTask(checkActiveView.bind(null, EventsView.TAB_ID)); |
| 280 taskQueue.run(); | 278 taskQueue.run(); |
| 281 | 279 |
| 282 // Simulate a click on the stop capturing button | 280 // Simulate a click on the stop capturing button |
| 283 $(CaptureView.STOP_BUTTON_ID).click(); | 281 $(CaptureView.STOP_BUTTON_ID).click(); |
| 284 }); | 282 }); |
| 285 | 283 |
| 286 })(); // Anonymous namespace | 284 })(); // Anonymous namespace |
| OLD | NEW |