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

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

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 7 months 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 | « ui/gfx/monitor.cc ('k') | ui/gfx/screen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "ui/gfx/monitor.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/insets.h"
9
10 namespace {
11
12 TEST(MonitorTest, WorkArea) {
13 gfx::Monitor monitor(0, gfx::Rect(0, 0, 100, 100));
14 EXPECT_EQ("0,0 100x100", monitor.work_area().ToString());
15
16 monitor.set_work_area(gfx::Rect(3, 4, 90, 80));
17 EXPECT_EQ("3,4 90x80", monitor.work_area().ToString());
18
19 monitor.SetBoundsAndUpdateWorkArea(gfx::Rect(10, 20, 50, 50));
20 EXPECT_EQ("13,24 40x30", monitor.work_area().ToString());
21
22 monitor.SetSizeAndUpdateWorkArea(gfx::Size(200, 200));
23 EXPECT_EQ("13,24 190x180", monitor.work_area().ToString());
24
25 monitor.UpdateWorkAreaWithInsets(gfx::Insets(3, 4, 5, 6));
26 EXPECT_EQ("14,23 190x192", monitor.work_area().ToString());
27 }
28
29 }
OLDNEW
« no previous file with comments | « ui/gfx/monitor.cc ('k') | ui/gfx/screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698