Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: tracing/tracing/extras/chrome/blame_context/frame_blame_context_test.html

Issue 2016213002: Introduce base classes for blame contexts (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Add frame_blame_context_test.html; And some other revision Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/extras/chrome/blame_context/frame_blame_context_test.html
diff --git a/tracing/tracing/extras/chrome/blame_context/frame_blame_context_test.html b/tracing/tracing/extras/chrome/blame_context/frame_blame_context_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..3ec388cc2ac0ba0f155cf4cc90dab5b3eabe18bb
--- /dev/null
+++ b/tracing/tracing/extras/chrome/blame_context/frame_blame_context_test.html
@@ -0,0 +1,50 @@
+<!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/extras/chrome/blame_context/frame_tree_node.html">
+<link rel="import" href="/tracing/extras/chrome/blame_context/render_frame.html">
+<link rel="import" href="/tracing/extras/chrome/blame_context/top_level.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() {
+ test('crossProcessCounterpart', function() {
+ var model = new tr.Model();
+ var browser = model.getOrCreateProcess(1);
+ var frameTreeNode = browser.objects.addSnapshot(
+ new tr.model.ScopedId('FrameTreeNode', '0x1'),
+ 'navigation', 'FrameTreeNode', 1111, {
+ RenderFrame: {
+ scope: 'RenderFrame',
+ id_ref: '0x3',
+ pid_ref: 2
+ }
+ });
+ var renderer = model.getOrCreateProcess(2);
+ // Add a toplevel to make the context tree consistent with the spec, though
+ // its functionality is not tested here.
+ var topLevel = renderer.objects.addSnapshot(
+ new tr.model.ScopedId('PlatformThread', '0x2'),
+ 'blink', 'TopLevel', 1234, {});
+ var renderFrame = renderer.objects.addSnapshot(
+ new tr.model.ScopedId('RenderFrame', '0x3'),
+ 'blink', 'RenderFrame', 1357, {
+ parent: {
+ scope: 'PlatformThread',
+ id_ref: '0x2'
+ }
+ });
+ model.joinRefs();
+
+ assert.isTrue(frameTreeNode.crossProcessCounterpart === renderFrame);
+ assert.isTrue(renderFrame.crossProcessCounterpart === frameTreeNode);
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698