Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 169d830e authored by Garfield Tan's avatar Garfield Tan Committed by Automerger Merge Worker
Browse files

Stop loading animation for addtional cursor type. am: e9c61517

Change-Id: I71d61d3a1e79934f7b9ec570c4e8fd4ec819539a
parents 39d9a2fe e9c61517
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -32,8 +32,8 @@ enum TestCursorType {
    CURSOR_TYPE_HOVER,
    CURSOR_TYPE_TOUCH,
    CURSOR_TYPE_ANCHOR,
    CURSOR_TYPE_ADDITIONAL_1,
    CURSOR_TYPE_ADDITIONAL_2,
    CURSOR_TYPE_ADDITIONAL,
    CURSOR_TYPE_ADDITIONAL_ANIM,
    CURSOR_TYPE_CUSTOM = -1,
};

@@ -79,14 +79,19 @@ void MockPointerControllerPolicyInterface::loadAdditionalMouseResources(
    SpriteIcon icon;
    PointerAnimation anim;

    for (int32_t cursorType : {CURSOR_TYPE_ADDITIONAL_1, CURSOR_TYPE_ADDITIONAL_2}) {
    // CURSOR_TYPE_ADDITIONAL doesn't have animation resource.
    int32_t cursorType = CURSOR_TYPE_ADDITIONAL;
    loadPointerIconForType(&icon, cursorType);
    (*outResources)[cursorType] = icon;

    // CURSOR_TYPE_ADDITIONAL_ANIM has animation resource.
    cursorType = CURSOR_TYPE_ADDITIONAL_ANIM;
    loadPointerIconForType(&icon, cursorType);
    anim.animationFrames.push_back(icon);
    anim.durationPerFrame = 10;
    (*outResources)[cursorType] = icon;
    (*outAnimationResources)[cursorType] = anim;
}
}

int32_t MockPointerControllerPolicyInterface::getDefaultPointerIconId() {
    return CURSOR_TYPE_DEFAULT;
@@ -178,7 +183,7 @@ TEST_F(PointerControllerTest, useDefaultCursorTypeByDefault) {
TEST_F(PointerControllerTest, updatePointerIcon) {
    mPointerController->unfade(PointerController::TRANSITION_IMMEDIATE);

    int32_t type = CURSOR_TYPE_ADDITIONAL_1;
    int32_t type = CURSOR_TYPE_ADDITIONAL;
    std::pair<float, float> hotspot = getHotSpotCoordinatesForType(type);
    EXPECT_CALL(*mPointerSprite, setVisible(true));
    EXPECT_CALL(*mPointerSprite, setAlpha(1.0f));