throughput_report_checker.cc 724 B

1234567891011121314151617181920212223242526
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ui/compositor/test/throughput_report_checker.h"
  5. #include "base/time/time.h"
  6. #include "ui/compositor/test/animation_throughput_reporter_test_base.h"
  7. namespace ui {
  8. bool ThroughputReportChecker::WaitUntilReported() {
  9. DCHECK(!reported_);
  10. test_base_->Advance(base::Seconds(5));
  11. return reported_;
  12. }
  13. void ThroughputReportChecker::OnReport(
  14. const cc::FrameSequenceMetrics::CustomReportData&) {
  15. reported_ = true;
  16. if (fail_if_reported_)
  17. ADD_FAILURE() << "It should not be reported.";
  18. test_base_->QuitRunLoop();
  19. }
  20. } // namespace ui