chromium/components/viz/test/begin_frame_source_test.h

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_VIZ_TEST_BEGIN_FRAME_SOURCE_TEST_H_
#define COMPONENTS_VIZ_TEST_BEGIN_FRAME_SOURCE_TEST_H_

#include "base/trace_event/traced_value.h"
#include "components/viz/common/frame_sinks/begin_frame_source.h"
#include "components/viz/test/begin_frame_args_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

// Macros to help set up expected calls on the MockBeginFrameObserver.
#define EXPECT_BEGIN_FRAME_DROP(obs, source_id, sequence_number, frame_time, \
                                deadline, interval)

#define EXPECT_BEGIN_FRAME_USED(obs, source_id, sequence_number, frame_time, \
                                deadline, interval)

#define EXPECT_BEGIN_FRAME_USED_MISSED(obs, source_id, sequence_number,        \
                                       frame_time, deadline, interval)

#define EXPECT_BEGIN_FRAME_ARGS_DROP(obs, args)

#define EXPECT_BEGIN_FRAME_ARGS_USED(obs, args)

#define EXPECT_BEGIN_FRAME_SOURCE_PAUSED(obs, paused)

// Macros to send BeginFrameArgs on a FakeBeginFrameSink (and verify
// resulting observer behaviour).
#define SEND_BEGIN_FRAME(args_equal_to, source, sequence_number, frame_time, \
                         deadline, interval)

// When dropping LastUsedBeginFrameArgs **shouldn't** change.
#define SEND_BEGIN_FRAME_DROP(source, sequence_number, frame_time, deadline, \
                              interval)

// When used LastUsedBeginFrameArgs **should** be updated.
#define SEND_BEGIN_FRAME_USED(source, sequence_number, frame_time, deadline, \
                              interval)

namespace viz {

class MockBeginFrameObserver : public BeginFrameObserver {};

}  // namespace viz

#endif  // COMPONENTS_VIZ_TEST_BEGIN_FRAME_SOURCE_TEST_H_