Commit 55dae7df authored by oshima's avatar oshima Committed by Commit bot

Show the cursor if it was hidden when starting partical screenshot.

BUG=485649
TEST=PartialScreenShotTest.VisibilityTest
R=mukai@chromium.org

Review URL: https://codereview.chromium.org/1128933009

Cr-Commit-Position: refs/heads/master@{#330005}
parent 17c3d12d
......@@ -95,9 +95,11 @@ class PartialScreenshotController::ScopedCursorSetter {
gfx::NativeCursor original_cursor = cursor_manager->GetCursor();
cursor_manager_ = cursor_manager;
cursor_manager_->SetCursor(cursor);
if (!cursor_manager_->IsCursorVisible())
cursor_manager_->ShowCursor();
cursor_manager_->LockCursor();
// SetCursor does not make any effects at this point but it sets back to the
// original cursor when unlocked.
// SetCursor does not make any effects at this point but it sets back to
// the original cursor when unlocked.
cursor_manager_->SetCursor(original_cursor);
}
......
......@@ -33,6 +33,8 @@ class PartialScreenshotControllerTest : public test::AshTestBase {
GetScreenshotDelegate());
}
void Cancel() { partial_screenshot_controller()->Cancel(); }
bool IsActive() {
return partial_screenshot_controller()->screenshot_delegate_ != nullptr;
}
......@@ -141,6 +143,22 @@ TEST_F(PartialScreenshotControllerTest, MultipleDisplays) {
}
#if defined(OS_CHROMEOS)
TEST_F(PartialScreenshotControllerTest, VisibilityTest) {
aura::client::CursorClient* client = Shell::GetInstance()->cursor_manager();
GetEventGenerator().PressKey(ui::VKEY_A, 0);
GetEventGenerator().ReleaseKey(ui::VKEY_A, 0);
EXPECT_FALSE(client->IsCursorVisible());
StartPartialScreenshotSession();
EXPECT_TRUE(IsActive());
EXPECT_TRUE(client->IsCursorVisible());
Cancel();
EXPECT_TRUE(client->IsCursorVisible());
}
// Make sure PartialScreenshotController doesn't prevent handling of large
// cursor. See http://crbug.com/459214
TEST_F(PartialScreenshotControllerTest, LargeCursor) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment