| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/tracing/core/test_utils.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.b.unittest.testSuite(function() { |
| var newAsyncSliceEx = tr.c.TestUtils.newAsyncSliceEx; |
| var newFakeThread = tr.c.TestUtils.newFakeThread; |
| |
| test('stableId', function() { |
| var thread = newFakeThread(); |
| var group = thread.asyncSliceGroup; |
| |
| var sA = group.push(newAsyncSliceEx( |
| { title: 'sA', start: 0.0, duration: 10.0 })); |
| var sB = group.push(newAsyncSliceEx( |
| { title: 'sB', start: 10.0, duration: 20.0 })); |
| var sC = group.push(newAsyncSliceEx( |
| { title: 'sC', start: 20.0, duration: 30.0 })); |
| |
| assert.equal(group.stableId + '.0', sA.stableId); |
| assert.equal(group.stableId + '.1', sB.stableId); |
| assert.equal(group.stableId + '.2', sC.stableId); |
| }); |
| }); |
| </script> |