| OLD | NEW |
| (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 |
| OLD | NEW |