| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/gtk/accessibility_event_router_gtk.h" | |
| 6 #include "chrome/test/testing_profile.h" | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 | |
| 9 class AccessibilityEventRouterGtkTest : public testing::Test { | |
| 10 protected: | |
| 11 AccessibilityEventRouterGtkTest() { } | |
| 12 }; | |
| 13 | |
| 14 TEST_F(AccessibilityEventRouterGtkTest, AddRootWidgetTwice) { | |
| 15 AccessibilityEventRouterGtk* event_router = | |
| 16 AccessibilityEventRouterGtk::GetInstance(); | |
| 17 TestingProfile profile; | |
| 18 | |
| 19 GtkWidget* widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
| 20 | |
| 21 bool found = false; | |
| 22 event_router->FindWidget(widget, NULL, &found); | |
| 23 EXPECT_FALSE(found); | |
| 24 | |
| 25 event_router->AddRootWidget(widget, &profile); | |
| 26 event_router->FindWidget(widget, NULL, &found); | |
| 27 EXPECT_TRUE(found); | |
| 28 | |
| 29 event_router->AddRootWidget(widget, &profile); | |
| 30 event_router->FindWidget(widget, NULL, &found); | |
| 31 EXPECT_TRUE(found); | |
| 32 | |
| 33 event_router->RemoveRootWidget(widget); | |
| 34 event_router->FindWidget(widget, NULL, &found); | |
| 35 EXPECT_TRUE(found); | |
| 36 | |
| 37 event_router->RemoveRootWidget(widget); | |
| 38 event_router->FindWidget(widget, NULL, &found); | |
| 39 EXPECT_FALSE(found); | |
| 40 | |
| 41 gtk_widget_destroy(widget); | |
| 42 }; | |
| OLD | NEW |