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

Side by Side Diff: tools/deep_memory_profiler/visualizer/static/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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 * Test whether given line is valid. 6 * Test whether given line is valid.
7 * @param {Object} line 7 * @param {Object} line
8 * @param {number} length Length of line data. 8 * @param {number} length Length of line data.
9 * @return {boolean} Line is valid or not. 9 * @return {boolean} Line is valid or not.
10 */ 10 */
11 var lineIsValid = function(line, length) { 11 var lineIsValid = function(line, length) {
12 if (!('id' in line)) 12 if (!('id' in line))
13 return false; 13 return false;
14 if (!('label' in line)) 14 if (!('label' in line))
15 return false; 15 return false;
16 if (!('data' in line) || 16 if (!('data' in line) ||
17 'data' in line && line.data.length !== length) 17 'data' in line && line.data.length !== length)
18 return false; 18 return false;
19 19
20 return true; 20 return true;
21 }; 21 };
22 22
23 // Test title format is file-name:function-name. 23 // Test title format is file-name:function-name.
24 test('graph-view:generateLines_', function() { 24 test('graph-view:generateLines_', function() {
25 stop(); 25 stop();
26 $.getJSON('data/sample.json', function(data) { 26 $.getJSON('../data/sample.json', function(data) {
27 start(); 27 start();
28 var profiler = new Profiler(data); 28 var profiler = new Profiler(data);
29 var models = profiler.parseTemplate_(); 29 var models = profiler.parseTemplate_();
30 var length = models.length; 30 var length = models.length;
31 var lines = GraphView.prototype.generateLines_(models); 31 var lines = GraphView.prototype.generateLines_(models);
32 lines.forEach(function(line) { 32 lines.forEach(function(line) {
33 ok(lineIsValid(line, length)); 33 ok(lineIsValid(line, length));
34 }); 34 });
35 inspect(lines, 'lines generated by graph view:\n'); 35 inspect(lines, 'lines generated by graph view:\n');
36 }); 36 });
37 }); 37 });
OLDNEW
« no previous file with comments | « tools/deep_memory_profiler/visualizer/static/graph-view.js ('k') | tools/deep_memory_profiler/visualizer/static/index.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698