1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/launcher/view_model.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/views/view.h"
12 TEST(ViewModel
, BasicAssertions
) {
16 EXPECT_EQ(1, model
.view_size());
17 EXPECT_EQ(&v1
, model
.view_at(0));
18 gfx::Rect
v1_bounds(1, 2, 3, 4);
19 model
.set_ideal_bounds(0, v1_bounds
);
20 EXPECT_EQ(v1_bounds
, model
.ideal_bounds(0));
21 EXPECT_EQ(0, model
.GetIndexOfView(&v1
));
24 TEST(ViewModel
, Move
) {
25 views::View v1
, v2
, v3
;
31 EXPECT_EQ(&v1
, model
.view_at(2));
32 EXPECT_EQ(&v2
, model
.view_at(0));
33 EXPECT_EQ(&v3
, model
.view_at(1));
36 EXPECT_EQ(&v1
, model
.view_at(0));
37 EXPECT_EQ(&v2
, model
.view_at(1));
38 EXPECT_EQ(&v3
, model
.view_at(2));