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

Side by Side Diff: chrome/browser/ui/browser_focus_uitest.cc

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 900
901 // The tab contents should have the focus in the second tab. 901 // The tab contents should have the focus in the second tab.
902 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER)); 902 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_TAB_CONTAINER));
903 903
904 // Go back to the first tab. The focus should not be in the omnibox. 904 // Go back to the first tab. The focus should not be in the omnibox.
905 chrome::SelectPreviousTab(browser()); 905 chrome::SelectPreviousTab(browser());
906 EXPECT_EQ(0, browser()->tab_strip_model()->active_index()); 906 EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
907 EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); 907 EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX));
908 } 908 }
909 909
910 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnNavigate) { 910 // This functionality is currently broken. http://crbug.com/304865.
911 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnNavigate) {
sky 2013/10/11 22:34:27 Are you breaking this, or is already broke? If alr
samarth 2013/10/14 16:58:57 Already broken with Instant Extended, but only dis
911 // Needed on Mac. 912 // Needed on Mac.
912 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 913 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
913 // Load the NTP. 914 // Load the NTP.
914 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); 915 ui_test_utils::NavigateToURLWithDisposition(
916 browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB,
917 ui_test_utils::BROWSER_TEST_NONE);
915 EXPECT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); 918 EXPECT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX));
916 919
917 // Navigate to another page. 920 // Navigate to another page.
918 const base::FilePath::CharType* kEmptyFile = FILE_PATH_LITERAL("empty.html"); 921 const base::FilePath::CharType* kEmptyFile = FILE_PATH_LITERAL("empty.html");
919 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( 922 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath(
920 base::FilePath::kCurrentDirectory), base::FilePath(kEmptyFile))); 923 base::FilePath::kCurrentDirectory), base::FilePath(kEmptyFile)));
921 ui_test_utils::NavigateToURL(browser(), file_url); 924 ui_test_utils::NavigateToURL(browser(), file_url);
922 925
923 ClickOnView(VIEW_ID_TAB_CONTAINER); 926 ClickOnView(VIEW_ID_TAB_CONTAINER);
924 927
(...skipping 15 matching lines...) Expand all
940 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 943 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
941 content::NotificationService::AllSources()); 944 content::NotificationService::AllSources());
942 chrome::GoForward(browser(), CURRENT_TAB); 945 chrome::GoForward(browser(), CURRENT_TAB);
943 forward_nav_observer.Wait(); 946 forward_nav_observer.Wait();
944 } 947 }
945 948
946 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); 949 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX));
947 } 950 }
948 951
949 } // namespace 952 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698