Commit 5da38956 authored by sadrul@chromium.org's avatar sadrul@chromium.org

athena: Add a test for FillLayoutManager.

BUG=403810
R=oshima@chromium.org

Review URL: https://codereview.chromium.org/488093004

Cr-Commit-Position: refs/heads/master@{#291417}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291417 0039d316-1c4b-4281-b951-d872f2087c98
parent 8ba2efc9
......@@ -182,6 +182,7 @@
'sources': [
'test/athena_unittests.cc',
'activity/activity_manager_unittest.cc',
'common/fill_layout_manager_unittest.cc',
'home/home_card_unittest.cc',
'input/accelerator_manager_unittest.cc',
'screen/screen_manager_unittest.cc',
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "athena/common/fill_layout_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/window.h"
namespace athena {
TEST(FillLayoutManagerTest, ChildWindowSizedCorrectly) {
scoped_ptr<aura::Window> parent(new aura::Window(NULL));
parent->SetBounds(gfx::Rect(10, 20, 30, 40));
parent->SetLayoutManager(new FillLayoutManager(parent.get()));
scoped_ptr<aura::Window> child(new aura::Window(NULL));
child->SetBounds(gfx::Rect(0, 0, 5, 10));
EXPECT_NE(child->bounds().size().ToString(),
parent->bounds().size().ToString());
parent->AddChild(child.get());
EXPECT_EQ(child->bounds().size().ToString(),
parent->bounds().size().ToString());
parent->SetBounds(gfx::Rect(0, 0, 100, 200));
EXPECT_EQ(child->bounds().size().ToString(),
parent->bounds().size().ToString());
}
} // namespace athena
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment