Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
org.skia.skqp.SkQPActivity Class Reference
Inheritance diagram for org.skia.skqp.SkQPActivity:

Public Member Functions

void run ()
 

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 

Detailed Description

Definition at line 12 of file SkQPActivity.java.

Member Function Documentation

◆ onCreate()

void org.skia.skqp.SkQPActivity.onCreate ( Bundle  savedInstanceState)
inlineprotected

Definition at line 14 of file SkQPActivity.java.

14 {
15 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_skqp);
17 Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
18 setSupportActionBar(toolbar);
19
20 // Start the tests.
21 run();
22 }
#define R(r)

◆ run()

void org.skia.skqp.SkQPActivity.run ( )
inline

Definition at line 25 of file SkQPActivity.java.

25 {
26 // Note: /sdcard/Android/data/<package-name> is a location an app is allowed to write to.
27 // When running tests on Firebase it expects any result files to have a '/sdcard
28 // prefix or it won't trigger tests from the CLI.
29
30 Context context = getApplicationContext();
31 String outputDirPath = "/sdcard/Android/data/" + context.getPackageName();
32 SkQP impl = new SkQP();
33
34 Log.i(SkQP.LOG_PREFIX, "Output Dir: " + outputDirPath);
35 File outputDir = new File(outputDirPath);
36 try {
37 SkQPActivity.ensureEmptyDirectory(outputDir);
38 } catch (IOException e) {
39 Log.e(SkQP.LOG_PREFIX, "ensureEmptyDirectory:" + e.getMessage());
40 }
41
42 // Note: nInit will initialize the mUnitTests field.
43 AssetManager assetManager = context.getResources().getAssets();
44 impl.nInit(assetManager, outputDirPath);
45
46 for (int unitTest = 0; unitTest < impl.mUnitTests.length; unitTest++) {
47 String testName = SkQP.kSkiaUnitTests + "_" + impl.mUnitTests[unitTest];
48 Log.w(SkQP.LOG_PREFIX, "Running: " + testName);
49 String[] errors = impl.nExecuteUnitTest(unitTest);
50 if (errors != null && errors.length > 0) {
51 for (String error : errors) {
52 Log.w(SkQP.LOG_PREFIX, "Error running " + testName + ":" + error);
53 }
54 } else {
55 Log.i(SkQP.LOG_PREFIX, "Test: " + testName + " finished successfully.");
56 }
57 }
58 Log.i(SkQP.LOG_PREFIX, "Finished running all tests.");
59 impl.nMakeReport();
60
61 finish();
62 }
Definition skqp.h:42
const uint8_t uint32_t uint32_t GError ** error
void Log(const char *format,...) SK_PRINTF_LIKE(1

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