Skip to content

Commit 08f9a21

Browse files
committed
add benchmarks
1 parent 8a9bc01 commit 08f9a21

File tree

4 files changed

+16250
-3
lines changed

4 files changed

+16250
-3
lines changed

test-app/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
android:name="com.tns.ErrorReportActivity"
2727
android:label="ErrorActivity">
2828
</activity>
29+
<profileable android:shell="true"/>
2930
</application>
3031

3132
</manifest>

test-app/app/src/main/assets/app/MyActivity.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}
2222
}
2323
*/
24+
const benchmarkRunner = require("./benchmark.js");
2425
var MyActivity = (function (_super) {
2526
__extends(MyActivity, _super);
2627
function MyActivity() {
@@ -30,18 +31,23 @@ var MyActivity = (function (_super) {
3031
_super.prototype.onCreate.call(this, bundle);
3132
require('./tests/testsWithContext').run(this);
3233
//run jasmine
33-
execute();
34+
// execute();
3435
var layout = new android.widget.LinearLayout(this);
3536
layout.setOrientation(1);
3637
this.setContentView(layout);
3738
var textView = new android.widget.TextView(this);
3839
textView.setText("It's a button!");
40+
textView.setTextIsSelectable(true);
3941
layout.addView(textView);
4042

4143
var button = new android.widget.Button(this);
4244
button.setText("Hit me");
4345
layout.addView(button);
4446

47+
var button2 = new android.widget.Button(this);
48+
button2.setText("Run Benchmark");
49+
layout.addView(button2);
50+
4551
var Color = android.graphics.Color;
4652
var colors = [
4753
Color.BLUE,
@@ -62,6 +68,17 @@ var MyActivity = (function (_super) {
6268
},
6369
})
6470
);
71+
button2.setOnClickListener(
72+
new android.view.View.OnClickListener("AppClickListener", {
73+
onClick: function () {
74+
const result = benchmarkRunner.runBenchmark();
75+
setTimeout(() => {
76+
globalThis.gc();
77+
});
78+
textView.setText(result);
79+
},
80+
})
81+
);
6582
};
6683
MyActivity = __decorate(
6784
[JavaProxy("com.tns.NativeScriptActivity")],

0 commit comments

Comments
 (0)