OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/launcher/view_model.h" | 5 #include "ash/launcher/view_model.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 | 9 |
10 namespace aura_shell { | 10 namespace ash { |
11 | 11 |
12 TEST(ViewModel, BasicAssertions) { | 12 TEST(ViewModel, BasicAssertions) { |
13 views::View v1; | 13 views::View v1; |
14 ViewModel model; | 14 ViewModel model; |
15 model.Add(&v1, 0); | 15 model.Add(&v1, 0); |
16 EXPECT_EQ(1, model.view_size()); | 16 EXPECT_EQ(1, model.view_size()); |
17 EXPECT_EQ(&v1, model.view_at(0)); | 17 EXPECT_EQ(&v1, model.view_at(0)); |
18 gfx::Rect v1_bounds(1, 2, 3, 4); | 18 gfx::Rect v1_bounds(1, 2, 3, 4); |
19 model.set_ideal_bounds(0, v1_bounds); | 19 model.set_ideal_bounds(0, v1_bounds); |
20 EXPECT_EQ(v1_bounds, model.ideal_bounds(0)); | 20 EXPECT_EQ(v1_bounds, model.ideal_bounds(0)); |
(...skipping 10 matching lines...) Expand all Loading... |
31 EXPECT_EQ(&v1, model.view_at(2)); | 31 EXPECT_EQ(&v1, model.view_at(2)); |
32 EXPECT_EQ(&v2, model.view_at(0)); | 32 EXPECT_EQ(&v2, model.view_at(0)); |
33 EXPECT_EQ(&v3, model.view_at(1)); | 33 EXPECT_EQ(&v3, model.view_at(1)); |
34 | 34 |
35 model.Move(2, 0); | 35 model.Move(2, 0); |
36 EXPECT_EQ(&v1, model.view_at(0)); | 36 EXPECT_EQ(&v1, model.view_at(0)); |
37 EXPECT_EQ(&v2, model.view_at(1)); | 37 EXPECT_EQ(&v2, model.view_at(1)); |
38 EXPECT_EQ(&v3, model.view_at(2)); | 38 EXPECT_EQ(&v3, model.view_at(2)); |
39 } | 39 } |
40 | 40 |
41 } // namespace aura_shell | 41 } // namespace ash |
OLD | NEW |