OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/browser_window.h" | 8 #include "chrome/browser/browser_window.h" |
9 #include "chrome/browser/gtk/view_id_util.h" | 9 #include "chrome/browser/gtk/view_id_util.h" |
10 #include "chrome/browser/tabs/tab_strip_model.h" | 10 #include "chrome/browser/tabs/tab_strip_model.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // the findbar is above the floating bookmark bar. | 29 // the findbar is above the floating bookmark bar. |
30 IN_PROC_BROWSER_TEST_F(BookmarkBarGtkBrowserTest, FindBarTest) { | 30 IN_PROC_BROWSER_TEST_F(BookmarkBarGtkBrowserTest, FindBarTest) { |
31 ASSERT_TRUE(test_server()->Start()); | 31 ASSERT_TRUE(test_server()->Start()); |
32 | 32 |
33 // Create new tab; open findbar. | 33 // Create new tab; open findbar. |
34 browser()->NewTab(); | 34 browser()->NewTab(); |
35 browser()->Find(); | 35 browser()->Find(); |
36 | 36 |
37 // Create new tab with an arbitrary URL. | 37 // Create new tab with an arbitrary URL. |
38 GURL url = test_server()->GetURL(kSimplePage); | 38 GURL url = test_server()->GetURL(kSimplePage); |
39 Browser::AddTabWithURLParams params(url, PageTransition::TYPED); | 39 browser()->AddSelectedTabWithURL(url, PageTransition::TYPED); |
40 browser()->AddTabWithURL(¶ms); | |
41 EXPECT_EQ(browser(), params.target); | |
42 | 40 |
43 // Switch back to the NTP with the active findbar. | 41 // Switch back to the NTP with the active findbar. |
44 browser()->SelectTabContentsAt(1, false); | 42 browser()->SelectTabContentsAt(1, false); |
45 | 43 |
46 // Wait for the findbar to show. | 44 // Wait for the findbar to show. |
47 MessageLoop::current()->RunAllPending(); | 45 MessageLoop::current()->RunAllPending(); |
48 | 46 |
49 // Set focus somewhere else, so that we can test clicking on the findbar | 47 // Set focus somewhere else, so that we can test clicking on the findbar |
50 // works. | 48 // works. |
51 browser()->FocusLocationBar(); | 49 browser()->FocusLocationBar(); |
(...skipping 19 matching lines...) Expand all Loading... |
71 MessageLoop::current()->RunAllPending(); | 69 MessageLoop::current()->RunAllPending(); |
72 | 70 |
73 // This is kind of a hack. Calling this just once doesn't seem to send a click | 71 // This is kind of a hack. Calling this just once doesn't seem to send a click |
74 // event, but doing it twice works. | 72 // event, but doing it twice works. |
75 // http://crbug.com/35581 | 73 // http://crbug.com/35581 |
76 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); | 74 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); |
77 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); | 75 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); |
78 | 76 |
79 EXPECT_TRUE(has_been_clicked); | 77 EXPECT_TRUE(has_been_clicked); |
80 } | 78 } |
OLD | NEW |