# 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 Wa-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	0
EXPECT_PREEDIT	わ
SEND_KEYS	0
EXPECT_PREEDIT	を
SEND_KEYS	0
EXPECT_PREEDIT	ん
SEND_KEYS	0
EXPECT_PREEDIT	ゎ
SEND_KEYS	0
EXPECT_PREEDIT	ー
SEND_KEYS	0
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 '0' toggles the last character, not adding a new character.
SEND_KEYS	0
EXPECT_PREEDIT	を

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	0
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	わわ

RESET_CONTEXT
SEND_KEYS	00
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	をわ

RESET_CONTEXT
SEND_KEYS	000
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	んわ

RESET_CONTEXT
SEND_KEYS	0000
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	ゎわ

RESET_CONTEXT
SEND_KEYS	00000
SEND_KEY	RIGHT
SEND_KEYS	0
EXPECT_PREEDIT	ーわ

# Test for a-row small characters
RESET_CONTEXT
SEND_KEYS	0
EXPECT_PREEDIT	わ
SEND_KEYS	*
EXPECT_PREEDIT	ゎ
SEND_KEYS	*
EXPECT_PREEDIT	わ
SEND_KEYS	*
EXPECT_PREEDIT	ゎ
SEND_KEYS	*
EXPECT_PREEDIT	わ
SEND_KEYS	0
EXPECT_PREEDIT	わわ

RESET_CONTEXT
SEND_KEYS	0*
EXPECT_PREEDIT	ゎ
SEND_KEYS	0
EXPECT_PREEDIT	ゎわ
