| 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..47295cec3cb56f797760ce7d24860e0df38f9726 100644
|
| --- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
|
| +++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
|
| @@ -1357,39 +1357,31 @@ 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");
|
| + if (GetParam())
|
| + SendMessageToEmbedder("setOopif");
|
| +
|
| ExtensionTestMessageListener test_init_listener(
|
| "WebViewInteractiveTest.WebViewInitialized", false);
|
| SendMessageToEmbedder("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;
|
| -
|
| // Send several tab-keys. The button inside webview should receive focus at
|
| // least once.
|
| - for (size_t i = 0; i < 2; ++i)
|
| + ExtensionTestMessageListener key_processed_listener(
|
| + "WebViewInteractiveTest.KeyUp", false);
|
| +#if defined(OS_MACOSX)
|
| + // Mac needs a kick in the pants before wait doesn't deadlock.
|
| + 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 +1399,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(
|
|
|