Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: extensions/shell/browser/shell_screen_unittest.cc

Issue 1924133002: Rename gfx::Display/Screen to display::Display/Screen in extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/shell/browser/shell_screen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/shell/browser/shell_screen.h" 5 #include "extensions/shell/browser/shell_screen.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/aura/test/aura_test_base.h" 10 #include "ui/aura/test/aura_test_base.h"
11 #include "ui/aura/window.h" 11 #include "ui/aura/window.h"
12 #include "ui/aura/window_tree_host.h" 12 #include "ui/aura/window_tree_host.h"
13 #include "ui/gfx/display.h" 13 #include "ui/display/display.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/size.h" 15 #include "ui/gfx/geometry/size.h"
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 using ShellScreenTest = aura::test::AuraTestBase; 19 using ShellScreenTest = aura::test::AuraTestBase;
20 20
21 // Basic sanity tests for ShellScreen. 21 // Basic sanity tests for ShellScreen.
22 TEST_F(ShellScreenTest, ShellScreen) { 22 TEST_F(ShellScreenTest, ShellScreen) {
23 ShellScreen screen(gfx::Size(640, 480)); 23 ShellScreen screen(gfx::Size(640, 480));
24 24
25 // There is only one display. 25 // There is only one display.
26 EXPECT_EQ(1, screen.GetNumDisplays()); 26 EXPECT_EQ(1, screen.GetNumDisplays());
27 EXPECT_EQ(1u, screen.GetAllDisplays().size()); 27 EXPECT_EQ(1u, screen.GetAllDisplays().size());
28 EXPECT_EQ(0, screen.GetAllDisplays()[0].id()); 28 EXPECT_EQ(0, screen.GetAllDisplays()[0].id());
29 EXPECT_EQ(0, screen.GetPrimaryDisplay().id()); 29 EXPECT_EQ(0, screen.GetPrimaryDisplay().id());
30 EXPECT_EQ("640x480", screen.GetPrimaryDisplay().size().ToString()); 30 EXPECT_EQ("640x480", screen.GetPrimaryDisplay().size().ToString());
31 31
32 // Tests that reshaping the host window reshapes the display. 32 // Tests that reshaping the host window reshapes the display.
33 // NOTE: AuraTestBase already has its own WindowTreeHost. This is creating a 33 // NOTE: AuraTestBase already has its own WindowTreeHost. This is creating a
34 // second one. 34 // second one.
35 std::unique_ptr<aura::WindowTreeHost> host( 35 std::unique_ptr<aura::WindowTreeHost> host(
36 screen.CreateHostForPrimaryDisplay()); 36 screen.CreateHostForPrimaryDisplay());
37 EXPECT_TRUE(host->window()); 37 EXPECT_TRUE(host->window());
38 host->window()->SetBounds(gfx::Rect(0, 0, 800, 600)); 38 host->window()->SetBounds(gfx::Rect(0, 0, 800, 600));
39 EXPECT_EQ("800x600", screen.GetPrimaryDisplay().size().ToString()); 39 EXPECT_EQ("800x600", screen.GetPrimaryDisplay().size().ToString());
40 } 40 }
41 41
42 } // namespace extensions 42 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_screen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698