mirror of
https://github.com/openharmony/arkXtest.git
synced 2026-07-21 08:15:23 -04:00
Signed-off-by: 肖帅 <xiaoshuai6@hisilicon.com>
Changes to be committed: modified: uitest/core/ui_action.h
This commit is contained in:
+17
-17
@@ -176,40 +176,40 @@ namespace OHOS::uitest {
|
||||
/**Generic Combinedkeys actions.*/
|
||||
class CombinedKeys final : public KeyAction {
|
||||
public:
|
||||
CombinedKeys(int32_t code_zero, int32_t code_one, int32_t code_two)
|
||||
: code_zero_(code_zero), code_one_(code_one), code_two_(code_two) {};
|
||||
CombinedKeys(int32_t codeZero, int32_t codeOne, int32_t codeTwo)
|
||||
: codeZero_(codeZero), codeOne_(codeOne), codeTwo_(codeTwo) {};
|
||||
|
||||
void ComputeEvents(std::vector<KeyEvent> &recv, const UiOpArgs &opt) const override
|
||||
{
|
||||
recv.push_back(KeyEvent {ActionStage::DOWN, code_zero_, 0});
|
||||
recv.push_back(KeyEvent {ActionStage::DOWN, code_one_, 0});
|
||||
if (code_two_ != KEYCODE_NONE) {
|
||||
recv.push_back(KeyEvent {ActionStage::DOWN, code_two_, opt.keyHoldMs_});
|
||||
recv.push_back(KeyEvent {ActionStage::DOWN, codeZero_, 0});
|
||||
recv.push_back(KeyEvent {ActionStage::DOWN, codeOne_, 0});
|
||||
if (codeTwo_ != KEYCODE_NONE) {
|
||||
recv.push_back(KeyEvent {ActionStage::DOWN, codeTwo_, opt.keyHoldMs_});
|
||||
} else {
|
||||
recv.at(INDEX_ONE).holdMs_ = opt.keyHoldMs_;
|
||||
}
|
||||
if (code_two_ != KEYCODE_NONE) {
|
||||
recv.push_back(KeyEvent {ActionStage::UP, code_two_, 0});
|
||||
if (codeTwo_ != KEYCODE_NONE) {
|
||||
recv.push_back(KeyEvent {ActionStage::UP, codeTwo_, 0});
|
||||
}
|
||||
recv.push_back(KeyEvent {ActionStage::UP, code_one_, 0});
|
||||
recv.push_back(KeyEvent {ActionStage::UP, code_zero_, 0});
|
||||
recv.push_back(KeyEvent {ActionStage::UP, codeOne_, 0});
|
||||
recv.push_back(KeyEvent {ActionStage::UP, codeZero_, 0});
|
||||
}
|
||||
|
||||
std::string Describe() const override
|
||||
{
|
||||
std::string desc0 = std::string("key_") + std::to_string(code_zero_);
|
||||
std::string desc1 = std::string("key_") + std::to_string(code_one_);
|
||||
if (code_two_ != KEYCODE_NONE) {
|
||||
std::string desc2 = std::string("key_") + std::to_string(code_two_);
|
||||
std::string desc0 = std::string("key_") + std::to_string(codeZero_);
|
||||
std::string desc1 = std::string("key_") + std::to_string(codeOne_);
|
||||
if (codeTwo_ != KEYCODE_NONE) {
|
||||
std::string desc2 = std::string("key_") + std::to_string(codeTwo_);
|
||||
return desc0 + desc1 + desc2;
|
||||
}
|
||||
return desc0 + desc1;
|
||||
}
|
||||
|
||||
private:
|
||||
const int32_t code_zero_;
|
||||
const int32_t code_one_;
|
||||
const int32_t code_two_;
|
||||
const int32_t codeZero_;
|
||||
const int32_t codeOne_;
|
||||
const int32_t codeTwo_;
|
||||
};
|
||||
|
||||
using Back = NamedPlainKey<KEYNAME_BACK, KEYCODE_BACK>;
|
||||
|
||||
Reference in New Issue
Block a user