Chromium Code Reviews| Index: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc |
| diff --git a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc |
| index a0ecbd95d2f7b06c7c8de427978de762d8d051e5..33986bc508f90938cf5d690dba694f2f9d4fc6e0 100644 |
| --- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc |
| +++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc |
| @@ -1356,40 +1356,30 @@ IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, TextSelection) { |
| } |
| #endif |
| -// Flaky on MacOS builders. https://crbug.com/670008 |
| -#if defined(OS_MACOSX) |
| -#define MAYBE_FocusAndVisibility DISABLED_FocusAndVisibility |
| -#else |
| -#define MAYBE_FocusAndVisibility FocusAndVisibility |
| -#endif |
| - |
| -IN_PROC_BROWSER_TEST_P(WebViewFocusInteractiveTest, MAYBE_FocusAndVisibility) { |
| +IN_PROC_BROWSER_TEST_P(WebViewFocusInteractiveTest, FocusAndVisibility) { |
| ASSERT_TRUE(StartEmbeddedTestServer()); |
| LoadAndLaunchPlatformApp("web_view/focus_visibility", |
| "WebViewInteractiveTest.LOADED"); |
| ExtensionTestMessageListener test_init_listener( |
| "WebViewInteractiveTest.WebViewInitialized", false); |
| - SendMessageToEmbedder("init"); |
| + SendMessageToEmbedder(GetParam() ? "init-oopif" : "init"); |
| test_init_listener.WaitUntilSatisfied(); |
| - // In oopif-webview, wait until the tab key triggers a focus change. |
| - std::unique_ptr<content::FrameFocusedObserver> frame_focus_observer = |
| - GetParam() ? base::MakeUnique<content::FrameFocusedObserver>( |
| - GetGuestViewManager() |
| - ->WaitForSingleGuestCreated() |
| - ->GetMainFrame()) |
| - : nullptr; |
| + ExtensionTestMessageListener key_processed_listener( |
| + "WebViewInteractiveTest.KeyUp", false); |
| // Send several tab-keys. The button inside webview should receive focus at |
| // least once. |
| - for (size_t i = 0; i < 2; ++i) |
| +#if defined(OS_MACOSX) |
| + // On mac, the event listener seems one key even behind and deadlocks. Send an |
|
EhsanK
2017/01/25 17:57:58
s/even/event?
Also is there a short explanation on
avallee
2017/01/25 18:50:18
Done.
EhsanK
2017/01/25 19:31:36
Acknowledged.
|
| + // extra tab to get things unblocked. |
| + SendKeyPressToPlatformApp(ui::VKEY_TAB); |
| +#endif |
| + for (size_t i = 0; i < 4; ++i) { |
| + key_processed_listener.Reset(); |
| SendKeyPressToPlatformApp(ui::VKEY_TAB); |
| - if (frame_focus_observer) { |
| - frame_focus_observer->Wait(); |
| - frame_focus_observer.reset(); |
| + EXPECT_TRUE(key_processed_listener.WaitUntilSatisfied()); |
| } |
| - for (size_t i = 0; i < 2; ++i) |
| - SendKeyPressToPlatformApp(ui::VKEY_TAB); |
| ExtensionTestMessageListener webview_button_focused_listener( |
| "WebViewInteractiveTest.WebViewButtonWasFocused", false); |
| webview_button_focused_listener.set_failure_message( |
| @@ -1407,8 +1397,11 @@ IN_PROC_BROWSER_TEST_P(WebViewFocusInteractiveTest, MAYBE_FocusAndVisibility) { |
| did_hide_webview_listener.WaitUntilSatisfied(); |
| // Send the same number of keys and verify that the webview button was not |
| // this time. |
| - for (size_t i = 0; i < 4; ++i) |
| + for (size_t i = 0; i < 4; ++i) { |
| + key_processed_listener.Reset(); |
| SendKeyPressToPlatformApp(ui::VKEY_TAB); |
| + EXPECT_TRUE(key_processed_listener.WaitUntilSatisfied()); |
| + } |
| ExtensionTestMessageListener webview_button_not_focused_listener( |
| "WebViewInteractiveTest.WebViewButtonWasNotFocused", false); |
| webview_button_not_focused_listener.set_failure_message( |