# 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 Ra-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	9
EXPECT_PREEDIT	ら
SEND_KEYS	9
EXPECT_PREEDIT	り
SEND_KEYS	9
EXPECT_PREEDIT	る
SEND_KEYS	9
EXPECT_PREEDIT	れ
SEND_KEYS	9
EXPECT_PREEDIT	ろ
SEND_KEYS	9
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 '9' toggles the last character, not adding a new character.
SEND_KEYS	9
EXPECT_PREEDIT	り

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	9
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	らら

RESET_CONTEXT
SEND_KEYS	99
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	りら

RESET_CONTEXT
SEND_KEYS	999
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	るら

RESET_CONTEXT
SEND_KEYS	9999
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	れら

RESET_CONTEXT
SEND_KEYS	99999
SEND_KEY	RIGHT
SEND_KEYS	9
EXPECT_PREEDIT	ろら
