class TraceManagerTest
Defined at line 28 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
Public Members
static const unsigned int kDefaultBufferSizeMegabytes
static const unsigned int kDefaultStartTimeoutMilliseconds
static const char[] kConfigFile
static const char[] kTestUmbrellaCategory
static const zx_koid_t kProvider1Pid
static const char[] kProvider1Name
static const zx_koid_t kProvider2Pid
static const char[] kProvider2Name
static const zx_koid_t kProvider3Pid
static const char[] kProvider3Name
Public Methods
fuchsia_tracing_controller::TraceConfig GetDefaultTraceConfig ()
static
Defined at line 94 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void TraceManagerTest ()
Defined at line 15 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void ConnectToProvisionerService ()
Defined at line 33 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void DisconnectFromControllerService ()
Defined at line 43 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
bool AddFakeProvider (zx_koid_t pid, const std::string & name, FakeProvider ** out_provider)
The caller must run the loop to complete the registration.
If |*out_provider| is non-NULL, a borrowed copy of the pointer is
stored there, and is valid for the duration of the test.
Defined at line 48 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
const TraceManager * trace_manager ()
Defined at line 74 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
SessionState GetSessionState ()
Fetch the session's state.
Defined at line 74 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
sys::testing::ComponentContextProvider & context_provider ()
Defined at line 76 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
fidl::Client<fuchsia_tracing_controller::Session> & session_client ()
Defined at line 78 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
fidl::Client<fuchsia_tracing_controller::Provisioner> & provisioner_client ()
Defined at line 80 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
void handle_unknown_event (fidl::UnknownEventMetadata<fuchsia_tracing_controller::Session> metadata)
Defined at line 84 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
int on_session_state_change_event_count ()
Defined at line 87 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
int begin_session_state_change_event_count ()
Defined at line 88 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
fuchsia_tracing_controller::SessionState last_session_state_event ()
Defined at line 91 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
const std::vector<std::unique_ptr<FakeProviderBinding>> & fake_provider_bindings ()
Defined at line 95 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
void MarkBeginOperation ()
Mark the beginning of an operation.
Defined at line 115 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
fuchsia_tracing_controller::StartOptions GetDefaultStartOptions ()
static
Defined at line 148 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
fuchsia_tracing_controller::StopOptions GetDefaultStopOptions ()
static
Defined at line 231 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void OnSessionStateChange ()
Called from within |TraceManager| on |TraceSession| state changes.
bool InitializeSession (fuchsia_tracing_controller::TraceConfig config)
Wrappers to simplify the standard operations.
These are only to be called at times when they're expected to succeed.
E.g., Don't call |TerminateSession()| if session is already terminated,
and so on. If you want to perform these operations outside of this
constraint, roll your own or use something else.
These assume the controller connection is already made.
The default session doesn't have a consumer.
Defined at line 137 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
bool TerminateSession ()
Defined at line 352 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void BeginTerminateSession ()
Terminating a session involves two steps: Initiating the termination
and waiting for it to terminate. Call these when you want to access
intermediate state.
Defined at line 312 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
bool FinishTerminateSession ()
Returns true on success.
If |result| is non-NULL the result is stored there.
Defined at line 326 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
bool StartSession (fuchsia_tracing_controller::StartOptions options)
Wrappers to simplify |Start,Stop| operations.
These are only to be called at times when they're expected to succeed.
E.g., Don't call |StartSession*()| if session is already started,
and so on. If you want to perform these operations outside of this
constraint, roll your own or use something else.
These assume the needed interface is already connected.
These combine both the "begin" and "finish" operations.
Defined at line 225 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
bool StopSession (fuchsia_tracing_controller::StopOptions options)
Defined at line 307 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void BeginStartSession (fuchsia_tracing_controller::StartOptions options)
Starting and stopping a session involves two steps: initiating the request
and waiting for it to complete. Call these when you want to access
intermediate state.
Defined at line 156 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void QuitLoop ()
Publically accessible copies of test fixture methods.
Defined at line 169 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
void RunLoopUntilIdle ()
Defined at line 170 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
void RunLoopFor (zx::duration duration)
Defined at line 171 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
void DropSocket ()
Defined at line 175 of file ../../src/performance/trace_manager/tests/trace_manager_test.h
bool FinishStartSession ()
Defined at line 182 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void BeginStopSession (fuchsia_tracing_controller::StopOptions options)
Defined at line 237 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
bool FinishStopSession ()
Defined at line 266 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void MarkAllProvidersStarted ()
Helpers to advance provider state.
These can only be called when all providers are in the immediately
preceding state (e.g., kStarting->kStarted).
Defined at line 357 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void MarkAllProvidersStopped ()
Defined at line 364 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void MarkAllProvidersTerminated ()
Defined at line 371 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
void VerifyCounts (int expected_start_count, int expected_stop_count)
Helper to verify reception and processing of initialize, start, stop,
and terminate fidl requests.
This is not intended to be called before |Initialize*|.
Defined at line 378 of file ../../src/performance/trace_manager/tests/trace_manager_test.cc
Enumerations
enum SessionState
| Name | Value |
|---|---|
| kReady | 0 |
| kInitialized | 1 |
| kStarting | 2 |
| kStarted | 3 |
| kStopping | 4 |
| kStopped | 5 |
| kTerminating | 6 |
| kNonexistent | 7 |
|TraceSession| intentionally doesn't have |kTerminated| as that is
represented by the session being non-existent. However, it's helpful in
tests to have a value to represent this state so we have our own copy of
|TraceSession::State|. It is not named |State| to help avoid confusion.
Defined at line 35 of file ../../src/performance/trace_manager/tests/trace_manager_test.h