Test

Description

Supported Script Types:

  • Interface Scripts
Here's how you could use the Test API:
  • Write a script using the below and launch interface with: interface --testScript path/to/script.js
  • Save the recorded events with Test.stopTracing to a .json or .json.gz file
  • Open Chrome, visit chrome://tracing and load your file

Methods

Name Return Value Summary
clear None

Clears all caches

clearCaches None

Clear all caches (menu command Reload Content)

endTraceEvent None

Stop a specific name event

getOtherAvatarsReplicaCount number

Return the number of replicas that are being created of other-avatars when entering a domain

isTextureLoadingComplete boolean

Check whether all textures have been loaded

loadTestScene None

Waits for all pending downloads, parsing and texture transfers to be complete

quit None

Exits the application

saveObject None

Save a JSON object to a file in the test results location

savePhysicsSimulationStats None

Write detailed timing stats of next physics stepSimulation() to filename

savePhysicsSimulationStats None

Profiles a specific function

setMinimumGPUTextureMemStabilityCount None

Set number of cycles texture size is required to be stable

setOtherAvatarsReplicaCount None

Values higher than 0 will create replicas of other-avatars when entering a domain for testing purpouses

showMaximized None

Maximizes the window

startTraceEvent None

Starts a specific trace event

startTracing None

Start recording Chrome compatible tracing events
logrules can be used to specify a set of logging category rules to limit what gets captured

stopTracing bool

Stop recording Chrome compatible tracing events and serialize recorded events to a file
Using a filename with .gz extension will automatically compress the output file

wait None

Waits a specific number of milliseconds

waitForConnection None

Waits for establishment of connection to server

waitForDownloadIdle None

Waits for all pending downloads to be complete

waitForProcessingIdle None

Waits for all file parsing operations to be complete

waitForTextureIdle None

Waits for all texture transfers to be complete

waitIdle None

Waits for all pending downloads, parsing and texture transfers to be complete

Method Details

(static) clear( )

Clears all caches

(static) clearCaches( )

Clear all caches (menu command Reload Content)

(static) endTraceEvent( name )

Stop a specific name event

Parameters

Name Type Description
name string

Name of event

(static) getOtherAvatarsReplicaCount( ) → {number}
Returns: Current number of replicas of other-avatars.

Return the number of replicas that are being created of other-avatars when entering a domain

(static) isTextureLoadingComplete( ) → {boolean}
Returns: true texture memory usage is not increasing

Check whether all textures have been loaded

(static) loadTestScene( sceneFile )

Waits for all pending downloads, parsing and texture transfers to be complete

Parameters

Name Type Description
sceneFile string

URL of scene to load

(static) quit( )

Exits the application

(static) saveObject( name, filename )

Save a JSON object to a file in the test results location

Parameters

Name Type Description
name string

Name of the object

filename string

Name of file to save to

(static) savePhysicsSimulationStats( filename )

Write detailed timing stats of next physics stepSimulation() to filename

Parameters

Name Type Description
filename string

Name of file to save to

(static) savePhysicsSimulationStats( name, function )

Profiles a specific function

Parameters

Name Type Description
name string

Name used to reference the function

function function

Function to profile

(static) setMinimumGPUTextureMemStabilityCount( count )

Set number of cycles texture size is required to be stable

Parameters

Name Type Description
count number

Number of cycles to wait

(static) setOtherAvatarsReplicaCount( count )

Values higher than 0 will create replicas of other-avatars when entering a domain for testing purpouses

Parameters

Name Type Description
count number

Number of replicas we want to create

(static) showMaximized( )

Maximizes the window

(static) startTraceEvent( name )

Starts a specific trace event

Parameters

Name Type Description
name string

Name of event

(static) startTracing( logrulesopt )

Start recording Chrome compatible tracing events
logrules can be used to specify a set of logging category rules to limit what gets captured

Parameters

Name Type Attributes Default Value Description
logrules string <optional>
""

See implementation for explanation

(static) stopTracing( filename ) → {bool}
Returns: True if successful.

Stop recording Chrome compatible tracing events and serialize recorded events to a file
Using a filename with .gz extension will automatically compress the output file

Parameters

Name Type Description
filename string

Name of file to save to ending with .json or .json.gz

(static) wait( milliseconds )

Waits a specific number of milliseconds

Parameters

Name Type Description
milliseconds number

Number of milliseconds to wait

(static) waitForConnection( maxWaitMsopt )

Waits for establishment of connection to server

Parameters

Name Type Attributes Default Value Description
maxWaitMs number <optional>
10000

Number of milliseconds to wait

(static) waitForDownloadIdle( )

Waits for all pending downloads to be complete

(static) waitForProcessingIdle( )

Waits for all file parsing operations to be complete

(static) waitForTextureIdle( )

Waits for all texture transfers to be complete

(static) waitIdle( )

Waits for all pending downloads, parsing and texture transfers to be complete