| Index: base/message_pump_glib_unittest.cc
|
| ===================================================================
|
| --- base/message_pump_glib_unittest.cc (revision 102014)
|
| +++ base/message_pump_glib_unittest.cc (working copy)
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "base/message_pump_glib.h"
|
|
|
| +#include <gtk/gtk.h>
|
| #include <math.h>
|
|
|
| #include <algorithm>
|
| @@ -14,10 +15,6 @@
|
| #include "base/threading/thread.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| -#if defined(TOOLKIT_USES_GTK)
|
| -#include <gtk/gtk.h>
|
| -#endif
|
| -
|
| namespace {
|
|
|
| // This class injects dummy "events" into the GLib loop. When "handled" these
|
| @@ -398,7 +395,6 @@
|
|
|
| namespace {
|
|
|
| -#if defined(TOOLKIT_USES_GTK)
|
| void AddEventsAndDrainGtk(EventInjector* injector) {
|
| // Add a couple of dummy events
|
| injector->AddEvent(0, NULL);
|
| @@ -415,11 +411,9 @@
|
| gtk_main_iteration();
|
| }
|
| }
|
| -#endif
|
|
|
| } // namespace
|
|
|
| -#if defined(TOOLKIT_USES_GTK)
|
| TEST_F(MessagePumpGLibTest, TestDrainingGtk) {
|
| // Tests that draining events using Gtk works.
|
| loop()->PostTask(
|
| @@ -428,7 +422,6 @@
|
|
|
| EXPECT_EQ(3, injector()->processed_events());
|
| }
|
| -#endif
|
|
|
| namespace {
|
|
|
| @@ -443,16 +436,10 @@
|
| }
|
| }
|
|
|
| - void RunLoop() {
|
| -#if defined(TOOLKIT_USES_GTK)
|
| + void RunGtk() {
|
| while (!quit_) {
|
| gtk_main_iteration();
|
| }
|
| -#else
|
| - while (!quit_) {
|
| - g_main_context_iteration(NULL, TRUE);
|
| - }
|
| -#endif
|
| }
|
|
|
| void Quit() {
|
| @@ -526,7 +513,7 @@
|
| FROM_HERE, NewRunnableMethod(runner.get(), &GLibLoopRunner::Quit), 40);
|
|
|
| // Run a nested, straight Gtk message loop.
|
| - runner->RunLoop();
|
| + runner->RunGtk();
|
|
|
| ASSERT_EQ(3, task_count);
|
| EXPECT_EQ(4, injector->processed_events());
|
|
|