SET_CONFIG	session_keymap	MSIME
SET_CONFIG	use_cascading_window	false

# F10 rotates the candidate to ASIS → UPPER → LOWER → CAPITALIZED
# e.g. moZc → mozc → MOZC → Mozc → moZc
RESET_CONTEXT
SEND_KEYS	moZc
EXPECT_PREEDIT	もZc
# To ASIS
SEND_KEY	F10
EXPECT_PREEDIT	moZc
# To UPPER
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
# To LOWER
SEND_KEY	F10
EXPECT_PREEDIT	mozc
# To CAPITALIZED
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
# To ASIS again
SEND_KEY	F10
EXPECT_PREEDIT	moZc
# To UPPER again
SEND_KEY	F10
EXPECT_PREEDIT	MOZC


# If ASIS is the same as LOWER, LOWER is skipped
# e.g. mozc → MOZC → Mozc → mozc
RESET_CONTEXT
SEND_KEYS	mozc
EXPECT_PREEDIT	もｚｃ
# To ASIS (it's also LOWER)
SEND_KEY	F10
EXPECT_PREEDIT	mozc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
# LOWER is skipped and converted to CAPITALIZED since it's the same as ASIS
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
SEND_KEY	F10
EXPECT_PREEDIT	mozc


# If ASIS is the same as UPPER, UPPER is skipped
# e.g. MOZC → mozc → Mozc → MOZC
RESET_CONTEXT
SEND_KEYS	MOZC
EXPECT_PREEDIT	MOZC
# To ASIS (it's also UPPER)
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
# UPPER is skipped and converted to LOWER since it's the same as ASIS
SEND_KEY	F10
EXPECT_PREEDIT	mozc
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC


# If ASIS is the same as CAPITALIZED, CAPITALIZED is skipped
# e.g. Mozc → MOZC → mozc → Mozc
RESET_CONTEXT
SEND_KEYS	Mozc
EXPECT_PREEDIT	Mozc
# To ASIS (it's also CAPITALIZED)
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
SEND_KEY	F10
EXPECT_PREEDIT	mozc
# CAPITALIZED is skipped and converted to ASIS, but it's the same as CAPITALIZED
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC

# ASIS is also UPPER and CAPITALIZED.
# e.g. M → m → M → m
RESET_CONTEXT
SEND_KEYS	M
EXPECT_PREEDIT	M
SEND_KEY	F10
EXPECT_PREEDIT	M
SEND_KEY	F10
EXPECT_PREEDIT	m
SEND_KEY	F10
EXPECT_PREEDIT	M
SEND_KEY	F10
EXPECT_PREEDIT	m

# ASIS is also LOWER, and UPPER is also CAPITALIZED.
# e.g. m → M → m → M
RESET_CONTEXT
SEND_KEYS	m
EXPECT_PREEDIT	ｍ
SEND_KEY	F10
EXPECT_PREEDIT	m
SEND_KEY	F10
EXPECT_PREEDIT	M
SEND_KEY	F10
EXPECT_PREEDIT	m
SEND_KEY	F10
EXPECT_PREEDIT	M


# Check the behavior with user input history.
# The behavior should not be affected by the user input history.
# https://github.com/google/mozc/issues/1280
RESET_CONTEXT
SEND_KEYS	mozc
EXPECT_PREEDIT	もｚｃ
SEND_KEY	F10
EXPECT_PREEDIT	mozc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
# Record the user input history.
SEND_KEY	ENTER

# Transliterations with the user input history.
SEND_KEYS	mozc
EXPECT_PREEDIT	もｚｃ
SEND_KEY	F10
EXPECT_PREEDIT	mozc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
SEND_KEY	F10
EXPECT_PREEDIT	mozc


# Check the behavior with user input history (case 2).
RESET_CONTEXT

SEND_KEYS	moZc
EXPECT_PREEDIT	もZc
SEND_KEY	F10
EXPECT_PREEDIT	moZc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
# Record the user input history.
SEND_KEY	ENTER

# Transliterations with the user input history.
SEND_KEYS	moZc
EXPECT_PREEDIT	もZc
SEND_KEY	F10
EXPECT_PREEDIT	moZc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
SEND_KEY	F10
EXPECT_PREEDIT	mozc
SEND_KEY	F10
EXPECT_PREEDIT	Mozc
SEND_KEY	F10
EXPECT_PREEDIT	moZc
SEND_KEY	F10
EXPECT_PREEDIT	MOZC
