Skip to content

Commit d008bd1

Browse files
authored
Merge pull request NativeScript#2441 from NativeScript/fix-ui-tests-app
Fix ui-tests-app paths and add css-perf-test app
2 parents 3f41a6c + bcc1f34 commit d008bd1

File tree

21 files changed

+457
-47
lines changed

21 files changed

+457
-47
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ before_script:
3939
- adb shell input keyevent 82 &
4040
script:
4141
- jdk_switcher use oraclejdk8
42-
- grunt default &&
42+
- grunt default --verbose &&
4343
FULL_PACKAGE_VERSION=`node -e 'console.log(require("./bin/dist/tns-core-modules/package.json").version);'` &&
4444
(cd build/platform-declarations && grunt) &&
4545
echo no | npm install nativescript@next -g > /dev/null &&
46-
grunt buildOnlyTestsApp --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --runtimeVersion=$RUNTIMEVERSION --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false > /dev/null &&
47-
grunt runOnlyTestsApp --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false
46+
grunt buildOnlyTestsApp --verbose --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --runtimeVersion=$RUNTIMEVERSION --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false > /dev/null &&
47+
grunt runOnlyTestsApp --verbose --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false
4848
- node ./build/travis-scripts/check-testrun-broken.js
4949
- adb pull /data/data/org.nativescript.TestsApp/files/test-results.xml &&
5050
mv test-results.xml ~/test-run-results$PACKAGE_VERSION.xml

apps/app/css-perf-test/app.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import application = require("application");
2+
3+
global.time = function(): number {
4+
if (global.android) {
5+
return java.lang.System.nanoTime() / 1000000; // 1 ms = 1000000 ns
6+
}
7+
else {
8+
return CACurrentMediaTime() * 1000;
9+
}
10+
}
11+
12+
application.start({ moduleName: "css-perf-test/root" });
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.title {
2+
font-size: 20;
3+
margin: 3;
4+
}
5+
6+
.author {
7+
font-size: 14;
8+
horizontal-align: left;
9+
vertical-align: bottom;
10+
margin: 3;
11+
}
12+
13+
.comments {
14+
color: #10C2B0;
15+
font-size: 14;
16+
vertical-align: bottom;
17+
margin: 3;
18+
}
19+
20+
.thumbnail {
21+
width: 72;
22+
height: 72;
23+
margin: 3;
24+
vertical-align: top;
25+
}
26+
27+
TabView {
28+
background-color: white;
29+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {EventData as ObservableEventData} from "data/observable";
2+
3+
export function navigatedTo(args: ObservableEventData) {
4+
setTimeout(() => {
5+
console.log(`Time: ${global.time() - global.startTime} ms`);
6+
});
7+
}

apps/app/css-perf-test/main-page.xml

Lines changed: 307 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.title {
2+
font-size: 20;
3+
margin: 3;
4+
}
5+
6+
.author {
7+
font-size: 14;
8+
horizontal-align: left;
9+
vertical-align: bottom;
10+
margin: 3;
11+
}
12+
13+
.comments {
14+
color: #10C2B0;
15+
font-size: 14;
16+
vertical-align: bottom;
17+
margin: 3;
18+
}
19+
20+
.thumbnail {
21+
width: 72;
22+
height: 72;
23+
margin: 3;
24+
vertical-align: top;
25+
}
26+
27+
TabView {
28+
background-color: white;
29+
}
26.2 KB
Loading

apps/app/css-perf-test/root.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {Page} from "ui/page";
2+
3+
export function onTap(args: any) {
4+
global.startTime = global.time();
5+
let page = <Page>args.object.page;
6+
page.frame.navigate("css-perf-test/main-page");
7+
}

apps/app/css-perf-test/root.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
2+
<Button text="Start test" tap="onTap" />
3+
</Page>

apps/app/fonts/Pacifico.ttf

73.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)