This source file includes following definitions.
- OnClicked
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
#include <gtk/gtk.h>
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/gtk/view_id_util.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
namespace {
const char kSimplePage[] = "/404_is_enough_for_us.html";
void OnClicked(GtkWidget* widget, bool* clicked_bit) {
*clicked_bit = true;
}
}
class BookmarkBarGtkInteractiveUITest : public InProcessBrowserTest {
};
IN_PROC_BROWSER_TEST_F(BookmarkBarGtkInteractiveUITest, FindBarTest) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
chrome::NewTab(browser());
chrome::Find(browser());
GURL url = embedded_test_server()->GetURL(kSimplePage);
chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED);
browser()->tab_strip_model()->ActivateTabAt(1, false);
base::MessageLoop::current()->RunUntilIdle();
chrome::FocusLocationBar(browser());
ui_test_utils::ClickOnView(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD);
ui_test_utils::IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD);
}
IN_PROC_BROWSER_TEST_F(
BookmarkBarGtkInteractiveUITest, DISABLED_ClickOnFloatingTest) {
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
GtkWidget* other_bookmarks =
ViewIDUtil::GetWidget(GTK_WIDGET(browser()->window()->GetNativeWindow()),
VIEW_ID_OTHER_BOOKMARKS);
bool has_been_clicked = false;
g_signal_connect(other_bookmarks, "clicked",
G_CALLBACK(OnClicked), &has_been_clicked);
chrome::NewTab(browser());
base::MessageLoop::current()->RunUntilIdle();
ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS);
ui_test_utils::ClickOnView(browser(), VIEW_ID_OTHER_BOOKMARKS);
EXPECT_TRUE(has_been_clicked);
}