blob: 537261255f0907db2724055d7d71bfbdf96b2c55 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2013 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="/core/test_utils.html">
<link rel="import" href="/core/trace_model/trace_model.html">
<script>
'use strict';
tv.b.unittest.testSuite(function() {
var Sample = tv.c.trace_model.Sample;
var StackFrame = tv.c.trace_model.StackFrame;
var Thread = tv.c.trace_model.Thread;
test('sampleStackTrace', function() {
var thread = new Thread({}, 1);
var model = new tv.c.TraceModel();
var fABC = tv.c.test_utils.newStackTrace(model, 'cat', ['a', 'b', 'c']);
var s = new Sample(undefined, thread, 'instructions_retired',
10, fABC, 10);
var stackTrace = s.stackTrace;
var stackTraceNames = stackTrace.map(function(f) { return f.title; });
assert.deepEqual(
stackTraceNames,
['a', 'b', 'c']);
});
});
</script>