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

Side by Side Diff: Source/platform/WebScreenInfoTest.cpp

Issue 1100503003: Add operator== to WebScreenInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add testS Created 5 years, 8 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
« no previous file with comments | « no previous file | Source/platform/blink_platform.gypi » ('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 2015 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 "config.h"
6 #include "public/platform/WebScreenInfo.h"
7
8 #include <gtest/gtest.h>
9
10 namespace blink {
11
12 TEST(WebScreenInfoTest, Equality)
13 {
14 WebScreenInfo screenInfo1;
15 WebScreenInfo screenInfo2;
16
17 EXPECT_EQ(screenInfo1, screenInfo2);
18
19 // Change same values in screenInfo1.
20 screenInfo1.deviceScaleFactor = 10.f;
21 screenInfo1.depth = 3;
22 screenInfo1.depthPerComponent = 2;
23 screenInfo1.isMonochrome = false;
24
25 EXPECT_NE(screenInfo1, screenInfo2);
26
27 // Set the same values to screenInfo2, they should be equal now.
28 screenInfo2.deviceScaleFactor = 10.f;
29 screenInfo2.depth = 3;
30 screenInfo2.depthPerComponent = 2;
31 screenInfo2.isMonochrome = false;
32
33 EXPECT_EQ(screenInfo1, screenInfo2);
34
35 // Set all the known members.
36 screenInfo1.deviceScaleFactor = 2.f;
37 screenInfo1.depth = 1;
38 screenInfo1.depthPerComponent = 1;
39 screenInfo1.isMonochrome = false;
40 screenInfo1.rect = WebRect(0, 0, 1024, 1024);
41 screenInfo1.availableRect = WebRect(0, 0, 1024, 1024);
42 screenInfo1.orientationType = blink::WebScreenOrientationLandscapePrimary;
43 screenInfo1.orientationAngle = 90;
44
45 EXPECT_NE(screenInfo1, screenInfo2);
46
47 screenInfo2.deviceScaleFactor = 2.f;
48 screenInfo2.depth = 1;
49 screenInfo2.depthPerComponent = 1;
50 screenInfo2.isMonochrome = false;
51 screenInfo2.rect = WebRect(0, 0, 1024, 1024);
52 screenInfo2.availableRect = WebRect(0, 0, 1024, 1024);
53 screenInfo2.orientationType = blink::WebScreenOrientationLandscapePrimary;
54 screenInfo2.orientationAngle = 90;
55
56 EXPECT_EQ(screenInfo1, screenInfo2);
57 }
58
59 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698