blob: a06e6c2ed90ce17068ecfdc6e91933f669013ded [file] [log] [blame]
<!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="/perf_insights/mappers/startup_map_function.html">
<link rel="import" href="/perf_insights/mre/mre_result.html">
<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/model/user_model/load_expectation.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
var test_utils = tr.c.TestUtils;
var ThreadSlice = tr.model.ThreadSlice;
test('startupMapFunctionTest', function() {
var m = test_utils.newModel(function(m) {
var p1 = m.getOrCreateProcess(1);
var t2 = p1.getOrCreateThread(2);
var t2_s1 = t2.sliceGroup.pushSlice(test_utils.newSliceEx({
type: ThreadSlice,
name: 'some_slice',
start: 0, end: 10
}));
var t2_s2 = t2.sliceGroup.pushSlice(test_utils.newSliceEx({
type: ThreadSlice,
name: 'some_slice',
start: 20, end: 30
}));
var loadIr = new tr.model.um.LoadExpectation(
m, tr.model.um.LOAD_SUBTYPE_NAMES.STARTUP, 0, 10);
m.userModel.expectations.push(loadIr);
loadIr.associatedEvents.push(t2_s1);
loadIr.associatedEvents.push(t2_s2);
});
var result = new pi.mre.MreResult();
pi.m.startupMapFunctionForTest(result, m);
});
});
</script>