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

Side by Side Diff: chrome/browser/metrics/display_utils_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 "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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698