diff --git a/modules/benchmarks/e2e_test/page_load_perf.dart b/modules/benchmarks/e2e_test/page_load_perf.dart new file mode 100644 index 0000000000..4b036c58d9 --- /dev/null +++ b/modules/benchmarks/e2e_test/page_load_perf.dart @@ -0,0 +1,3 @@ +library benchmarks.e2e_test.page_load_perf; + +main() {} diff --git a/modules/benchmarks/e2e_test/page_load_perf.ts b/modules/benchmarks/e2e_test/page_load_perf.ts new file mode 100644 index 0000000000..b3aba2fb22 --- /dev/null +++ b/modules/benchmarks/e2e_test/page_load_perf.ts @@ -0,0 +1,37 @@ +import {verifyNoBrowserErrors} from 'angular2/src/testing/perf_util'; + +describe('ng2 largetable benchmark', function() { + + var URL = 'benchmarks/src/page_load/page_load.html'; + var runner = global['benchpressRunner']; + + afterEach(verifyNoBrowserErrors); + + + it('should log the load time', function(done) { + runner.sample({ + id: 'loadTime', + prepare: null, + microMetrics: null, + userMetrics: + {loadTime: 'The time in milliseconds to bootstrap', someConstant: 'Some constant'}, + bindings: [ + benchpress.bind(benchpress.SizeValidator.SAMPLE_SIZE) + .toValue(2), + benchpress.bind(benchpress.RegressionSlopeValidator.SAMPLE_SIZE).toValue(2), + benchpress.bind(benchpress.RegressionSlopeValidator.METRIC).toValue('someConstant') + ], + execute: () => { browser.get(URL); } + }) + .then(report => { + expect(report.completeSample.map(val => val.values.someConstant) + .every(v => v === 1234567890)) + .toBe(true); + expect(report.completeSample.map(val => val.values.loadTime) + .filter(t => typeof t === 'number' && t > 0) + .length) + .toBeGreaterThan(1); + }) + .then(done); + }); +}); diff --git a/modules/benchmarks/pubspec.yaml b/modules/benchmarks/pubspec.yaml index 4386acff02..cfef72a9bb 100644 --- a/modules/benchmarks/pubspec.yaml +++ b/modules/benchmarks/pubspec.yaml @@ -26,6 +26,7 @@ transformers: - web/src/naive_infinite_scroll/index.dart - web/src/static_tree/tree_benchmark.dart - web/src/tree/tree_benchmark.dart + - web/src/page_load/page_load.dart - $dart2js: $include: web/src/** minify: false diff --git a/modules/benchmarks/src/index.html b/modules/benchmarks/src/index.html index dd9adf88bb..474efd51ca 100644 --- a/modules/benchmarks/src/index.html +++ b/modules/benchmarks/src/index.html @@ -29,6 +29,9 @@