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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 | 6 |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 chrome::Find(browser()); | 38 chrome::Find(browser()); |
39 | 39 |
40 // Create new tab with an arbitrary URL. | 40 // Create new tab with an arbitrary URL. |
41 GURL url = test_server()->GetURL(kSimplePage); | 41 GURL url = test_server()->GetURL(kSimplePage); |
42 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); | 42 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); |
43 | 43 |
44 // Switch back to the NTP with the active findbar. | 44 // Switch back to the NTP with the active findbar. |
45 browser()->tab_strip_model()->ActivateTabAt(1, false); | 45 browser()->tab_strip_model()->ActivateTabAt(1, false); |
46 | 46 |
47 // Wait for the findbar to show. | 47 // Wait for the findbar to show. |
48 MessageLoop::current()->RunUntilIdle(); | 48 base::MessageLoop::current()->RunUntilIdle(); |
49 | 49 |
50 // Set focus somewhere else, so that we can test clicking on the findbar | 50 // Set focus somewhere else, so that we can test clicking on the findbar |
51 // works. | 51 // works. |
52 chrome::FocusLocationBar(browser()); | 52 chrome::FocusLocationBar(browser()); |
53 ui_test_utils::ClickOnView(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); | 53 ui_test_utils::ClickOnView(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); |
54 ui_test_utils::IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); | 54 ui_test_utils::IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); |
55 } | 55 } |
56 | 56 |
57 // Makes sure that you can click on the floating bookmark bar. | 57 // Makes sure that you can click on the floating bookmark bar. |
58 // Disabled due to http://crbug.com/88933. | 58 // Disabled due to http://crbug.com/88933. |
59 IN_PROC_BROWSER_TEST_F( | 59 IN_PROC_BROWSER_TEST_F( |
60 BookmarkBarGtkInteractiveUITest, DISABLED_ClickOnFloatingTest) { | 60 BookmarkBarGtkInteractiveUITest, DISABLED_ClickOnFloatingTest) { |
61 ASSERT_TRUE(test_server()->Start()); | 61 ASSERT_TRUE(test_server()->Start()); |
62 | 62 |
63 GtkWidget* other_bookmarks = | 63 GtkWidget* other_bookmarks = |
64 ViewIDUtil::GetWidget(GTK_WIDGET(browser()->window()->GetNativeWindow()), | 64 ViewIDUtil::GetWidget(GTK_WIDGET(browser()->window()->GetNativeWindow()), |
65 VIEW_ID_OTHER_BOOKMARKS); | 65 VIEW_ID_OTHER_BOOKMARKS); |
66 bool has_been_clicked = false; | 66 bool has_been_clicked = false; |
67 g_signal_connect(other_bookmarks, "clicked", | 67 g_signal_connect(other_bookmarks, "clicked", |
68 G_CALLBACK(OnClicked), &has_been_clicked); | 68 G_CALLBACK(OnClicked), &has_been_clicked); |
69 | 69 |
70 // Create new tab. | 70 // Create new tab. |
71 chrome::NewTab(browser()); | 71 chrome::NewTab(browser()); |
72 | 72 |
73 // Wait for the floating bar to appear. | 73 // Wait for the floating bar to appear. |
74 MessageLoop::current()->RunUntilIdle(); | 74 base::MessageLoop::current()->RunUntilIdle(); |
75 | 75 |
76 // This is kind of a hack. Calling this just once doesn't seem to send a click | 76 // This is kind of a hack. Calling this just once doesn't seem to send a click |
77 // event, but doing it twice works. | 77 // event, but doing it twice works. |
78 // http://crbug.com/35581 | 78 // http://crbug.com/35581 |
79 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); | 79 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); |
80 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); | 80 ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS); |
81 | 81 |
82 EXPECT_TRUE(has_been_clicked); | 82 EXPECT_TRUE(has_been_clicked); |
83 } | 83 } |
OLD | NEW |