-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui_controls: Add SendKeyEvents API to send key press/release separately
This CL adds ui_controls::SendKeyEvents(). It enables test to send press and release events separately. This will unblock TooltipControllerTest on Lacros. Bug: 1414800 Change-Id: Id56cb604a536308b79293b19341ef6967c9f15c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4240900 Commit-Queue: Eriko Kurimoto <elkurin@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/main@{#1105515}
- Loading branch information
Showing
20 changed files
with
470 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ui/base/test/ui_controls.h" | ||
|
||
namespace ui_controls { | ||
|
||
int GenerateAcceleratorState(bool control, bool shift, bool alt, bool command) { | ||
int accelerator_state = ui_controls::kNoAccelerator; | ||
if (control) { | ||
accelerator_state |= ui_controls::kControl; | ||
} | ||
if (shift) { | ||
accelerator_state |= ui_controls::kShift; | ||
} | ||
if (alt) { | ||
accelerator_state |= ui_controls::kAlt; | ||
} | ||
if (command) { | ||
accelerator_state |= ui_controls::kCommand; | ||
} | ||
|
||
return accelerator_state; | ||
} | ||
|
||
} // namespace ui_controls |
Oops, something went wrong.