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

Unified Diff: chrome/browser/apps/custom_launcher_page_browsertest_views.cc

Issue 984813002: Fix CustomLauncherPageBrowserTest.LauncherPageFocusTraversal flake. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_set_enabled
Patch Set: Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/custom_launcher_page_browsertest_views.cc
diff --git a/chrome/browser/apps/custom_launcher_page_browsertest_views.cc b/chrome/browser/apps/custom_launcher_page_browsertest_views.cc
index 485fe6dc4763df9e5d6d557028bdb9585e22b43b..86e23640a341f8b3345775909e46da37bbd20cd0 100644
--- a/chrome/browser/apps/custom_launcher_page_browsertest_views.cc
+++ b/chrome/browser/apps/custom_launcher_page_browsertest_views.cc
@@ -390,7 +390,7 @@ IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest, LauncherPageSetEnabled) {
// Currently this is flaky.
// Disabled test http://crbug.com/463456
IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest,
- DISABLED_LauncherPageFocusTraversal) {
+ LauncherPageFocusTraversal) {
LoadAndLaunchPlatformApp(kCustomLauncherPagePath, "Launched");
app_list::AppListView* app_list_view = GetAppListView();
app_list::ContentsView* contents_view =
@@ -400,31 +400,34 @@ IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest,
ASSERT_TRUE(
contents_view->IsStateActive(app_list::AppListModel::STATE_START));
- EXPECT_EQ(app_list_view->GetFocusManager()->GetFocusedView(),
- search_box_view->search_box());
{
ExtensionTestMessageListener listener("onPageProgressAt1", false);
contents_view->SetActivePage(contents_view->GetPageIndexForState(
app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE));
+
listener.WaitUntilSatisfied();
- EXPECT_TRUE(contents_view->IsStateActive(
- app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE));
- EXPECT_EQ(app_list_view->GetFocusManager()->GetFocusedView(),
- search_box_view->search_box());
- }
- {
- ExtensionTestMessageListener listener("textfieldFocused", false);
- app_list_view->GetFocusManager()->AdvanceFocus(false);
- listener.WaitUntilSatisfied();
- EXPECT_NE(app_list_view->GetFocusManager()->GetFocusedView(),
- search_box_view->search_box());
- }
- {
- ExtensionTestMessageListener listener("textfieldBlurred", false);
- app_list_view->GetFocusManager()->AdvanceFocus(false);
- listener.WaitUntilSatisfied();
- EXPECT_EQ(app_list_view->GetFocusManager()->GetFocusedView(),
- search_box_view->search_box());
}
+
+ // Expect that the search box and webview are the only two focusable views.
+ views::View* search_box_textfield = search_box_view->search_box();
+ views::View* webview_textfield =
benwells 2015/03/11 19:53:41 This tests that the search box text field, and som
calamity 2015/03/24 00:42:49 Ah yeah, I thought I wouldn't be able to do it, bu
+ app_list_view->GetFocusManager()->GetNextFocusableView(
+ search_box_textfield, search_box_textfield->GetWidget(), false,
+ false);
+ EXPECT_NE(webview_textfield, search_box_textfield);
+ EXPECT_EQ(
+ search_box_textfield,
+ app_list_view->GetFocusManager()->GetNextFocusableView(
+ webview_textfield, webview_textfield->GetWidget(), false, false));
+
+ // And in reverse.
+ EXPECT_EQ(
+ search_box_textfield,
+ app_list_view->GetFocusManager()->GetNextFocusableView(
+ webview_textfield, webview_textfield->GetWidget(), true, false));
+ EXPECT_EQ(webview_textfield,
+ app_list_view->GetFocusManager()->GetNextFocusableView(
+ search_box_textfield, search_box_textfield->GetWidget(), true,
+ false));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698