# 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 Ta-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	4
EXPECT_PREEDIT	た
SEND_KEYS	4
EXPECT_PREEDIT	ち
SEND_KEYS	4
EXPECT_PREEDIT	つ
SEND_KEYS	4
EXPECT_PREEDIT	て
SEND_KEYS	4
EXPECT_PREEDIT	と
SEND_KEYS	4
EXPECT_PREEDIT	っ
SEND_KEYS	4
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	ち
UNDO_OR_REWIND
EXPECT_PREEDIT	た

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

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	4
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	たた

RESET_CONTEXT
SEND_KEYS	44
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	ちた

RESET_CONTEXT
SEND_KEYS	444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	つた

RESET_CONTEXT
SEND_KEYS	4444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	てた

RESET_CONTEXT
SEND_KEYS	44444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	とた

RESET_CONTEXT
SEND_KEYS	444444
SEND_KEY	RIGHT
SEND_KEYS	4
EXPECT_PREEDIT	った

# Test for Ta-row with voiced mark.
RESET_CONTEXT
SEND_KEYS	4
EXPECT_PREEDIT	た
SEND_KEYS	*
EXPECT_PREEDIT	だ
SEND_KEYS	*
EXPECT_PREEDIT	た
SEND_KEYS	*
EXPECT_PREEDIT	だ
SEND_KEYS	*
EXPECT_PREEDIT	た
SEND_KEYS	4
EXPECT_PREEDIT	たた

RESET_CONTEXT
SEND_KEYS	4*
EXPECT_PREEDIT	だ
SEND_KEYS	4
EXPECT_PREEDIT	だた

RESET_CONTEXT
SEND_KEYS	44
EXPECT_PREEDIT	ち
SEND_KEYS	*
EXPECT_PREEDIT	ぢ
SEND_KEYS	*
EXPECT_PREEDIT	ち
SEND_KEYS	*
EXPECT_PREEDIT	ぢ
SEND_KEYS	*
EXPECT_PREEDIT	ち
SEND_KEYS	4
EXPECT_PREEDIT	ちた

RESET_CONTEXT
SEND_KEYS	44*
EXPECT_PREEDIT	ぢ
SEND_KEYS	4
EXPECT_PREEDIT	ぢた

RESET_CONTEXT
SEND_KEYS	444
EXPECT_PREEDIT	つ
SEND_KEYS	*
EXPECT_PREEDIT	っ
SEND_KEYS	*
EXPECT_PREEDIT	づ
SEND_KEYS	*
EXPECT_PREEDIT	つ
SEND_KEYS	*
EXPECT_PREEDIT	っ
SEND_KEYS	*
EXPECT_PREEDIT	づ
SEND_KEYS	*
EXPECT_PREEDIT	つ
SEND_KEYS	4
EXPECT_PREEDIT	つた

RESET_CONTEXT
SEND_KEYS	444*
EXPECT_PREEDIT	っ
SEND_KEYS	4
EXPECT_PREEDIT	った

RESET_CONTEXT
SEND_KEYS	444**
EXPECT_PREEDIT	づ
SEND_KEYS	4
EXPECT_PREEDIT	づた

RESET_CONTEXT
SEND_KEYS	4444
EXPECT_PREEDIT	て
SEND_KEYS	*
EXPECT_PREEDIT	で
SEND_KEYS	*
EXPECT_PREEDIT	て
SEND_KEYS	*
EXPECT_PREEDIT	で
SEND_KEYS	*
EXPECT_PREEDIT	て
SEND_KEYS	4
EXPECT_PREEDIT	てた

RESET_CONTEXT
SEND_KEYS	4444*
EXPECT_PREEDIT	で
SEND_KEYS	4
EXPECT_PREEDIT	でた

RESET_CONTEXT
SEND_KEYS	44444
EXPECT_PREEDIT	と
SEND_KEYS	*
EXPECT_PREEDIT	ど
SEND_KEYS	*
EXPECT_PREEDIT	と
SEND_KEYS	*
EXPECT_PREEDIT	ど
SEND_KEYS	*
EXPECT_PREEDIT	と
SEND_KEYS	4
EXPECT_PREEDIT	とた

RESET_CONTEXT
SEND_KEYS	44444*
EXPECT_PREEDIT	ど
SEND_KEYS	4
EXPECT_PREEDIT	どた
