Index: cc/test/scheduler_test_common.h |
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h |
index ce6ccc4789107ff75f2d888b0ab167d47eba5923..48893f9bb1d8ad5191bde07c342f3092282ed9fe 100644 |
--- a/cc/test/scheduler_test_common.h |
+++ b/cc/test/scheduler_test_common.h |
@@ -92,11 +92,21 @@ class FakeBeginFrameSource : public BeginFrameSourceBase { |
FakeBeginFrameSource() : remaining_frames_(false) {} |
~FakeBeginFrameSource() override {} |
- BeginFrameObserver* GetObserver() { return observer_; } |
+ BeginFrameObserver* GetObserver() { |
+ if ((observer_list_).might_have_observers()) { |
+ base::ObserverList<BeginFrameObserver>::Iterator it(&observer_list_); |
+ BeginFrameObserver* obs; |
+ while ((obs = it.GetNext()) != nullptr) { |
+ return obs; |
+ } |
+ } |
+ return nullptr; |
+ } |
BeginFrameArgs TestLastUsedBeginFrameArgs() { |
- if (observer_) { |
- return observer_->LastUsedBeginFrameArgs(); |
+ BeginFrameObserver* obs = GetObserver(); |
+ if (obs) { |
+ return obs->LastUsedBeginFrameArgs(); |
} |
return BeginFrameArgs(); |
} |