mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Performance test pages
This commit is contained in:
@@ -128,6 +128,9 @@
|
||||
<TypeScriptCompile Include="apps\tests\layouts\dock-layout-tests.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\pages\app.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\pages\file-load-test.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\pages\page-load-performance\start.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\pages\page-load-performance\test-big.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\pages\page-load-performance\test-small.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\pages\page12.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\layouts\absolute-layout-tests.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\layouts\layout-helper.ts" />
|
||||
@@ -609,6 +612,13 @@
|
||||
<Content Include="apps\TelerikNEXT\images\background.jpg" />
|
||||
<Content Include="apps\template-settings\app.css" />
|
||||
<Content Include="apps\tests\app\location-example.xml" />
|
||||
<Content Include="apps\tests\pages\page-load-performance\start.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="apps\tests\pages\page-load-performance\test-big.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="apps\tests\pages\page-load-performance\test-small.xml" />
|
||||
<Content Include="apps\tests\pages\page18.xml" />
|
||||
<Content Include="apps\tests\ui\bindingContext_testPage.xml" />
|
||||
<Content Include="apps\tests\ui\bindingContext_testPage1.xml" />
|
||||
|
||||
12
apps/tests/pages/performance-test/start.ts
Normal file
12
apps/tests/pages/performance-test/start.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import frame = require("ui/frame");
|
||||
import observable = require("data/observable");
|
||||
|
||||
declare function __startCPUProfiler(name: string);
|
||||
|
||||
export function navigate(args: observable.EventData) {
|
||||
var tag = "" + args.object.get("tag");
|
||||
__startCPUProfiler("xml-performance-" + tag);
|
||||
frame.topmost().navigate({
|
||||
moduleName: tag,
|
||||
});
|
||||
}
|
||||
7
apps/tests/pages/performance-test/start.xml
Normal file
7
apps/tests/pages/performance-test/start.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<Page loaded="pageLoaded" >
|
||||
<StackLayout>
|
||||
<Button text="test small" tag="test-small" tap="navigate" />
|
||||
<Button text="test big" tag="test-big" tap="navigate" />
|
||||
<Button text="telerik next session" tag="telerik-next-session" tap="navigate" />
|
||||
</StackLayout>
|
||||
</Page>
|
||||
7
apps/tests/pages/performance-test/test-big.ts
Normal file
7
apps/tests/pages/performance-test/test-big.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import observable = require("data/observable");
|
||||
|
||||
declare function __stopCPUProfiler(name: string);
|
||||
|
||||
export function pageLoaded(args: observable.EventData) {
|
||||
__stopCPUProfiler("xml-performance-test-big");
|
||||
}
|
||||
54
apps/tests/pages/performance-test/test-big.xml
Normal file
54
apps/tests/pages/performance-test/test-big.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<Page loaded="pageLoaded" unloaded="pageUnloaded" backgroundColor="red">
|
||||
<StackLayout>
|
||||
<StackLayout>
|
||||
<Button text="1button1" />
|
||||
<Button text="1button2" />
|
||||
<Button text="1button3" />
|
||||
<Button text="1button4" />
|
||||
<Button text="1button5" />
|
||||
<Button text="1button6" />
|
||||
<Button text="1button7" />
|
||||
<Button text="1button8" />
|
||||
</StackLayout>
|
||||
<StackLayout>
|
||||
<Button text="2button1" />
|
||||
<Button text="2button2" />
|
||||
<Button text="2button3" />
|
||||
<Button text="2button4" />
|
||||
<Button text="2button5" />
|
||||
<Button text="2button6" />
|
||||
<Button text="2button7" />
|
||||
<Button text="2button8" />
|
||||
</StackLayout>
|
||||
<StackLayout>
|
||||
<Button text="3button1" />
|
||||
<Button text="3button2" />
|
||||
<Button text="3button3" />
|
||||
<Button text="3button4" />
|
||||
<Button text="3button5" />
|
||||
<Button text="3button6" />
|
||||
<Button text="3button7" />
|
||||
<Button text="3button8" />
|
||||
</StackLayout>
|
||||
<StackLayout>
|
||||
<Button text="4button1" />
|
||||
<Button text="4button2" />
|
||||
<Button text="4button3" />
|
||||
<Button text="4button4" />
|
||||
<Button text="4button5" />
|
||||
<Button text="4button6" />
|
||||
<Button text="4button7" />
|
||||
<Button text="4button8" />
|
||||
</StackLayout>
|
||||
<StackLayout>
|
||||
<Button text="5button1" />
|
||||
<Button text="5button2" />
|
||||
<Button text="5button3" />
|
||||
<Button text="5button4" />
|
||||
<Button text="5button5" />
|
||||
<Button text="5button6" />
|
||||
<Button text="5button7" />
|
||||
<Button text="5button8" />
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
7
apps/tests/pages/performance-test/test-small.ts
Normal file
7
apps/tests/pages/performance-test/test-small.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import observable = require("data/observable");
|
||||
|
||||
declare function __stopCPUProfiler(name: string);
|
||||
|
||||
export function pageLoaded(args: observable.EventData) {
|
||||
__stopCPUProfiler("xml-performance-test-small");
|
||||
}
|
||||
12
apps/tests/pages/performance-test/test-small.xml
Normal file
12
apps/tests/pages/performance-test/test-small.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Page loaded="pageLoaded" unloaded="pageUnloaded" backgroundColor="green">
|
||||
<StackLayout>
|
||||
<Button text="button1" />
|
||||
<Button text="button2" />
|
||||
<Button text="button3" />
|
||||
<Button text="button4" />
|
||||
<Button text="button5" />
|
||||
<Button text="button6" />
|
||||
<Button text="button7" />
|
||||
<Button text="button8" />
|
||||
</StackLayout>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user