yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::test::TestRecorder Class Reference

#include <test_recorder.h>

Collaboration diagram for yaze::test::TestRecorder:

Classes

struct  RecordedStep
 
struct  RecordingOptions
 
class  ScopedSuspension
 
struct  StopRecordingSummary
 

Public Types

enum class  ActionType {
  kUnknown , kClick , kType , kWait ,
  kAssert , kScreenshot
}
 

Public Member Functions

 TestRecorder (TestManager *test_manager)
 
absl::StatusOr< std::string > Start (const RecordingOptions &options)
 
absl::StatusOr< StopRecordingSummaryStop (const std::string &recording_id, bool discard)
 
void RecordStep (const RecordedStep &step)
 
bool IsRecording () const
 
std::string CurrentRecordingId () const
 
ScopedSuspension Suspend ()
 

Private Member Functions

absl::StatusOr< std::string > StartLocked (const RecordingOptions &options) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_)
 
absl::StatusOr< StopRecordingSummaryStopLocked (const std::string &recording_id, bool discard) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_)
 
void RecordStepLocked (const RecordedStep &step) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_)
 
absl::Status PopulateFinalStatusLocked () ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_)
 
bool recording_ ABSL_GUARDED_BY (mu_)
 
bool suspended_ ABSL_GUARDED_BY (mu_)
 
std::string recording_id_ ABSL_GUARDED_BY (mu_)
 
RecordingOptions options_ ABSL_GUARDED_BY (mu_)
 
absl::Time started_at_ ABSL_GUARDED_BY (mu_)
 
std::vector< RecordedStep > steps_ ABSL_GUARDED_BY (mu_)
 

Static Private Member Functions

static std::string GenerateRecordingId ()
 
static const char * ActionTypeToString (ActionType type)
 

Private Attributes

absl::Mutex mu_
 
TestManager *const test_manager_
 

Detailed Description

Definition at line 21 of file test_recorder.h.

Member Enumeration Documentation

◆ ActionType

Enumerator
kUnknown 
kClick 
kType 
kWait 
kAssert 
kScreenshot 

Definition at line 23 of file test_recorder.h.

Constructor & Destructor Documentation

◆ TestRecorder()

yaze::test::TestRecorder::TestRecorder ( TestManager test_manager)
explicit

Definition at line 54 of file test_recorder.cc.

Member Function Documentation

◆ Start()

absl::StatusOr< std::string > yaze::test::TestRecorder::Start ( const RecordingOptions options)

Definition at line 57 of file test_recorder.cc.

References mu_, and StartLocked().

Here is the call graph for this function:

◆ Stop()

absl::StatusOr< TestRecorder::StopRecordingSummary > yaze::test::TestRecorder::Stop ( const std::string &  recording_id,
bool  discard 
)

Definition at line 63 of file test_recorder.cc.

References mu_, and StopLocked().

Here is the call graph for this function:

◆ RecordStep()

void yaze::test::TestRecorder::RecordStep ( const RecordedStep step)

Definition at line 69 of file test_recorder.cc.

References mu_, and RecordStepLocked().

Here is the call graph for this function:

◆ IsRecording()

bool yaze::test::TestRecorder::IsRecording ( ) const

Definition at line 74 of file test_recorder.cc.

References mu_.

◆ CurrentRecordingId()

std::string yaze::test::TestRecorder::CurrentRecordingId ( ) const

Definition at line 79 of file test_recorder.cc.

References mu_.

◆ Suspend()

TestRecorder::ScopedSuspension yaze::test::TestRecorder::Suspend ( )

Definition at line 84 of file test_recorder.cc.

References mu_.

◆ StartLocked()

absl::StatusOr< std::string > yaze::test::TestRecorder::StartLocked ( const RecordingOptions options)
private

◆ StopLocked()

◆ RecordStepLocked()

void yaze::test::TestRecorder::RecordStepLocked ( const RecordedStep step)
private

Definition at line 187 of file test_recorder.cc.

References yaze::test::TestRecorder::RecordedStep::captured_at.

Referenced by RecordStep().

◆ PopulateFinalStatusLocked()

absl::Status yaze::test::TestRecorder::PopulateFinalStatusLocked ( )
private

Definition at line 198 of file test_recorder.cc.

References test_manager_.

Referenced by StopLocked().

◆ GenerateRecordingId()

std::string yaze::test::TestRecorder::GenerateRecordingId ( )
staticprivate

Definition at line 238 of file test_recorder.cc.

Referenced by StartLocked().

◆ ActionTypeToString()

const char * yaze::test::TestRecorder::ActionTypeToString ( ActionType  type)
staticprivate

Definition at line 244 of file test_recorder.cc.

References kAssert, kClick, kScreenshot, kType, kUnknown, and kWait.

Referenced by StopLocked().

◆ ABSL_GUARDED_BY() [1/6]

bool recording_ yaze::test::TestRecorder::ABSL_GUARDED_BY ( mu_  )
private

◆ ABSL_GUARDED_BY() [2/6]

bool suspended_ yaze::test::TestRecorder::ABSL_GUARDED_BY ( mu_  )
private

◆ ABSL_GUARDED_BY() [3/6]

std::string recording_id_ yaze::test::TestRecorder::ABSL_GUARDED_BY ( mu_  )
private

◆ ABSL_GUARDED_BY() [4/6]

RecordingOptions options_ yaze::test::TestRecorder::ABSL_GUARDED_BY ( mu_  )
private

◆ ABSL_GUARDED_BY() [5/6]

absl::Time started_at_ yaze::test::TestRecorder::ABSL_GUARDED_BY ( mu_  )
private

◆ ABSL_GUARDED_BY() [6/6]

std::vector< RecordedStep > steps_ yaze::test::TestRecorder::ABSL_GUARDED_BY ( mu_  )
private

Member Data Documentation

◆ mu_

absl::Mutex yaze::test::TestRecorder::mu_
mutableprivate

Definition at line 110 of file test_recorder.h.

Referenced by CurrentRecordingId(), IsRecording(), RecordStep(), Start(), Stop(), and Suspend().

◆ test_manager_

TestManager* const yaze::test::TestRecorder::test_manager_
private

Definition at line 111 of file test_recorder.h.

Referenced by PopulateFinalStatusLocked(), and StartLocked().


The documentation for this class was generated from the following files: