| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h" | 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
| 8 #include "chrome/browser/extensions/extension_view_host.h" | 8 #include "chrome/browser/extensions/extension_view_host.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| 11 #include "extensions/test/extension_test_message_listener.h" | 11 #include "extensions/test/extension_test_message_listener.h" |
| 12 #include "ui/base/test/ui_controls.h" | 12 #include "ui/base/test/ui_controls.h" |
| 13 | 13 |
| 14 using ExtensionDialogUiTest = ExtensionBrowserTest; | 14 using ExtensionDialogUiTest = ExtensionBrowserTest; |
| 15 | 15 |
| 16 IN_PROC_BROWSER_TEST_F(ExtensionDialogUiTest, TabFocusLoop) { | 16 // Flaky on Windows: see https://crbug.com/639072 |
| 17 #if defined(OS_WIN) |
| 18 #define MAYBE_TabFocusLoop DISABLED_TabFocusLoop |
| 19 #else |
| 20 #define MAYBE_TabFocusLoop TabFocusLoop |
| 21 #endif |
| 22 IN_PROC_BROWSER_TEST_F(ExtensionDialogUiTest, MAYBE_TabFocusLoop) { |
| 17 ExtensionTestMessageListener init_listener("ready", false /* will_reply */); | 23 ExtensionTestMessageListener init_listener("ready", false /* will_reply */); |
| 18 ExtensionTestMessageListener button1_focus_listener("button1-focused", false); | 24 ExtensionTestMessageListener button1_focus_listener("button1-focused", false); |
| 19 ExtensionTestMessageListener button2_focus_listener("button2-focused", false); | 25 ExtensionTestMessageListener button2_focus_listener("button2-focused", false); |
| 20 ExtensionTestMessageListener button3_focus_listener("button3-focused", false); | 26 ExtensionTestMessageListener button3_focus_listener("button3-focused", false); |
| 21 | 27 |
| 22 // Load an extension for the test. | 28 // Load an extension for the test. |
| 23 scoped_refptr<const extensions::Extension> extension = | 29 scoped_refptr<const extensions::Extension> extension = |
| 24 LoadExtension(test_data_dir_.AppendASCII("uitest/tab_traversal")); | 30 LoadExtension(test_data_dir_.AppendASCII("uitest/tab_traversal")); |
| 25 ASSERT_TRUE(extension.get()); | 31 ASSERT_TRUE(extension.get()); |
| 26 | 32 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 50 browser()->window()->GetNativeWindow(), | 56 browser()->window()->GetNativeWindow(), |
| 51 ui::VKEY_TAB, false, false, false, false)); | 57 ui::VKEY_TAB, false, false, false, false)); |
| 52 ASSERT_TRUE(button1_focus_listener.WaitUntilSatisfied()); | 58 ASSERT_TRUE(button1_focus_listener.WaitUntilSatisfied()); |
| 53 | 59 |
| 54 // Pressing Shift+TAB on the first button should focus the last button. | 60 // Pressing Shift+TAB on the first button should focus the last button. |
| 55 ASSERT_TRUE(ui_controls::SendKeyPress( | 61 ASSERT_TRUE(ui_controls::SendKeyPress( |
| 56 browser()->window()->GetNativeWindow(), | 62 browser()->window()->GetNativeWindow(), |
| 57 ui::VKEY_TAB, false, true, false, false)); | 63 ui::VKEY_TAB, false, true, false, false)); |
| 58 ASSERT_TRUE(button3_focus_listener.WaitUntilSatisfied()); | 64 ASSERT_TRUE(button3_focus_listener.WaitUntilSatisfied()); |
| 59 }; | 65 }; |
| OLD | NEW |