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

Unified Diff: chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc

Issue 2771793002: End to end test: async focus shouldn't trigger virtual keyboard. (Closed)
Patch Set: . Created 3 years, 9 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
Index: chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc
diff --git a/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc b/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc
index 62fc51f548dbec973c3bbdd3194302bab3ee956b..2fdd8cae12478d8741878b56e575b0c6d090653b 100644
--- a/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc
+++ b/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc
@@ -56,25 +56,40 @@ class KeyboardEndToEndTest : public InProcessBrowserTest {
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(keyboard::switches::kEnableVirtualKeyboard);
}
+
+ void SetUpOnMainThread() override {
+ GURL test_url =
+ ui_test_utils::GetTestUrl(base::FilePath("chromeos/virtual_keyboard"),
+ base::FilePath("inputs.html"));
+ ui_test_utils::NavigateToURL(browser(), test_url);
+ web_contents = browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(web_contents);
+
+ EXPECT_FALSE(IsKeyboardVisible());
+ }
+
+ // Initialized in |SetUpOnMainThread|.
oshima 2017/03/27 16:57:54 nit: private: and DISALLOW_COPY_AND_ASSIGN
oka 2017/03/28 11:13:26 Done.
+ content::WebContents* web_contents;
};
IN_PROC_BROWSER_TEST_F(KeyboardEndToEndTest, OpenIfFocusedOnClick) {
- GURL test_url =
- ui_test_utils::GetTestUrl(base::FilePath("chromeos/virtual_keyboard"),
- base::FilePath("inputs.html"));
- ui_test_utils::NavigateToURL(browser(), test_url);
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
- ASSERT_TRUE(web_contents);
+ ClickElementWithId(web_contents, "text");
+ ASSERT_TRUE(keyboard::WaitUntilShown());
+ EXPECT_TRUE(IsKeyboardVisible());
+
+ ClickElementWithId(web_contents, "blur");
+ ASSERT_TRUE(keyboard::WaitUntilHidden());
EXPECT_FALSE(IsKeyboardVisible());
+}
- ClickElementWithId(web_contents, "text");
+IN_PROC_BROWSER_TEST_F(KeyboardEndToEndTest, OpenOnlyOnSyncFocus) {
+ ClickElementWithId(web_contents, "sync");
ASSERT_TRUE(keyboard::WaitUntilShown());
EXPECT_TRUE(IsKeyboardVisible());
- ClickElementWithId(web_contents, "blur");
+ ClickElementWithId(web_contents, "async");
ASSERT_TRUE(keyboard::WaitUntilHidden());
EXPECT_FALSE(IsKeyboardVisible());
}

Powered by Google App Engine
This is Rietveld 408576698