blob: e622b05bc9da1571e75c919a3f6818490cc05520 [file] [log] [blame]
<!DOCTYPE html>
Copyright (c) 2013 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/layer_tree_quad_stack_view.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>
'use strict';
tr.b.unittest.testSuite(function() {
test('tileCoverageRectCount', function() {
var m = new tr.Model(g_catLTHIEvents);
var p = m.processes[1];
var instance = p.objects.getAllInstancesNamed('cc::LayerTreeHostImpl')[0];
var lthi = instance.snapshots[0];
var numLayers = lthi.activeTree.renderSurfaceLayerList.length;
var layer = lthi.activeTree.renderSurfaceLayerList[numLayers - 1];
var view = new;
view.layerTreeImpl = lthi.activeTree;
view.selection = new;
view.howToShowTiles = 'none';
view.showInvalidations = false;
view.showContents = false;
view.showOtherLAyers = false;
// There should be some quads drawn with all "show" checkboxes off,
// but that number can change with new features added.
var aQuads = view.generateLayerQuads();
view.howToShowTiles = 'coverage';
var bQuads = view.generateLayerQuads();
var numCoverageRects = bQuads.length - aQuads.length;
// We know we have 5 coverage rects in lthi cats.
assert.equal(numCoverageRects, 5);