OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/common/fill_layout_manager.h" | 5 #include "athena/util/fill_layout_manager.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 | 9 |
10 namespace athena { | 10 namespace athena { |
11 | 11 |
12 TEST(FillLayoutManagerTest, ChildWindowSizedCorrectly) { | 12 TEST(FillLayoutManagerTest, ChildWindowSizedCorrectly) { |
13 scoped_ptr<aura::Window> parent(new aura::Window(NULL)); | 13 scoped_ptr<aura::Window> parent(new aura::Window(NULL)); |
14 parent->SetBounds(gfx::Rect(10, 20, 30, 40)); | 14 parent->SetBounds(gfx::Rect(10, 20, 30, 40)); |
15 parent->SetLayoutManager(new FillLayoutManager(parent.get())); | 15 parent->SetLayoutManager(new FillLayoutManager(parent.get())); |
16 | 16 |
17 scoped_ptr<aura::Window> child(new aura::Window(NULL)); | 17 scoped_ptr<aura::Window> child(new aura::Window(NULL)); |
18 child->SetBounds(gfx::Rect(0, 0, 5, 10)); | 18 child->SetBounds(gfx::Rect(0, 0, 5, 10)); |
19 | 19 |
20 EXPECT_NE(child->bounds().size().ToString(), | 20 EXPECT_NE(child->bounds().size().ToString(), |
21 parent->bounds().size().ToString()); | 21 parent->bounds().size().ToString()); |
22 | 22 |
23 parent->AddChild(child.get()); | 23 parent->AddChild(child.get()); |
24 EXPECT_EQ(child->bounds().size().ToString(), | 24 EXPECT_EQ(child->bounds().size().ToString(), |
25 parent->bounds().size().ToString()); | 25 parent->bounds().size().ToString()); |
26 | 26 |
27 parent->SetBounds(gfx::Rect(0, 0, 100, 200)); | 27 parent->SetBounds(gfx::Rect(0, 0, 100, 200)); |
28 EXPECT_EQ(child->bounds().size().ToString(), | 28 EXPECT_EQ(child->bounds().size().ToString(), |
29 parent->bounds().size().ToString()); | 29 parent->bounds().size().ToString()); |
30 } | 30 } |
31 | 31 |
32 } // namespace athena | 32 } // namespace athena |
OLD | NEW |