[scheduler] Add MessageLoopCurrent::IsBoundToCurrentThread.

Address a common pattern of usage by replacing MessageLoopCurrent
comparison with explicit method call.

[email protected]
[email protected]
CC=​[email protected]
BUG=891670

Change-Id: I0f6a7f2c65c9f39dd26abf592dc59efc14b07f57
Reviewed-on: https://chromium-review.googlesource.com/c/1296499
Commit-Queue: Alexander Timin <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Reviewed-by: Gabriel Charette <[email protected]>
Cr-Commit-Position: refs/heads/master@{#603080}
diff --git a/base/observer_list_threadsafe_unittest.cc b/base/observer_list_threadsafe_unittest.cc
index 821315b2b..3134fca7 100644
--- a/base/observer_list_threadsafe_unittest.cc
+++ b/base/observer_list_threadsafe_unittest.cc
@@ -136,10 +136,10 @@
 
     // If we're getting called after we removed ourselves from the list, that is
     // very bad!
-    DCHECK(in_list_);
+    EXPECT_TRUE(in_list_);
 
     // This callback should fire on the appropriate thread
-    EXPECT_EQ(loop_, MessageLoop::current());
+    EXPECT_TRUE(loop_->IsBoundToCurrentThread());
 
     list_->RemoveObserver(this);
     in_list_ = false;