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

Side by Side Diff: ash/wm/ash_native_cursor_manager_unittest.cc

Issue 621963002: Reland the initial attempt to start building ui_base_unittests targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 6 years, 2 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 | « PRESUBMIT.py ('k') | build/all.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/ash_native_cursor_manager.h" 5 #include "ash/wm/ash_native_cursor_manager.h"
6 6
7 #include "ash/display/display_info.h" 7 #include "ash/display/display_info.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 EXPECT_EQ(2.0f, 177 EXPECT_EQ(2.0f,
178 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 178 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
179 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); 179 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
180 display_manager->SetDisplayUIScale(display_id, 2.0f); 180 display_manager->SetDisplayUIScale(display_id, 2.0f);
181 EXPECT_EQ(1.0f, 181 EXPECT_EQ(1.0f,
182 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 182 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
183 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor()); 183 EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
184 } 184 }
185 185
186 #if defined(USE_X11) 186 #if defined(USE_X11)
187 // This test is in ash_unittests becuase ui_unittests does not include 187 // This test is in ash_unittests because ui_base_unittests does not include
188 // 2x assets. crbug.com/372541. 188 // 2x assets. crbug.com/372541.
189 TEST_F(AshNativeCursorManagerTest, CursorLoaderX11Test) { 189 TEST_F(AshNativeCursorManagerTest, CursorLoaderX11Test) {
190 const int kCursorId = 1; 190 const int kCursorId = 1;
191 ui::CursorLoaderX11 loader; 191 ui::CursorLoaderX11 loader;
192 loader.set_scale(1.0f); 192 loader.set_scale(1.0f);
193 193
194 loader.LoadImageCursor(kCursorId, IDR_AURA_CURSOR_MOVE, gfx::Point()); 194 loader.LoadImageCursor(kCursorId, IDR_AURA_CURSOR_MOVE, gfx::Point());
195 const XcursorImage* image = loader.GetXcursorImageForTest(kCursorId); 195 const XcursorImage* image = loader.GetXcursorImageForTest(kCursorId);
196 int height = image->height; 196 int height = image->height;
197 int width = image->width; 197 int width = image->width;
198 loader.UnloadAll(); 198 loader.UnloadAll();
199 199
200 // Load 2x cursor and make sure its size is 2x of the 1x cusor. 200 // Load 2x cursor and make sure its size is 2x of the 1x cusor.
201 loader.set_scale(2.0f); 201 loader.set_scale(2.0f);
202 loader.LoadImageCursor(kCursorId, IDR_AURA_CURSOR_MOVE, gfx::Point()); 202 loader.LoadImageCursor(kCursorId, IDR_AURA_CURSOR_MOVE, gfx::Point());
203 image = loader.GetXcursorImageForTest(kCursorId); 203 image = loader.GetXcursorImageForTest(kCursorId);
204 EXPECT_EQ(height * 2, static_cast<int>(image->height)); 204 EXPECT_EQ(height * 2, static_cast<int>(image->height));
205 EXPECT_EQ(width * 2, static_cast<int>(image->width)); 205 EXPECT_EQ(width * 2, static_cast<int>(image->width));
206 } 206 }
207 #endif 207 #endif
208 208
209 } // namespace test 209 } // namespace test
210 } // namespace ash 210 } // namespace ash
OLDNEW
« no previous file with comments | « PRESUBMIT.py ('k') | build/all.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698