# 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 Ka-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	2
EXPECT_PREEDIT	か
SEND_KEYS	2
EXPECT_PREEDIT	き
SEND_KEYS	2
EXPECT_PREEDIT	く
SEND_KEYS	2
EXPECT_PREEDIT	け
SEND_KEYS	2
EXPECT_PREEDIT	こ
SEND_KEYS	2
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 '2' toggles the last character, not adding a new character.
SEND_KEYS	2
EXPECT_PREEDIT	き

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	2
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	かか

RESET_CONTEXT
SEND_KEYS	22
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	きか

RESET_CONTEXT
SEND_KEYS	222
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	くか

RESET_CONTEXT
SEND_KEYS	2222
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	けか

RESET_CONTEXT
SEND_KEYS	22222
SEND_KEY	RIGHT
SEND_KEYS	2
EXPECT_PREEDIT	こか

# Test for Ka-row with voiced mark.
RESET_CONTEXT
SEND_KEYS	2
EXPECT_PREEDIT	か
SEND_KEYS	*
EXPECT_PREEDIT	が
SEND_KEYS	*
EXPECT_PREEDIT	か
SEND_KEYS	*
EXPECT_PREEDIT	が
SEND_KEYS	*
EXPECT_PREEDIT	か
SEND_KEYS	2
EXPECT_PREEDIT	かか

RESET_CONTEXT
SEND_KEYS	2*
EXPECT_PREEDIT	が
SEND_KEYS	2
EXPECT_PREEDIT	がか

RESET_CONTEXT
SEND_KEYS	22
EXPECT_PREEDIT	き
SEND_KEYS	*
EXPECT_PREEDIT	ぎ
SEND_KEYS	*
EXPECT_PREEDIT	き
SEND_KEYS	*
EXPECT_PREEDIT	ぎ
SEND_KEYS	*
EXPECT_PREEDIT	き
SEND_KEYS	2
EXPECT_PREEDIT	きか

RESET_CONTEXT
SEND_KEYS	22*
EXPECT_PREEDIT	ぎ
SEND_KEYS	2
EXPECT_PREEDIT	ぎか

RESET_CONTEXT
SEND_KEYS	222
EXPECT_PREEDIT	く
SEND_KEYS	*
EXPECT_PREEDIT	ぐ
SEND_KEYS	*
EXPECT_PREEDIT	く
SEND_KEYS	*
EXPECT_PREEDIT	ぐ
SEND_KEYS	*
EXPECT_PREEDIT	く
SEND_KEYS	2
EXPECT_PREEDIT	くか

RESET_CONTEXT
SEND_KEYS	222*
EXPECT_PREEDIT	ぐ
SEND_KEYS	2
EXPECT_PREEDIT	ぐか

RESET_CONTEXT
SEND_KEYS	2222
EXPECT_PREEDIT	け
SEND_KEYS	*
EXPECT_PREEDIT	げ
SEND_KEYS	*
EXPECT_PREEDIT	け
SEND_KEYS	*
EXPECT_PREEDIT	げ
SEND_KEYS	*
EXPECT_PREEDIT	け
SEND_KEYS	2
EXPECT_PREEDIT	けか

RESET_CONTEXT
SEND_KEYS	2222*
EXPECT_PREEDIT	げ
SEND_KEYS	2
EXPECT_PREEDIT	げか

RESET_CONTEXT
SEND_KEYS	22222
EXPECT_PREEDIT	こ
SEND_KEYS	*
EXPECT_PREEDIT	ご
SEND_KEYS	*
EXPECT_PREEDIT	こ
SEND_KEYS	*
EXPECT_PREEDIT	ご
SEND_KEYS	*
EXPECT_PREEDIT	こ
SEND_KEYS	2
EXPECT_PREEDIT	こか

RESET_CONTEXT
SEND_KEYS	22222*
EXPECT_PREEDIT	ご
SEND_KEYS	2
EXPECT_PREEDIT	ごか
