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

Unified Diff: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc

Issue 2474323002: Implement WebContentsViewChildFrame::TakeFocus. (Closed)
Patch Set: remove logging and move pant kickcing out of loop Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698