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

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

Issue 8391006: aura: Set up the mock compositor to get gfx_unittests green on linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« no previous file with comments | « no previous file | ui/ui_unittests.gypi » ('j') | ui/ui_unittests.gypi » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/gfx/screen.h" 6 #include "ui/gfx/screen.h"
7 7
8 #if defined(USE_AURA)
9 #include "base/message_loop.h"
10 #include "ui/aura/desktop.h"
11 #endif
12
13 namespace { 8 namespace {
14 9
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; 10 typedef testing::Test ScreenTest;
31 #endif
32 11
33 TEST_F(ScreenTest, GetPrimaryMonitorSize) { 12 TEST_F(ScreenTest, GetPrimaryMonitorSize) {
34 // We aren't actually testing that it's correct, just that it's sane. 13 // We aren't actually testing that it's correct, just that it's sane.
35 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); 14 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize();
36 EXPECT_GE(size.width(), 1); 15 EXPECT_GE(size.width(), 1);
37 EXPECT_GE(size.height(), 1); 16 EXPECT_GE(size.height(), 1);
38 } 17 }
39 18
40 TEST_F(ScreenTest, GetNumMonitors) { 19 TEST_F(ScreenTest, GetNumMonitors) {
41 // We aren't actually testing that it's correct, just that it's sane. 20 // We aren't actually testing that it's correct, just that it's sane.
42 EXPECT_GE(gfx::Screen::GetNumMonitors(), 1); 21 EXPECT_GE(gfx::Screen::GetNumMonitors(), 1);
43 } 22 }
44 23
45 } // namespace 24 } // namespace
OLDNEW
« no previous file with comments | « no previous file | ui/ui_unittests.gypi » ('j') | ui/ui_unittests.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698