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

Side by Side Diff: tools/deep_memory_profiler/visualizer/graph-view_unittest.js

Issue 23777005: Modified directory preparing for app engine for dmprof visualizer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove index.js Created 7 years, 3 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
OLDNEW
(Empty)
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.
4
5 /**
6 * Test whether given line is valid.
7 * @param {Object} line
8 * @param {number} length Length of line data.
9 * @return {boolean} Line is valid or not.
10 */
11 var lineIsValid = function(line, length) {
12 if (!('id' in line))
13 return false;
14 if (!('label' in line))
15 return false;
16 if (!('data' in line) ||
17 'data' in line && line.data.length !== length)
18 return false;
19
20 return true;
21 };
22
23 // Test title format is file-name:function-name.
24 test('graph-view:generateLines_', function() {
25 stop();
26 $.getJSON('data/sample.json', function(data) {
27 start();
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));
34 });
35 inspect(lines, 'lines generated by graph view:\n');
36 });
37 });
OLDNEW
« no previous file with comments | « tools/deep_memory_profiler/visualizer/graph-view.js ('k') | tools/deep_memory_profiler/visualizer/index.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698