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/files/file_util.h" | 6 #include "base/files/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/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, | 344 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, |
345 DISABLED_BackgroundBrowserDontStealFocus) { | 345 DISABLED_BackgroundBrowserDontStealFocus) { |
346 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 346 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
347 | 347 |
348 // Open a new browser window. | 348 // Open a new browser window. |
349 Browser* browser2 = | 349 Browser* browser2 = |
350 new Browser(Browser::CreateParams(browser()->profile(), | 350 new Browser(Browser::CreateParams(browser()->profile(), |
351 browser()->host_desktop_type())); | 351 browser()->host_desktop_type())); |
352 ASSERT_TRUE(browser2); | 352 ASSERT_TRUE(browser2); |
353 chrome::AddTabAt(browser2, GURL(), -1, true); | 353 chrome::AddTabAt(browser2, GURL(), -1, true); |
354 browser2->window()->Show(); | 354 browser2->window()->Show(false /* user_gesture */); |
355 | 355 |
356 Browser* focused_browser = NULL; | 356 Browser* focused_browser = NULL; |
357 Browser* unfocused_browser = NULL; | 357 Browser* unfocused_browser = NULL; |
358 #if defined(USE_X11) | 358 #if defined(USE_X11) |
359 // On X11, calling Activate() is not guaranteed to move focus, so we have | 359 // On X11, calling Activate() is not guaranteed to move focus, so we have |
360 // to figure out which browser does have focus. | 360 // to figure out which browser does have focus. |
361 if (browser2->window()->IsActive()) { | 361 if (browser2->window()->IsActive()) { |
362 focused_browser = browser2; | 362 focused_browser = browser2; |
363 unfocused_browser = browser(); | 363 unfocused_browser = browser(); |
364 } else if (browser()->window()->IsActive()) { | 364 } else if (browser()->window()->IsActive()) { |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 700 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
701 content::NotificationService::AllSources()); | 701 content::NotificationService::AllSources()); |
702 chrome::GoForward(browser(), CURRENT_TAB); | 702 chrome::GoForward(browser(), CURRENT_TAB); |
703 forward_nav_observer.Wait(); | 703 forward_nav_observer.Wait(); |
704 } | 704 } |
705 | 705 |
706 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); | 706 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
707 } | 707 } |
708 | 708 |
709 } // namespace | 709 } // namespace |
OLD | NEW |