Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / shell / browser / shell_screen_unittest.cc
blob691a85fee100e12479ea6d13941289397e2d68a9
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 "extensions/shell/browser/shell_screen.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/aura/test/aura_test_base.h"
10 #include "ui/aura/window.h"
11 #include "ui/aura/window_tree_host.h"
12 #include "ui/gfx/display.h"
13 #include "ui/gfx/geometry/rect.h"
14 #include "ui/gfx/geometry/size.h"
16 namespace extensions {
18 using ShellScreenTest = aura::test::AuraTestBase;
20 // Basic sanity tests for ShellScreen.
21 TEST_F(ShellScreenTest, ShellScreen) {
22 ShellScreen screen(gfx::Size(640, 480));
24 // There is only one display.
25 EXPECT_EQ(1, screen.GetNumDisplays());
26 EXPECT_EQ(1u, screen.GetAllDisplays().size());
27 EXPECT_EQ(0, screen.GetAllDisplays()[0].id());
28 EXPECT_EQ(0, screen.GetPrimaryDisplay().id());
29 EXPECT_EQ("640x480", screen.GetPrimaryDisplay().size().ToString());
31 // Tests that reshaping the host window reshapes the display.
32 // NOTE: AuraTestBase already has its own WindowTreeHost. This is creating a
33 // second one.
34 scoped_ptr<aura::WindowTreeHost> host(screen.CreateHostForPrimaryDisplay());
35 EXPECT_TRUE(host->window());
36 host->window()->SetBounds(gfx::Rect(0, 0, 800, 600));
37 EXPECT_EQ("800x600", screen.GetPrimaryDisplay().size().ToString());
40 } // namespace extensions