| 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 "base/message_loop.h" | |
| 6 #include "chrome/browser/metrics/display_utils.h" | |
| 7 #include "content/browser/browser_thread.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | |
| 10 // Crashes on Linux Aura, probably because we need to initialize a Screen | |
| 11 // object. See http://crbug.com/100341 | |
| 12 #if defined(USE_AURA) && !defined(OS_WIN) | |
| 13 #define MAYBE_GetPrimaryDisplayDimensions DISABLED_GetPrimaryDisplayDimensions | |
| 14 #else | |
| 15 #define MAYBE_GetPrimaryDisplayDimensions GetPrimaryDisplayDimensions | |
| 16 #endif | |
| 17 TEST(DisplayUtilsTest, MAYBE_GetPrimaryDisplayDimensions) { | |
| 18 MessageLoop message_loop; | |
| 19 BrowserThread ui_thread(BrowserThread::UI, &message_loop); | |
| 20 int width = 0, height = 0; | |
| 21 // We aren't actually testing that it's correct, just that it's sane. | |
| 22 DisplayUtils::GetPrimaryDisplayDimensions(&width, &height); | |
| 23 EXPECT_GE(width, 10); | |
| 24 EXPECT_GE(height, 10); | |
| 25 } | |
| 26 | |
| 27 TEST(DisplayUtilsTest, GetDisplayCount) { | |
| 28 MessageLoop message_loop; | |
| 29 BrowserThread ui_thread(BrowserThread::UI, &message_loop); | |
| 30 // We aren't actually testing that it's correct, just that it's sane. | |
| 31 EXPECT_GE(DisplayUtils::GetDisplayCount(), 1); | |
| 32 } | |
| OLD | NEW |