Home | History | Annotate | Download | only in util
      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.
      4 
      5 #include "athena/util/fill_layout_manager.h"
      6 
      7 #include "testing/gtest/include/gtest/gtest.h"
      8 #include "ui/aura/window.h"
      9 
     10 namespace athena {
     11 
     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()));
     16 
     17   scoped_ptr<aura::Window> child(new aura::Window(NULL));
     18   child->SetBounds(gfx::Rect(0, 0, 5, 10));
     19 
     20   EXPECT_NE(child->bounds().size().ToString(),
     21             parent->bounds().size().ToString());
     22 
     23   parent->AddChild(child.get());
     24   EXPECT_EQ(child->bounds().size().ToString(),
     25             parent->bounds().size().ToString());
     26 
     27   parent->SetBounds(gfx::Rect(0, 0, 100, 200));
     28   EXPECT_EQ(child->bounds().size().ToString(),
     29             parent->bounds().size().ToString());
     30 }
     31 
     32 }  // namespace athena
     33