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

Side by Side Diff: ash/utility/screenshot_controller_unittest.cc

Issue 2618143002: cros: Remove some OS platform ifdefs from ash (Closed)
Patch Set: rebase Created 3 years, 11 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 | « ash/touch/touch_observer_hud_unittest.cc ('k') | ash/wm/ash_native_cursor_manager.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/utility/screenshot_controller.h" 5 #include "ash/utility/screenshot_controller.h"
6 6
7 #include "ash/display/cursor_window_controller.h" 7 #include "ash/display/cursor_window_controller.h"
8 #include "ash/display/mouse_cursor_event_filter.h" 8 #include "ash/display/mouse_cursor_event_filter.h"
9 #include "ash/display/window_tree_host_manager.h" 9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/screenshot_delegate.h" 10 #include "ash/screenshot_delegate.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(499, 11))); 268 EXPECT_FALSE(TestIfMouseWarpsAt(gfx::Point(499, 11)));
269 EXPECT_EQ(gfx::Point(499, 11), 269 EXPECT_EQ(gfx::Point(499, 11),
270 aura::Env::GetInstance()->last_mouse_location()); 270 aura::Env::GetInstance()->last_mouse_location());
271 271
272 Cancel(); 272 Cancel();
273 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(499, 11))); 273 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(499, 11)));
274 EXPECT_EQ(gfx::Point(501, 11), 274 EXPECT_EQ(gfx::Point(501, 11),
275 aura::Env::GetInstance()->last_mouse_location()); 275 aura::Env::GetInstance()->last_mouse_location());
276 } 276 }
277 277
278 #if defined(OS_CHROMEOS)
279 TEST_F(PartialScreenshotControllerTest, VisibilityTest) { 278 TEST_F(PartialScreenshotControllerTest, VisibilityTest) {
280 aura::client::CursorClient* client = Shell::GetInstance()->cursor_manager(); 279 aura::client::CursorClient* client = Shell::GetInstance()->cursor_manager();
281 280
282 GetEventGenerator().PressKey(ui::VKEY_A, 0); 281 GetEventGenerator().PressKey(ui::VKEY_A, 0);
283 GetEventGenerator().ReleaseKey(ui::VKEY_A, 0); 282 GetEventGenerator().ReleaseKey(ui::VKEY_A, 0);
284 283
285 EXPECT_FALSE(client->IsCursorVisible()); 284 EXPECT_FALSE(client->IsCursorVisible());
286 285
287 StartPartialScreenshotSession(); 286 StartPartialScreenshotSession();
288 EXPECT_TRUE(IsActive()); 287 EXPECT_TRUE(IsActive());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 event_generator.MoveMouseTo(cursor_location); 326 event_generator.MoveMouseTo(cursor_location);
328 EXPECT_EQ(cursor_location, test_api.GetCursorLocation()); 327 EXPECT_EQ(cursor_location, test_api.GetCursorLocation());
329 328
330 event_generator.ReleaseLeftButton(); 329 event_generator.ReleaseLeftButton();
331 330
332 EXPECT_EQ(1, GetScreenshotDelegate()->handle_take_partial_screenshot_count()); 331 EXPECT_EQ(1, GetScreenshotDelegate()->handle_take_partial_screenshot_count());
333 EXPECT_EQ(gfx::Rect(1, 1, 5, 5), GetScreenshotDelegate()->last_rect()); 332 EXPECT_EQ(gfx::Rect(1, 1, 5, 5), GetScreenshotDelegate()->last_rect());
334 RunAllPendingInMessageLoop(); 333 RunAllPendingInMessageLoop();
335 EXPECT_FALSE(IsActive()); 334 EXPECT_FALSE(IsActive());
336 } 335 }
337 #endif
338 336
339 TEST_F(WindowScreenshotControllerTest, KeyboardOperation) { 337 TEST_F(WindowScreenshotControllerTest, KeyboardOperation) {
340 ui::test::EventGenerator& generator(GetEventGenerator()); 338 ui::test::EventGenerator& generator(GetEventGenerator());
341 test::TestScreenshotDelegate* test_delegate = GetScreenshotDelegate(); 339 test::TestScreenshotDelegate* test_delegate = GetScreenshotDelegate();
342 340
343 StartWindowScreenshotSession(); 341 StartWindowScreenshotSession();
344 generator.PressKey(ui::VKEY_ESCAPE, 0); 342 generator.PressKey(ui::VKEY_ESCAPE, 0);
345 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); 343 generator.ReleaseKey(ui::VKEY_ESCAPE, 0);
346 EXPECT_FALSE(IsActive()); 344 EXPECT_FALSE(IsActive());
347 EXPECT_FALSE(test_delegate->GetSelectedWindowAndReset()); 345 EXPECT_FALSE(test_delegate->GetSelectedWindowAndReset());
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 CreateSelectableWindow(gfx::Rect(100, 100, 100, 100))); 485 CreateSelectableWindow(gfx::Rect(100, 100, 100, 100)));
488 window->SetCapture(); 486 window->SetCapture();
489 EXPECT_TRUE(window->HasCapture()); 487 EXPECT_TRUE(window->HasCapture());
490 StartWindowScreenshotSession(); 488 StartWindowScreenshotSession();
491 EXPECT_TRUE(window->HasCapture()); 489 EXPECT_TRUE(window->HasCapture());
492 Cancel(); 490 Cancel();
493 EXPECT_FALSE(window->HasCapture()); 491 EXPECT_FALSE(window->HasCapture());
494 } 492 }
495 493
496 } // namespace ash 494 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud_unittest.cc ('k') | ash/wm/ash_native_cursor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698