# 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_COMPOSITION_MODE	HIRAGANA

# Simple toggling on Na-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	5
EXPECT_PREEDIT	な
SEND_KEYS	5
EXPECT_PREEDIT	に
SEND_KEYS	5
EXPECT_PREEDIT	ぬ
SEND_KEYS	5
EXPECT_PREEDIT	ね
SEND_KEYS	5
EXPECT_PREEDIT	の
SEND_KEYS	5
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 '5' toggles the last character, not adding a new character.
SEND_KEYS	5
EXPECT_PREEDIT	に

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	5
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	なな

RESET_CONTEXT
SEND_KEYS	55
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	にな

RESET_CONTEXT
SEND_KEYS	555
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	ぬな

RESET_CONTEXT
SEND_KEYS	5555
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	ねな

RESET_CONTEXT
SEND_KEYS	55555
SEND_KEY	RIGHT
SEND_KEYS	5
EXPECT_PREEDIT	のな
