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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_focus_uitest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase bug. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 12 matching lines...) Expand all
23 class BrowserViewFocusTest : public InProcessBrowserTest { 23 class BrowserViewFocusTest : public InProcessBrowserTest {
24 public: 24 public:
25 bool IsViewFocused(ViewID vid) { 25 bool IsViewFocused(ViewID vid) {
26 return ui_test_utils::IsViewFocused(browser(), vid); 26 return ui_test_utils::IsViewFocused(browser(), vid);
27 } 27 }
28 }; 28 };
29 29
30 // Flaky, http://crbug.com/69034. 30 // Flaky, http://crbug.com/69034.
31 IN_PROC_BROWSER_TEST_F(BrowserViewFocusTest, DISABLED_BrowsersRememberFocus) { 31 IN_PROC_BROWSER_TEST_F(BrowserViewFocusTest, DISABLED_BrowsersRememberFocus) {
32 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 32 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
33 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 33 ASSERT_TRUE(embedded_test_server()->Start());
34 34
35 // First we navigate to our test page. 35 // First we navigate to our test page.
36 GURL url = embedded_test_server()->GetURL(kSimplePage); 36 GURL url = embedded_test_server()->GetURL(kSimplePage);
37 ui_test_utils::NavigateToURL(browser(), url); 37 ui_test_utils::NavigateToURL(browser(), url);
38 38
39 gfx::NativeWindow window = browser()->window()->GetNativeWindow(); 39 gfx::NativeWindow window = browser()->window()->GetNativeWindow();
40 40
41 // The focus should be on the Tab contents. 41 // The focus should be on the Tab contents.
42 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 42 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
43 // Now hide the window, show it again, the focus should not have changed. 43 // Now hide the window, show it again, the focus should not have changed.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); 86 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
87 ASSERT_TRUE(widget); 87 ASSERT_TRUE(widget);
88 EXPECT_EQ(nullptr, widget->GetFocusManager()->GetFocusedView()); 88 EXPECT_EQ(nullptr, widget->GetFocusManager()->GetFocusedView());
89 EXPECT_EQ(browser_view2->GetTabContentsContainerView(), 89 EXPECT_EQ(browser_view2->GetTabContentsContainerView(),
90 focus_manager2->GetFocusedView()); 90 focus_manager2->GetFocusedView());
91 91
92 // Close the 2nd browser to avoid a DCHECK(). 92 // Close the 2nd browser to avoid a DCHECK().
93 browser_view2->Close(); 93 browser_view2->Close();
94 #endif 94 #endif
95 } 95 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698