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

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

Issue 2016863004: Removed the isTimeHighResolutionHeuristic_ heuristic. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Created 4 years, 6 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/model.html ('k') | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 3 Copyright (c) 2013 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/trace_event_importer.html"> 9 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html">
10 <link rel="import" href="/tracing/importer/import.html"> 10 <link rel="import" href="/tracing/importer/import.html">
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 m.intrinsicTimeUnit = unit.ns; 272 m.intrinsicTimeUnit = unit.ns;
273 assert.equal(m.intrinsicTimeUnit, unit.ns); 273 assert.equal(m.intrinsicTimeUnit, unit.ns);
274 // should be able to set to the same 274 // should be able to set to the same
275 m.intrinsicTimeUnit = unit.ns; 275 m.intrinsicTimeUnit = unit.ns;
276 assert.equal(m.intrinsicTimeUnit, unit.ns); 276 assert.equal(m.intrinsicTimeUnit, unit.ns);
277 // should not be able to change it after fixing it 277 // should not be able to change it after fixing it
278 assert.throw(function() { m.intrinsicTimeUnit = unit.ms; }); 278 assert.throw(function() { m.intrinsicTimeUnit = unit.ms; });
279 assert.equal(m.intrinsicTimeUnit, unit.ns); 279 assert.equal(m.intrinsicTimeUnit, unit.ns);
280 }); 280 });
281 281
282 test('model_highResolutionHeuristicTrue', function() {
283 var m = new tr.Model();
284 var t = m.getOrCreateProcess(1).getOrCreateThread(1);
285 // A thousand event not aligned on a millisecond.
286 for (var i = 0; i < 1000; ++i) {
287 var start = 0.53 * i;
288 t.sliceGroup.pushSlice(new ThreadSlice('c', 'a', 0, start, {}, 1));
289 }
290 assert.isTrue(m.isTimeHighResolution);
291 });
292
293 test('model_highResolutionHeuristicFalse', function() {
294 var m = new tr.Model();
295 var t = m.getOrCreateProcess(1).getOrCreateThread(1);
296 // A thousand event aligned on a millisecond.
297 for (var i = 0; i < 1000; ++i) {
298 var start = 0.753 + i;
299 t.sliceGroup.pushSlice(new ThreadSlice('c', 'a', 0, start, {}, 1));
300 }
301 // And fifty not aligned on anything.
302 for (var i = 0; i < 50; ++i) {
303 var start = 0.53 * i;
304 t.sliceGroup.pushSlice(new ThreadSlice('c', 'a', 0, start, {}, 1));
305 }
306 assert.isFalse(m.isTimeHighResolution);
307 });
308
309 test('model_getAllProcesses', function() { 282 test('model_getAllProcesses', function() {
310 var m = new tr.Model(); 283 var m = new tr.Model();
311 var p1 = m.getOrCreateProcess(1); 284 var p1 = m.getOrCreateProcess(1);
312 var p2 = m.getOrCreateProcess(2); 285 var p2 = m.getOrCreateProcess(2);
313 var p3 = m.getOrCreateProcess(3); 286 var p3 = m.getOrCreateProcess(3);
314 var p4 = m.getOrCreateProcess(4); 287 var p4 = m.getOrCreateProcess(4);
315 var p5 = m.getOrCreateProcess(5); 288 var p5 = m.getOrCreateProcess(5);
316 289
317 assert.sameMembers(m.getAllProcesses(), [p1, p2, p3, p4, p5]); 290 assert.sameMembers(m.getAllProcesses(), [p1, p2, p3, p4, p5]);
318 assert.sameMembers(m.getAllProcesses(p => true), [p1, p2, p3, p4, p5]); 291 assert.sameMembers(m.getAllProcesses(p => true), [p1, p2, p3, p4, p5]);
319 assert.sameMembers(m.getAllProcesses(p => false), []); 292 assert.sameMembers(m.getAllProcesses(p => false), []);
320 assert.sameMembers(m.getAllProcesses(p => p.pid % 2 === 0), [p2, p4]); 293 assert.sameMembers(m.getAllProcesses(p => p.pid % 2 === 0), [p2, p4]);
321 }); 294 });
322 }); 295 });
323 </script> 296 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/model/model.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698