# 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 A-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	1
EXPECT_PREEDIT	あ
SEND_KEYS	1
EXPECT_PREEDIT	い
SEND_KEYS	1
EXPECT_PREEDIT	う
SEND_KEYS	1
EXPECT_PREEDIT	え
SEND_KEYS	1
EXPECT_PREEDIT	お
SEND_KEYS	1
EXPECT_PREEDIT	ぁ
SEND_KEYS	1
EXPECT_PREEDIT	ぃ
SEND_KEYS	1
EXPECT_PREEDIT	ぅ
SEND_KEYS	1
EXPECT_PREEDIT	ぇ
SEND_KEYS	1
EXPECT_PREEDIT	ぉ
SEND_KEYS	1
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	お
UNDO_OR_REWIND
EXPECT_PREEDIT	え
UNDO_OR_REWIND
EXPECT_PREEDIT	う
UNDO_OR_REWIND
EXPECT_PREEDIT	い
UNDO_OR_REWIND
EXPECT_PREEDIT	あ

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

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	1
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ああ

RESET_CONTEXT
SEND_KEYS	11
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	いあ

RESET_CONTEXT
SEND_KEYS	111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	うあ

RESET_CONTEXT
SEND_KEYS	1111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	えあ

RESET_CONTEXT
SEND_KEYS	11111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	おあ

RESET_CONTEXT
SEND_KEYS	111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぁあ

RESET_CONTEXT
SEND_KEYS	1111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぃあ

RESET_CONTEXT
SEND_KEYS	11111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぅあ

RESET_CONTEXT
SEND_KEYS	111111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぇあ

RESET_CONTEXT
SEND_KEYS	1111111111
SEND_KEY	RIGHT
SEND_KEYS	1
EXPECT_PREEDIT	ぉあ

# Test for A-row small characters
RESET_CONTEXT
SEND_KEYS	1
EXPECT_PREEDIT	あ
SEND_KEYS	*
EXPECT_PREEDIT	ぁ
SEND_KEYS	*
EXPECT_PREEDIT	あ
SEND_KEYS	*
EXPECT_PREEDIT	ぁ
SEND_KEYS	*
EXPECT_PREEDIT	あ
SEND_KEYS	1
EXPECT_PREEDIT	ああ

RESET_CONTEXT
SEND_KEYS	1*
EXPECT_PREEDIT	ぁ
SEND_KEYS	1
EXPECT_PREEDIT	ぁあ

RESET_CONTEXT
SEND_KEYS	11
EXPECT_PREEDIT	い
SEND_KEYS	*
EXPECT_PREEDIT	ぃ
SEND_KEYS	*
EXPECT_PREEDIT	い
SEND_KEYS	*
EXPECT_PREEDIT	ぃ
SEND_KEYS	*
EXPECT_PREEDIT	い
SEND_KEYS	1
EXPECT_PREEDIT	いあ

RESET_CONTEXT
SEND_KEYS	11*
EXPECT_PREEDIT	ぃ
SEND_KEYS	1
EXPECT_PREEDIT	ぃあ

RESET_CONTEXT
SEND_KEYS	111
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	1
EXPECT_PREEDIT	うあ

RESET_CONTEXT
SEND_KEYS	111*
EXPECT_PREEDIT	ぅ
SEND_KEYS	1
EXPECT_PREEDIT	ぅあ

RESET_CONTEXT
SEND_KEYS	111**
EXPECT_PREEDIT	ゔ
SEND_KEYS	1
EXPECT_PREEDIT	ゔあ

RESET_CONTEXT
SEND_KEYS	1111
EXPECT_PREEDIT	え
SEND_KEYS	*
EXPECT_PREEDIT	ぇ
SEND_KEYS	*
EXPECT_PREEDIT	え
SEND_KEYS	*
EXPECT_PREEDIT	ぇ
SEND_KEYS	*
EXPECT_PREEDIT	え
SEND_KEYS	1
EXPECT_PREEDIT	えあ

RESET_CONTEXT
SEND_KEYS	1111*
EXPECT_PREEDIT	ぇ
SEND_KEYS	1
EXPECT_PREEDIT	ぇあ

RESET_CONTEXT
SEND_KEYS	11111
EXPECT_PREEDIT	お
SEND_KEYS	*
EXPECT_PREEDIT	ぉ
SEND_KEYS	*
EXPECT_PREEDIT	お
SEND_KEYS	*
EXPECT_PREEDIT	ぉ
SEND_KEYS	*
EXPECT_PREEDIT	お
SEND_KEYS	1
EXPECT_PREEDIT	おあ

RESET_CONTEXT
SEND_KEYS	11111*
EXPECT_PREEDIT	ぉ
SEND_KEYS	1
EXPECT_PREEDIT	ぉあ
