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
3 // found in the LICENSE file.
5 #include "athena/common/fill_layout_manager.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/aura/window.h"
12 TEST(FillLayoutManagerTest
, ChildWindowSizedCorrectly
) {
13 scoped_ptr
<aura::Window
> parent(new aura::Window(NULL
));
14 parent
->SetBounds(gfx::Rect(10, 20, 30, 40));
15 parent
->SetLayoutManager(new FillLayoutManager(parent
.get()));
17 scoped_ptr
<aura::Window
> child(new aura::Window(NULL
));
18 child
->SetBounds(gfx::Rect(0, 0, 5, 10));
20 EXPECT_NE(child
->bounds().size().ToString(),
21 parent
->bounds().size().ToString());
23 parent
->AddChild(child
.get());
24 EXPECT_EQ(child
->bounds().size().ToString(),
25 parent
->bounds().size().ToString());
27 parent
->SetBounds(gfx::Rect(0, 0, 100, 200));
28 EXPECT_EQ(child
->bounds().size().ToString(),
29 parent
->bounds().size().ToString());