# This file contains a scenario for testing preedit text when a user uses
# 12-key toggle flick key layout on mobile.

# Enable IME
SEND_KEY	ON

SET_MOBILE_REQUEST
SWITCH_COMPOSITION_MODE	HIRAGANA

# Simple toggling on Ya-row. First, in the forward order.
RESET_CONTEXT
SEND_KEYS	8
EXPECT_PREEDIT	や
SEND_KEYS	8
EXPECT_PREEDIT	ゆ
SEND_KEYS	8
EXPECT_PREEDIT	よ
SEND_KEYS	8
EXPECT_PREEDIT	ゃ
SEND_KEYS	8
EXPECT_PREEDIT	ゅ
SEND_KEYS	8
EXPECT_PREEDIT	ょ
SEND_KEYS	8
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	や

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

# Test with RIGHT key.
RESET_CONTEXT
SEND_KEYS	8
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	やや

RESET_CONTEXT
SEND_KEYS	88
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ゆや

RESET_CONTEXT
SEND_KEYS	888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	よや

RESET_CONTEXT
SEND_KEYS	8888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ゃや

RESET_CONTEXT
SEND_KEYS	88888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ゅや

RESET_CONTEXT
SEND_KEYS	888888
SEND_KEY	RIGHT
SEND_KEYS	8
EXPECT_PREEDIT	ょや

# Test for Ya-row small characters
RESET_CONTEXT
SEND_KEYS	8
EXPECT_PREEDIT	や
SEND_KEYS	*
EXPECT_PREEDIT	ゃ
SEND_KEYS	*
EXPECT_PREEDIT	や
SEND_KEYS	*
EXPECT_PREEDIT	ゃ
SEND_KEYS	*
EXPECT_PREEDIT	や
SEND_KEYS	8
EXPECT_PREEDIT	やや

RESET_CONTEXT
SEND_KEYS	8*
EXPECT_PREEDIT	ゃ
SEND_KEYS	8
EXPECT_PREEDIT	ゃや

RESET_CONTEXT
SEND_KEYS	88
EXPECT_PREEDIT	ゆ
SEND_KEYS	*
EXPECT_PREEDIT	ゅ
SEND_KEYS	*
EXPECT_PREEDIT	ゆ
SEND_KEYS	*
EXPECT_PREEDIT	ゅ
SEND_KEYS	*
EXPECT_PREEDIT	ゆ
SEND_KEYS	8
EXPECT_PREEDIT	ゆや

RESET_CONTEXT
SEND_KEYS	88*
EXPECT_PREEDIT	ゅ
SEND_KEYS	8
EXPECT_PREEDIT	ゅや

RESET_CONTEXT
SEND_KEYS	888
EXPECT_PREEDIT	よ
SEND_KEYS	*
EXPECT_PREEDIT	ょ
SEND_KEYS	*
EXPECT_PREEDIT	よ
SEND_KEYS	*
EXPECT_PREEDIT	ょ
SEND_KEYS	*
EXPECT_PREEDIT	よ
SEND_KEYS	8
EXPECT_PREEDIT	よや

RESET_CONTEXT
SEND_KEYS	888*
EXPECT_PREEDIT	ょ
SEND_KEYS	8
EXPECT_PREEDIT	ょや
