| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 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 <link rel="import" href="/tracing/core/test_utils.html"> | 8 <link rel="import" href="/tracing/core/test_utils.html"> |
| 9 <link rel="import" href="/tracing/extras/importer/battor_importer.html"> | 9 <link rel="import" href="/tracing/extras/importer/battor_importer.html"> |
| 10 <link rel="import" href="/tracing/extras/importer/linux_perf/ftrace_importer.htm
l"> | 10 <link rel="import" href="/tracing/extras/importer/linux_perf/ftrace_importer.htm
l"> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 var m = tr.c.TestUtils.newModelWithEvents( | 56 var m = tr.c.TestUtils.newModelWithEvents( |
| 57 [CHROMIUM_EVENTS, battorLinesWithExplicitSync.join('\n')]); | 57 [CHROMIUM_EVENTS, battorLinesWithExplicitSync.join('\n')]); |
| 58 | 58 |
| 59 // Check to see if power samples were imported successfully. | 59 // Check to see if power samples were imported successfully. |
| 60 assert.isDefined(m.device.powerSeries); | 60 assert.isDefined(m.device.powerSeries); |
| 61 | 61 |
| 62 assert.strictEqual(m.device.powerSeries.samples[0].start, 7.5); | 62 assert.strictEqual(m.device.powerSeries.samples[0].start, 7.5); |
| 63 assert.strictEqual(m.device.powerSeries.samples[5].start, 10.0); | 63 assert.strictEqual(m.device.powerSeries.samples[5].start, 10.0); |
| 64 }); | 64 }); |
| 65 | 65 |
| 66 test('importExplicitClockSync_syncOnNegativeVoltageLine', function() { |
| 67 // Add a BattOr sample with an explicit clock sync that occurs on a line |
| 68 // with a negative voltage measurement. The sample should be ignored, but |
| 69 // the clock sync should be counted. |
| 70 var battorLinesWithExplicitSync = BATTOR_LINES.slice(); |
| 71 battorLinesWithExplicitSync.push( |
| 72 '2.500000 -1.000000 4000.000000 <ABCDEF-01234-5678-0A1B2C3D>'); |
| 73 |
| 74 var m = tr.c.TestUtils.newModelWithEvents( |
| 75 [CHROMIUM_EVENTS, battorLinesWithExplicitSync.join('\n')]); |
| 76 |
| 77 // Check to see if power samples were imported successfully. |
| 78 assert.isDefined(m.device.powerSeries); |
| 79 |
| 80 assert.lengthOf(m.device.powerSeries.samples, 5); |
| 81 assert.strictEqual(m.device.powerSeries.samples[0].start, 7.5); |
| 82 }); |
| 83 |
| 66 test('explicitClockSyncWithoutSyncMarkers', function() { | 84 test('explicitClockSyncWithoutSyncMarkers', function() { |
| 67 // Create an empty model. | 85 // Create an empty model. |
| 68 var m = new tr.Model(); | 86 var m = new tr.Model(); |
| 69 var io = new tr.importer.ImportOptions(); | 87 var io = new tr.importer.ImportOptions(); |
| 70 io.showImportWarnings = false; | 88 io.showImportWarnings = false; |
| 71 m.importOptions = io; | 89 m.importOptions = io; |
| 72 | 90 |
| 73 // Add a BattOr sample with an explicit clock sync. | 91 // Add a BattOr sample with an explicit clock sync. |
| 74 var battorLinesWithExplicitSync = BATTOR_LINES.slice(); | 92 var battorLinesWithExplicitSync = BATTOR_LINES.slice(); |
| 75 battorLinesWithExplicitSync.push( | 93 battorLinesWithExplicitSync.push( |
| 76 '2.500000 1.000000 4000.000000 <ABCDEF-01234-5678-0A1B2C3D>'); | 94 '2.500000 1.000000 4000.000000 <ABCDEF-01234-5678-0A1B2C3D>'); |
| 77 | 95 |
| 78 var m = tr.c.TestUtils.newModelWithEvents( | 96 var m = tr.c.TestUtils.newModelWithEvents( |
| 79 [battorLinesWithExplicitSync.join('\n')]); | 97 [battorLinesWithExplicitSync.join('\n')]); |
| 80 | 98 |
| 99 assert.lengthOf(m.device.powerSeries.samples, 6); |
| 81 assert.strictEqual(m.device.powerSeries.samples[0].start, 0); | 100 assert.strictEqual(m.device.powerSeries.samples[0].start, 0); |
| 82 assert.strictEqual(m.device.powerSeries.samples[5].start, 2.5); | 101 assert.strictEqual(m.device.powerSeries.samples[5].start, 2.5); |
| 83 }); | 102 }); |
| 84 }); | 103 }); |
| 85 </script> | 104 </script> |
| OLD | NEW |