Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7082)

Unified Diff: chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc

Issue 2710603002: Adds a test for setting empty composition text. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/input_ime_nonchromeos/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc
diff --git a/chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc b/chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc
index 0e205161b29f6a014f26a07c1f4797afec3fef96..43d7fefab0b1482c052b7176c2f8c4bcadf4ca9d 100644
--- a/chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc
+++ b/chrome/browser/ui/views/ime/input_ime_apitest_nonchromeos.cc
@@ -82,8 +82,10 @@ IN_PROC_BROWSER_TEST_F(InputImeApiTest, BasicApiTest) {
ASSERT_TRUE(RunExtensionTest("input_ime_nonchromeos")) << message_;
// Test the input.ime.commitText API.
- ASSERT_EQ(1, client->insert_text_count());
- EXPECT_EQ(base::UTF8ToUTF16("test_commit_text"), client->last_insert_text());
+ const std::vector<base::string16>& insert_text_history =
+ client->insert_text_history();
+ ASSERT_EQ(1UL, insert_text_history.size());
+ EXPECT_EQ(base::UTF8ToUTF16("test_commit_text"), insert_text_history[0]);
// Test the input.ime.setComposition API.
ui::CompositionText composition;
@@ -92,8 +94,12 @@ IN_PROC_BROWSER_TEST_F(InputImeApiTest, BasicApiTest) {
ui::CompositionUnderline(0, composition.text.length(), SK_ColorBLACK,
false /* thick */, SK_ColorTRANSPARENT));
composition.selection = gfx::Range(2, 2);
- ASSERT_EQ(1, client->set_composition_count());
- ASSERT_EQ(composition, client->last_composition());
+ const std::vector<ui::CompositionText>& composition_history =
+ client->composition_history();
+ ASSERT_EQ(2UL, composition_history.size());
+ EXPECT_EQ(base::UTF8ToUTF16("test_set_composition"),
+ composition_history[0].text);
+ EXPECT_EQ(base::UTF8ToUTF16(""), composition_history[1].text);
// Tests input.ime.onBlur API should get event when focusing to another
// text input client.
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/input_ime_nonchromeos/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698