# This file contains a scenario for testing preedit text when a user uses
# 12-key toggle key layout on mobile.

# Enable IME
SEND_KEY	ON

SET_MOBILE_REQUEST
UPDATE_MOBILE_KEYBOARD	TWELVE_KEYS_TO_HIRAGANA	SPACE_OR_CONVERT_KEEPING_COMPOSITION
SWITCH_INPUT_MODE	HIRAGANA

# Simple toggling on Ma-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	7
EXPECT_PREEDIT	ま
SEND_KEYS	7
EXPECT_PREEDIT	み
SEND_KEYS	7
EXPECT_PREEDIT	む
SEND_KEYS	7
EXPECT_PREEDIT	め
SEND_KEYS	7
EXPECT_PREEDIT	も
SEND_KEYS	7
EXPECT_PREEDIT	ま

# Then reverse order.
UNDO_OR_REWIND
EXPECT_PREEDIT	も
UNDO_OR_REWIND
EXPECT_PREEDIT	め
UNDO_OR_REWIND
EXPECT_PREEDIT	む
UNDO_OR_REWIND
EXPECT_PREEDIT	み
UNDO_OR_REWIND
EXPECT_PREEDIT	ま

# Make sure tapping '7' toggles the last character, not adding a new character.
SEND_KEYS	7
EXPECT_PREEDIT	み

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	7
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	まま

RESET_CONTEXT
SEND_KEYS	77
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	みま

RESET_CONTEXT
SEND_KEYS	777
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	むま

RESET_CONTEXT
SEND_KEYS	7777
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	めま

RESET_CONTEXT
SEND_KEYS	77777
SEND_KEY	RIGHT
SEND_KEYS	7
EXPECT_PREEDIT	もま
