3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
7 <link rel="import" href="/base/rect.html">
8 <link rel="import" href="/base/quad.html">
9 <link rel="import" href="/base/bbox2.html">
10 <link rel="import" href="/base/ui/quad_stack_view.html">
14 tv.unittest.testSuite(function() {
16 function createQuads() {
18 tv.Quad.fromXYWH(-500, -500, 30, 30), // 4 corners
19 tv.Quad.fromXYWH(-500, 470, 30, 30),
20 tv.Quad.fromXYWH(470, -500, 30, 30),
21 tv.Quad.fromXYWH(470, 470, 30, 30),
22 tv.Quad.fromXYWH(-250, -250, 250, 250), // crosshairs
23 tv.Quad.fromXYWH(0, -250, 250, 250), // crosshairs
24 tv.Quad.fromXYWH(-250, 0, 250, 250), // crosshairs
25 tv.Quad.fromXYWH(0, 0, 250, 250) // crosshairs
27 quads[0].stackingGroupId = 0;
28 quads[1].stackingGroupId = 0;
29 quads[2].stackingGroupId = 0;
30 quads[3].stackingGroupId = 0;
31 quads[4].stackingGroupId = 1;
32 quads[5].stackingGroupId = 1;
33 quads[6].stackingGroupId = 1;
34 quads[7].stackingGroupId = 1;
38 function createQuadStackView(testFramework) {
39 var quads = createQuads();
40 var view = new tv.ui.QuadStackView();
41 // simulate the constraints of the layer-tree-view
42 view.style.height = '400px';
43 view.style.width = '800px';
44 view.deviceRect = tv.Rect.fromXYWH(-250, -250, 500, 500);
47 testFramework.addHTMLOutput(view);
51 test('initialState', function() {
52 var view = createQuadStackView(this);
55 view.getBoundingClientRect();
56 assertEquals(400, viewRect.height);
57 assertEquals(800, viewRect.width);