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

Side by Side Diff: ui/gfx/screen_unittest.cc

Issue 8382019: Move DisplayUtils methods into gfx::Screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DCHECKS Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h"
6 #include "ui/gfx/screen.h"
7
8 #if defined(USE_AURA)
9 #include "base/message_loop.h"
10 #include "ui/aura/desktop.h"
11 #endif
12
13 namespace {
14
15 #if defined(USE_AURA)
16 class ScreenTest : public testing::Test {
17 public:
18 ScreenTest() {
19 aura::Desktop::GetInstance()->ShowDesktop();
20 }
21
22 virtual ~ScreenTest() {
23 aura::Desktop::GetInstance()->DeleteInstanceForTesting();
24 }
25
26 private:
27 MessageLoopForUI message_loop_;
28 };
29 #else
30 typedef testing::Test ScreenTest;
31 #endif
32
33 TEST_F(ScreenTest, GetPrimaryMonitorSize) {
34 // We aren't actually testing that it's correct, just that it's sane.
35 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize();
36 EXPECT_GE(size.width(), 1);
37 EXPECT_GE(size.height(), 1);
38 }
39
40 TEST_F(ScreenTest, GetNumMonitors) {
41 // We aren't actually testing that it's correct, just that it's sane.
42 EXPECT_GE(gfx::Screen::GetNumMonitors(), 1);
43 }
44
45 } // namespace
OLDNEW
« no previous file with comments | « ui/gfx/screen_mac.mm ('k') | ui/gfx/screen_win.cc » ('j') | ui/ui_unittests.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698