Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: tracing/tracing/model/device_test.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tracing/tracing/model/device.html ('k') | tracing/tracing/model/event_container.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/model/device.html"> 8 <link rel="import" href="/tracing/model/device.html">
9 <link rel="import" href="/tracing/model/model.html"> 9 <link rel="import" href="/tracing/model/model.html">
10 <link rel="import" href="/tracing/model/power_series.html"> 10 <link rel="import" href="/tracing/model/power_series.html">
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 device.powerSeries = new PowerSeries(device); 43 device.powerSeries = new PowerSeries(device);
44 44
45 device.powerSeries.addPowerSample(100, 2); 45 device.powerSeries.addPowerSample(100, 2);
46 device.powerSeries.addPowerSample(200, 2); 46 device.powerSeries.addPowerSample(200, 2);
47 device.shiftTimestampsForward(2); 47 device.shiftTimestampsForward(2);
48 48
49 assert.equal(device.powerSeries.samples[0].start, 102); 49 assert.equal(device.powerSeries.samples[0].start, 102);
50 assert.equal(device.powerSeries.samples[1].start, 202); 50 assert.equal(device.powerSeries.samples[1].start, 202);
51 }); 51 });
52 52
53 test('iterateAllChildEventContainers', function() { 53 test('childEventContainers_noPowerSeries', function() {
54 var device = new Device(new Model()); 54 var device = new Device(new Model());
55 var childEventContainers = [];
56 for (var container of device.childEventContainers())
57 childEventContainers.push(container);
58 assert.deepEqual(childEventContainers, []);
59 });
55 60
56 // Power series shouldn't be included as a child until one's set. 61 test('childEventContainers_powerSeries', function() {
62 var device = new Device(new Model());
63 device.powerSeries = new PowerSeries(device);
57 var childEventContainers = []; 64 var childEventContainers = [];
58 device.iterateAllChildEventContainers(function(eventContainer) { 65 for (var container of device.childEventContainers())
59 childEventContainers.push(eventContainer); 66 childEventContainers.push(container);
60 });
61
62 assert.deepEqual(childEventContainers, []);
63
64 device.powerSeries = new PowerSeries(device);
65
66 // Verify that the power series is now included as a child.
67 var childEventContainers = [];
68 device.iterateAllChildEventContainers(function(eventContainer) {
69 childEventContainers.push(eventContainer);
70 });
71
72 assert.deepEqual(childEventContainers, [device.powerSeries]); 67 assert.deepEqual(childEventContainers, [device.powerSeries]);
73 }); 68 });
69
74 }); 70 });
75 </script> 71 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/model/device.html ('k') | tracing/tracing/model/event_container.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698