| <!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="/extras/chrome/cc/cc.html"> |
| <link rel="import" href="/extras/chrome/cc/display_item_list.html"> |
| <link rel="import" href="/extras/importer/trace_event_importer.html"> |
| <link rel="import" href="/model/model.html"> |
| |
| <script src="/extras/chrome/cc/layer_tree_host_impl_test_data.js"></script> |
| |
| <script> |
| 'use strict'; |
| |
| tr.b.unittest.testSuite(function() { |
| test('basic', function() { |
| var m = new tr.Model(g_catLTHIEvents); |
| var p = tr.b.dictionaryValues(m.processes)[0]; |
| |
| var instance = p.objects.getAllInstancesNamed('cc::DisplayItemList')[0]; |
| var snapshot = instance.snapshots[0]; |
| |
| assert.instanceOf(snapshot, tr.e.cc.DisplayItemListSnapshot); |
| instance.wasDeleted(150); |
| }); |
| |
| test('getItems', function() { |
| var m = new tr.Model(g_catLTHIEvents); |
| var p = tr.b.dictionaryValues(m.processes)[0]; |
| |
| var instance = p.objects.getAllInstancesNamed('cc::DisplayItemList')[0]; |
| var snapshot = instance.snapshots[0]; |
| |
| var items = snapshot.items; |
| assert.equal(items.length, 2); |
| |
| assert.equal(items[0], 'BeginClipDisplayItem'); |
| assert.equal(items[1], 'EndClipDisplayItem'); |
| }); |
| }); |
| </script> |