| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 931 |
| 932 // The tab contents should have the focus in the second tab. | 932 // The tab contents should have the focus in the second tab. |
| 933 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER)); | 933 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER)); |
| 934 | 934 |
| 935 // Go back to the first tab. The focus should not be in the omnibox. | 935 // Go back to the first tab. The focus should not be in the omnibox. |
| 936 chrome::SelectPreviousTab(browser()); | 936 chrome::SelectPreviousTab(browser()); |
| 937 EXPECT_EQ(0, browser()->tab_strip_model()->active_index()); | 937 EXPECT_EQ(0, browser()->tab_strip_model()->active_index()); |
| 938 EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); | 938 EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
| 939 } | 939 } |
| 940 | 940 |
| 941 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | 941 // This functionality is currently broken. http://crbug.com/304865. |
| 942 // TODO(erg): http://crbug.com/163931 | 942 // |
| 943 #define MAYBE_FocusOnNavigate DISABLED_FocusOnNavigate | 943 //#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 944 #else | 944 //// TODO(erg): http://crbug.com/163931 |
| 945 #define MAYBE_FocusOnNavigate FocusOnNavigate | 945 //#define MAYBE_FocusOnNavigate DISABLED_FocusOnNavigate |
| 946 #endif | 946 //#else |
| 947 //#define MAYBE_FocusOnNavigate FocusOnNavigate |
| 948 //#endif |
| 947 | 949 |
| 948 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusOnNavigate) { | 950 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnNavigate) { |
| 949 // Needed on Mac. | 951 // Needed on Mac. |
| 950 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 952 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 951 // Load the NTP. | 953 // Load the NTP. |
| 952 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 954 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 953 EXPECT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); | 955 EXPECT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| 954 | 956 |
| 955 // Navigate to another page. | 957 // Navigate to another page. |
| 956 const base::FilePath::CharType* kEmptyFile = FILE_PATH_LITERAL("empty.html"); | 958 const base::FilePath::CharType* kEmptyFile = FILE_PATH_LITERAL("empty.html"); |
| 957 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( | 959 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( |
| 958 base::FilePath::kCurrentDirectory), base::FilePath(kEmptyFile))); | 960 base::FilePath::kCurrentDirectory), base::FilePath(kEmptyFile))); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 978 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 980 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 979 content::NotificationService::AllSources()); | 981 content::NotificationService::AllSources()); |
| 980 chrome::GoForward(browser(), CURRENT_TAB); | 982 chrome::GoForward(browser(), CURRENT_TAB); |
| 981 forward_nav_observer.Wait(); | 983 forward_nav_observer.Wait(); |
| 982 } | 984 } |
| 983 | 985 |
| 984 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); | 986 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| 985 } | 987 } |
| 986 | 988 |
| 987 } // namespace | 989 } // namespace |
| OLD | NEW |