1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 * Test whether given line is valid.
8 * @param {number} length Length of line data.
9 * @return {boolean} Line is valid or not.
11 var lineIsValid = function(line
, length
) {
14 if (!('label' in line
))
16 if (!('data' in line
) ||
17 'data' in line
&& line
.data
.length
!== length
)
23 // Test title format is file-name:function-name.
24 test('graph-view:generateLines_', function() {
26 $.getJSON('../data/sample.json', function(data
) {
28 var profiler
= new Profiler(data
);
29 var models
= profiler
.parseTemplate_();
30 var length
= models
.length
;
31 var lines
= GraphView
.prototype.generateLines_(models
);
32 lines
.forEach(function(line
) {
33 ok(lineIsValid(line
, length
));
35 inspect(lines
, 'lines generated by graph view:\n');