Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1257)

Unified Diff: message_loop/message_pump_libevent_unittest.cc

Issue 1951103002: Fix build on non-X11 platforms. (Closed) Base URL: git@github.com:domokit/base.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: message_loop/message_pump_libevent_unittest.cc
diff --git a/message_loop/message_pump_libevent_unittest.cc b/message_loop/message_pump_libevent_unittest.cc
index 16aba35353d2e63c6652659006b25eb01aa2ca80..d356d6813655783d16e8b5ca6c3061237cab26a3 100644
--- a/message_loop/message_pump_libevent_unittest.cc
+++ b/message_loop/message_pump_libevent_unittest.cc
@@ -290,19 +290,21 @@ class FakeEventSource : public MessagePumpLibevent::EventSource {
uint32_t work_units_;
};
-TEST_F(MessagePumpLibeventTest, PollEventSource) {
+TEST(MessagePumpLibeventEventSourceTest, Poll) {
+ MessagePumpLibevent* pump = new MessagePumpLibevent; // owned by |loop|.
+ MessageLoop loop(make_scoped_ptr(pump));
FakeEventSource event_source;
// Verify event source gets polled repeatedly until no work remains.
- MessageLoopForUI::current()->SetEventSource(&event_source);
+ pump->SetEventSource(&event_source);
event_source.set_work_units(5u);
- ui_loop_->RunUntilIdle();
+ loop.RunUntilIdle();
EXPECT_EQ(0u, event_source.work_units());
// After removing the event source, it should no longer be polled.
- MessageLoopForUI::current()->ClearEventSource();
+ pump->ClearEventSource();
event_source.set_work_units(5u);
- ui_loop_->RunUntilIdle();
+ loop.RunUntilIdle();
EXPECT_EQ(5u, event_source.work_units());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698