libchromeos: MessageLoop implementation using base::MessageLoopForIO.

The new chromeos::BaseMessageLoop implementation uses the existing
base::MessageLoopForIO implementation, that in the Linux and ChromeOS
context uses base::MessagePumpLibevent, a libevent based implementation.

This chromeos::MessageLoop allows to mix calls to base::MessageLoopForIO
and chromeos::MessageLoop with few limitations. This is useful when using
other code in libchrome that already interacts with libchrome's
MessageLoopForIO.

Among the limitations, the support for canceling a task will not free
the memory associated with the delayed event until it actually fires.
Also, base::MessagePumpLibevent uses epoll(7) which doesn't support
watching for file descriptors that would not naturally block (such as
regular files). Attempting to watch for those file descriptors will
return kTaskIdNull in this implementation, but would work on
chromeos::GlibMessageLoop.

This patch moves most of chromeos::GlibMessageLoop existing tests to a
common chromeos::MessageLoop test that runs for both implementations.

BUG=chromium:506052
TEST=Added unittests.

Change-Id: I4553d149511806ed599fa2847af4372985456106
Reviewed-on: https://chromium-review.googlesource.com/285217
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/chromeos/message_loops/fake_message_loop.h b/chromeos/message_loops/fake_message_loop.h
index 4d6e7ca..e9f0c51 100644
--- a/chromeos/message_loops/fake_message_loop.h
+++ b/chromeos/message_loops/fake_message_loop.h
@@ -37,14 +37,14 @@
   ~FakeMessageLoop() override = default;
 
   TaskId PostDelayedTask(const tracked_objects::Location& from_here,
-                         const base::Closure &task,
+                         const base::Closure& task,
                          base::TimeDelta delay) override;
   using MessageLoop::PostDelayedTask;
   TaskId WatchFileDescriptor(const tracked_objects::Location& from_here,
                              int fd,
                              WatchMode mode,
                              bool persistent,
-                             const base::Closure &task) override;
+                             const base::Closure& task) override;
   using MessageLoop::WatchFileDescriptor;
   bool CancelTask(TaskId task_id) override;
   bool RunOnce(bool may_block) override;