| Index: tracing/tracing/extras/chrome/blame_context/blame_context_test.html
|
| diff --git a/tracing/tracing/extras/chrome/blame_context/blame_context_test.html b/tracing/tracing/extras/chrome/blame_context/blame_context_test.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0767958d59404a33d2da9156a5746d0e914ea2a2
|
| --- /dev/null
|
| +++ b/tracing/tracing/extras/chrome/blame_context/blame_context_test.html
|
| @@ -0,0 +1,75 @@
|
| +<!DOCTYPE html>
|
| +<!--
|
| +Copyright 2016 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">
|
| +<link rel="import" href="/tracing/extras/chrome/blame_context/blame_context.html">
|
| +<link rel="import" href="/tracing/extras/importer/trace_event_importer.html">
|
| +<link rel="import" href="/tracing/model/model.html">
|
| +<link rel="import" href="/tracing/model/scoped_id.html">
|
| +
|
| +<script>
|
| +'use strict';
|
| +
|
| +tr.b.unittest.testSuite(function() {
|
| + var BlameContextSnapshot = tr.e.chrome.BlameContextSnapshot;
|
| + var BlameContextInstance = tr.e.chrome.BlameContextInstance;
|
| +
|
| + function TestBlameContextSnapshot() {
|
| + BlameContextSnapshot.apply(this, arguments);
|
| + }
|
| +
|
| + TestBlameContextSnapshot.prototype = {
|
| + __proto__: BlameContextSnapshot.prototype,
|
| +
|
| + get userFriendlyName() {
|
| + return 'Test';
|
| + }
|
| + };
|
| +
|
| + tr.model.ObjectSnapshot.register(
|
| + TestBlameContextSnapshot,
|
| + {typeName: 'Test'});
|
| +
|
| + function TestBlameContextInstance() {
|
| + BlameContextInstance.apply(this, arguments);
|
| + }
|
| +
|
| + TestBlameContextInstance.prototype = {
|
| + __proto__: BlameContextInstance.prototype,
|
| +
|
| + get isTracedByRenderer() {
|
| + return false;
|
| + },
|
| +
|
| + get blameContextType() {
|
| + return 'Test';
|
| + }
|
| + };
|
| +
|
| + tr.model.ObjectInstance.register(
|
| + TestBlameContextInstance,
|
| + {typeName: 'Test'});
|
| +
|
| + test('parentContext', function() {
|
| + var model = new tr.Model();
|
| + var process = model.getOrCreateProcess(1);
|
| + var parent = process.objects.addSnapshot(
|
| + new tr.model.ScopedId('Test', '0x1'),
|
| + 'cat', 'Test', 1000, {});
|
| + var child = process.objects.addSnapshot(
|
| + new tr.model.ScopedId('Test', '0x2'),
|
| + 'cat', 'Test', 1111, {
|
| + parent: {
|
| + scope: 'Test',
|
| + id_ref: '0x1'
|
| + }
|
| + });
|
| + model.joinRefs();
|
| + assert.isTrue(child.parentContext === parent);
|
| + });
|
| +});
|
| +</script>
|
|
|