| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 ASSERT_TRUE(IsViewFocused(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 370 ASSERT_TRUE(IsViewFocused(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
| 371 } | 371 } |
| 372 | 372 |
| 373 // Background window does not steal focus. | 373 // Background window does not steal focus. |
| 374 // Flaky, http://crbug.com/62538. | 374 // Flaky, http://crbug.com/62538. |
| 375 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, | 375 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, |
| 376 DISABLED_BackgroundBrowserDontStealFocus) { | 376 DISABLED_BackgroundBrowserDontStealFocus) { |
| 377 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 377 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 378 | 378 |
| 379 // Open a new browser window. | 379 // Open a new browser window. |
| 380 Browser* browser2 = | 380 Browser* browser2 = new Browser(Browser::CreateParams(browser()->profile())); |
| 381 new Browser(Browser::CreateParams(browser()->profile(), | 381 |
| 382 browser()->host_desktop_type())); | |
| 383 ASSERT_TRUE(browser2); | 382 ASSERT_TRUE(browser2); |
| 384 chrome::AddTabAt(browser2, GURL(), -1, true); | 383 chrome::AddTabAt(browser2, GURL(), -1, true); |
| 385 browser2->window()->Show(); | 384 browser2->window()->Show(); |
| 386 | 385 |
| 387 Browser* focused_browser = NULL; | 386 Browser* focused_browser = NULL; |
| 388 Browser* unfocused_browser = NULL; | 387 Browser* unfocused_browser = NULL; |
| 389 #if defined(USE_X11) | 388 #if defined(USE_X11) |
| 390 // On X11, calling Activate() is not guaranteed to move focus, so we have | 389 // On X11, calling Activate() is not guaranteed to move focus, so we have |
| 391 // to figure out which browser does have focus. | 390 // to figure out which browser does have focus. |
| 392 if (browser2->window()->IsActive()) { | 391 if (browser2->window()->IsActive()) { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 732 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 734 content::NotificationService::AllSources()); | 733 content::NotificationService::AllSources()); |
| 735 chrome::GoForward(browser(), CURRENT_TAB); | 734 chrome::GoForward(browser(), CURRENT_TAB); |
| 736 forward_nav_observer.Wait(); | 735 forward_nav_observer.Wait(); |
| 737 } | 736 } |
| 738 | 737 |
| 739 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); | 738 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| 740 } | 739 } |
| 741 | 740 |
| 742 } // namespace | 741 } // namespace |
| OLD | NEW |