Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/input_method/textinput_test_helper.h" | |
| 6 #include "chrome/browser/ui/browser.h" | |
| 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
| 8 #include "chrome/test/base/interactive_test_utils.h" | |
| 9 #include "content/public/test/browser_test_utils.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 typedef TextInputTestBase KeyboardEventEndToEndTest; | |
| 15 | |
| 16 // Flaky test: 268049 | |
| 17 IN_PROC_BROWSER_TEST_F(KeyboardEventEndToEndTest, | |
| 18 DISABLED_AltGrToCtrlAltKeyDown) { | |
| 19 TextInputTestHelper helper; | |
| 20 | |
| 21 GURL url = ui_test_utils::GetTestUrl( | |
| 22 base::FilePath(FILE_PATH_LITERAL("textinput")), | |
| 23 base::FilePath(FILE_PATH_LITERAL("keyevent_logging.html"))); | |
|
jochen (gone - plz use gerrit)
2013/09/19 12:34:32
please also delete the html file
Seigo Nonaka
2013/09/19 19:03:56
Done.
| |
| 24 ui_test_utils::NavigateToURL(browser(), url); | |
| 25 | |
| 26 content::WebContents* tab = | |
| 27 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 28 | |
| 29 helper.ClickElement("text_id", tab); | |
| 30 helper.WaitForTextInputStateChanged(ui::TEXT_INPUT_TYPE_TEXT); | |
| 31 | |
| 32 { | |
| 33 ASSERT_TRUE(content::ExecuteScript( | |
| 34 tab, | |
| 35 "initKeyDownExpectations([" | |
| 36 // Alt down has (only) altKey true in this case. | |
| 37 "{ keyCode:18, shiftKey:false, ctrlKey:false, altKey:true }]);")); | |
| 38 EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), | |
| 39 ui::VKEY_MENU, | |
| 40 false, | |
| 41 false, | |
| 42 false, | |
| 43 false)); | |
| 44 bool result = false; | |
| 45 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | |
| 46 tab, | |
| 47 "didTestSucceed();", | |
| 48 &result)); | |
| 49 EXPECT_TRUE(result); | |
| 50 } | |
| 51 { | |
| 52 ASSERT_TRUE(content::ExecuteScript( | |
| 53 tab, | |
| 54 "initKeyDownExpectations([" | |
| 55 // Ctrl down has (only) ctrlKey true in this case. | |
| 56 "{ keyCode:17, shiftKey:false, ctrlKey:true, altKey:false }]);")); | |
| 57 EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), | |
| 58 ui::VKEY_CONTROL, | |
| 59 false, | |
| 60 false, | |
| 61 false, | |
| 62 false)); | |
| 63 bool result = false; | |
| 64 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | |
| 65 tab, | |
| 66 "didTestSucceed();", | |
| 67 &result)); | |
| 68 EXPECT_TRUE(result); | |
| 69 } | |
| 70 { | |
| 71 ASSERT_TRUE(content::ExecuteScript( | |
| 72 tab, | |
| 73 "initKeyDownExpectations([" | |
| 74 // Ctrl down has ctrlKey false in this case. | |
| 75 "{ keyCode:17, shiftKey:false , ctrlKey:false , altKey:false }," | |
| 76 // Alt down has altKey false in this case. | |
| 77 "{ keyCode:18, shiftKey:false , ctrlKey:false , altKey:false }]);")); | |
| 78 EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), | |
| 79 ui::VKEY_ALTGR, | |
| 80 false, | |
| 81 false, | |
| 82 false, | |
| 83 false)); | |
| 84 bool result = false; | |
| 85 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | |
| 86 tab, | |
| 87 "didTestSucceed();", | |
| 88 &result)); | |
| 89 EXPECT_TRUE(result); | |
| 90 } | |
| 91 } | |
| 92 | |
| 93 // TODO(nona): Add AltGr modifier test. Need to add AltGr handling into | |
| 94 // SendKeyPressSync(crbug.com/262928). | |
| 95 | |
| 96 } // namespace chromeos | |
| OLD | NEW |