# This file contains a scenario for testing preedit text when a user switches
# the keyboard and moves the carret.

# Enable IME
SEND_KEY	ON

# Following scenario is emulation of http://b/issue?id=5844621.
RESET_CONTEXT

# Switch to 12keys-hiragana keyboard layout.
UPDATE_MOBILE_KEYBOARD	TOGGLE_FLICK_TO_HIRAGANA	SPACE_OR_CONVERT_KEEPING_COMPOSITION
SWITCH_COMPOSITION_MODE	HIRAGANA

# The flick SA-key to the left to input "SHI", which is translated to 'd' key
# in the Java client.
SEND_KEYS	d
EXPECT_PREEDIT	し


# Another scenario.
RESET_CONTEXT

# Set to number keyboard layout.
UPDATE_MOBILE_KEYBOARD	TOGGLE_FLICK_TO_HALFWIDTHASCII	COMMIT
SWITCH_COMPOSITION_MODE	HALF_ASCII

# Type "abc"
SEND_KEYS	abc
EXPECT_PREEDIT	abc

# Switch to 12keys-hiragana keyboard layout.
UPDATE_MOBILE_KEYBOARD	TOGGLE_FLICK_TO_HIRAGANA	SPACE_OR_CONVERT_KEEPING_COMPOSITION
SWITCH_COMPOSITION_MODE	HIRAGANA

# Move the carret between "b" and "c".
SEND_KEY	LEFT

# Then send "い" by toggling
SEND_KEYS	11
EXPECT_PREEDIT	abいc


# Input Hiragana first and then input Latin characters with switched keyboard without commiting candidates.
RESET_CONTEXT

# Switch to flick-hiragana keyboard layout.
UPDATE_MOBILE_KEYBOARD	FLICK_TO_HIRAGANA	SPACE_OR_CONVERT_KEEPING_COMPOSITION
SWITCH_COMPOSITION_MODE	HIRAGANA

SEND_KEYS	87
EXPECT_PREEDIT	やま
EXPECT_IN_ALL_CANDIDATE_WORDS	山

# Switch to qwerty ascii keyboard layout.
UPDATE_MOBILE_KEYBOARD	QWERTY_MOBILE_TO_HALFWIDTHASCII	SPACE_OR_CONVERT_KEEPING_COMPOSITION
SWITCH_COMPOSITION_MODE	HALF_ASCII

# We want to have converted candidatete for "やま" of "やまA"
SEND_KEYS	A
EXPECT_PREEDIT	やまA
EXPECT_IN_ALL_CANDIDATE_WORDS	山A
