OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/apps/app_browsertest_util.h" | 10 #include "chrome/browser/apps/app_browsertest_util.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 EXPECT_FALSE(custom_page_view->visible()); | 383 EXPECT_FALSE(custom_page_view->visible()); |
384 | 384 |
385 SetCustomLauncherPageEnabled(true); | 385 SetCustomLauncherPageEnabled(true); |
386 EXPECT_TRUE(model->custom_launcher_page_enabled()); | 386 EXPECT_TRUE(model->custom_launcher_page_enabled()); |
387 EXPECT_TRUE(custom_page_view->visible()); | 387 EXPECT_TRUE(custom_page_view->visible()); |
388 } | 388 } |
389 | 389 |
390 // Currently this is flaky. | 390 // Currently this is flaky. |
391 // Disabled test http://crbug.com/463456 | 391 // Disabled test http://crbug.com/463456 |
392 IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest, | 392 IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest, |
393 DISABLED_LauncherPageFocusTraversal) { | 393 LauncherPageFocusTraversal) { |
394 LoadAndLaunchPlatformApp(kCustomLauncherPagePath, "Launched"); | 394 LoadAndLaunchPlatformApp(kCustomLauncherPagePath, "Launched"); |
395 app_list::AppListView* app_list_view = GetAppListView(); | 395 app_list::AppListView* app_list_view = GetAppListView(); |
396 app_list::ContentsView* contents_view = | 396 app_list::ContentsView* contents_view = |
397 app_list_view->app_list_main_view()->contents_view(); | 397 app_list_view->app_list_main_view()->contents_view(); |
398 app_list::SearchBoxView* search_box_view = | 398 app_list::SearchBoxView* search_box_view = |
399 app_list_view->app_list_main_view()->search_box_view(); | 399 app_list_view->app_list_main_view()->search_box_view(); |
400 | 400 |
401 ASSERT_TRUE( | 401 ASSERT_TRUE( |
402 contents_view->IsStateActive(app_list::AppListModel::STATE_START)); | 402 contents_view->IsStateActive(app_list::AppListModel::STATE_START)); |
403 EXPECT_EQ(app_list_view->GetFocusManager()->GetFocusedView(), | |
404 search_box_view->search_box()); | |
405 | 403 |
406 { | 404 { |
407 ExtensionTestMessageListener listener("onPageProgressAt1", false); | 405 ExtensionTestMessageListener listener("onPageProgressAt1", false); |
408 contents_view->SetActivePage(contents_view->GetPageIndexForState( | 406 contents_view->SetActivePage(contents_view->GetPageIndexForState( |
409 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)); | 407 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)); |
408 | |
410 listener.WaitUntilSatisfied(); | 409 listener.WaitUntilSatisfied(); |
411 EXPECT_TRUE(contents_view->IsStateActive( | |
412 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)); | |
413 EXPECT_EQ(app_list_view->GetFocusManager()->GetFocusedView(), | |
414 search_box_view->search_box()); | |
415 } | 410 } |
416 { | 411 |
417 ExtensionTestMessageListener listener("textfieldFocused", false); | 412 // Expect that the search box and webview are the only two focusable views. |
418 app_list_view->GetFocusManager()->AdvanceFocus(false); | 413 views::View* search_box_textfield = search_box_view->search_box(); |
419 listener.WaitUntilSatisfied(); | 414 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
| |
420 EXPECT_NE(app_list_view->GetFocusManager()->GetFocusedView(), | 415 app_list_view->GetFocusManager()->GetNextFocusableView( |
421 search_box_view->search_box()); | 416 search_box_textfield, search_box_textfield->GetWidget(), false, |
422 } | 417 false); |
423 { | 418 EXPECT_NE(webview_textfield, search_box_textfield); |
424 ExtensionTestMessageListener listener("textfieldBlurred", false); | 419 EXPECT_EQ( |
425 app_list_view->GetFocusManager()->AdvanceFocus(false); | 420 search_box_textfield, |
426 listener.WaitUntilSatisfied(); | 421 app_list_view->GetFocusManager()->GetNextFocusableView( |
427 EXPECT_EQ(app_list_view->GetFocusManager()->GetFocusedView(), | 422 webview_textfield, webview_textfield->GetWidget(), false, false)); |
428 search_box_view->search_box()); | 423 |
429 } | 424 // And in reverse. |
425 EXPECT_EQ( | |
426 search_box_textfield, | |
427 app_list_view->GetFocusManager()->GetNextFocusableView( | |
428 webview_textfield, webview_textfield->GetWidget(), true, false)); | |
429 EXPECT_EQ(webview_textfield, | |
430 app_list_view->GetFocusManager()->GetNextFocusableView( | |
431 search_box_textfield, search_box_textfield->GetWidget(), true, | |
432 false)); | |
430 } | 433 } |
OLD | NEW |