chromeos: dbus: add Bluetooth properties support
[chromium-blink-merge.git] / ash / launcher / view_model_unittest.cc
blob089302c0d5384d507649ddb846279ed0a7f96baa
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"
10 namespace ash {
12 TEST(ViewModel, BasicAssertions) {
13 views::View v1;
14 ViewModel model;
15 model.Add(&v1, 0);
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;
26 ViewModel model;
27 model.Add(&v1, 0);
28 model.Add(&v2, 1);
29 model.Add(&v3, 2);
30 model.Move(0, 2);
31 EXPECT_EQ(&v1, model.view_at(2));
32 EXPECT_EQ(&v2, model.view_at(0));
33 EXPECT_EQ(&v3, model.view_at(1));
35 model.Move(2, 0);
36 EXPECT_EQ(&v1, model.view_at(0));
37 EXPECT_EQ(&v2, model.view_at(1));
38 EXPECT_EQ(&v3, model.view_at(2));
41 } // namespace ash