| 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..5b0b9730a8412f4c0d509fd4cb948f3fe4c89c0a
|
| --- /dev/null
|
| +++ b/tracing/tracing/extras/chrome/blame_context/blame_context_test.html
|
| @@ -0,0 +1,64 @@
|
| +<!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">
|
| +
|
| +<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 blameContextType() {
|
| + return 'Test';
|
| + }
|
| + };
|
| +
|
| + tr.model.ObjectInstance.register(
|
| + TestBlameContextInstance,
|
| + {typeName: 'Test'});
|
| +
|
| + var TestUtils = tr.c.TestUtils;
|
| +
|
| + test('parentContext', function() {
|
| + var parent;
|
| + var child;
|
| + TestUtils.newModel(function(model) {
|
| + parent = TestUtils.newSnapshot(model, {id: '0x1', name: 'Test'});
|
| + child = TestUtils.newSnapshot(model, {id: '0x2', name: 'Test',
|
| + args: {parent: {id_ref: '0x1'}}});
|
| + });
|
| +
|
| + assert.isTrue(child.parentContext === parent);
|
| + });
|
| +});
|
| +</script>
|
|
|