diff --git a/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.es6 b/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.es6 index 3a898099fd..9efa10b361 100644 --- a/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.es6 +++ b/modules/benchmarks/e2e_test/naive_infinite_scroll_perf.es6 @@ -13,8 +13,8 @@ describe('ng2 naive infinite scroll benchmark', function () { url: URL, id: 'ng2.naive_infinite_scroll', work: function() { - element(by.deepCss('#reset-btn')).click(); - element(by.deepCss('#run-btn')).click(); + $('#reset-btn').click(); + $('#run-btn').click(); browser.wait(() => { return $('#done').getText().then( function() { return true; }, diff --git a/modules/benchmarks/e2e_test/naive_infinite_scroll_spec.es6 b/modules/benchmarks/e2e_test/naive_infinite_scroll_spec.es6 index 9170ee49c7..f5ca6b9e83 100644 --- a/modules/benchmarks/e2e_test/naive_infinite_scroll_spec.es6 +++ b/modules/benchmarks/e2e_test/naive_infinite_scroll_spec.es6 @@ -53,10 +53,8 @@ describe('ng2 naive infinite scroll benchmark', function () { }); }) - browser.executeScript( - 'document.querySelector("scroll-app /deep/ #reset-btn").click()'); - browser.executeScript( - 'document.querySelector("scroll-app /deep/ #run-btn").click()'); + $("#reset-btn").click(); + $("#run-btn").click(); browser.wait(() => { return $('#done').getText().then( function() { return true; }, diff --git a/modules/benchmarks/src/naive_infinite_scroll/app.js b/modules/benchmarks/src/naive_infinite_scroll/app.js index b6494012ba..44662e6bca 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/app.js +++ b/modules/benchmarks/src/naive_infinite_scroll/app.js @@ -23,11 +23,10 @@ export class App { for (var i = 0; i < appSize; i++) { ListWrapper.push(this.scrollAreas, i); } - // TODO(tbosch): change to bindAction when it works in pub serve - DOM.on(DOM.query('scroll-app /deep/ #run-btn'), 'click', (_) => { + bindAction('#run-btn', () => { this.runBenchmark(); }); - DOM.on(DOM.query('scroll-app /deep/ #reset-btn'), 'click', (_) => { + bindAction('#reset-btn', () => { this._getScrollDiv().scrollTop = 0; var existingMarker = this._locateFinishedMarker(); if (isPresent(existingMarker)) { @@ -90,10 +89,6 @@ export function setupReflectorForApp() {
-
- - -

Following tables are only here to add weight to the UI:

diff --git a/modules/benchmarks/src/naive_infinite_scroll/index.html b/modules/benchmarks/src/naive_infinite_scroll/index.html index bbdb070cec..701cdaecd5 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/index.html +++ b/modules/benchmarks/src/naive_infinite_scroll/index.html @@ -9,6 +9,10 @@ Iteration count:
Scroll increment:
+
+ + +
$SCRIPTS$ diff --git a/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.es6 b/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.es6 index 8c60120765..c182983ae2 100644 --- a/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.es6 +++ b/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.es6 @@ -13,8 +13,8 @@ describe('ng-dart1.x naive infinite scroll benchmark', function () { url: URL, id: 'ng1-dart1.x.naive_infinite_scroll', work: function() { - element(by.deepCss('#reset-btn')).click(); - element(by.deepCss('#run-btn')).click(); + $('#reset-btn').click(); + $('#run-btn').click(); var s = 1000; if (appSize > 4) { s = s + appSize * 100; diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/app.dart b/modules/benchmarks_external/src/naive_infinite_scroll/app.dart index 7f058b9da9..5cc9b34541 100644 --- a/modules/benchmarks_external/src/naive_infinite_scroll/app.dart +++ b/modules/benchmarks_external/src/naive_infinite_scroll/app.dart @@ -11,10 +11,6 @@ import 'package:angular2/src/test_lib/benchmark_util.dart';
-
- - -

Following tables are only here to add weight to the UI:

@@ -39,10 +35,10 @@ class App implements ShadowRootAware { @override void onShadowRoot(ShadowRoot shadowRoot) { - bindAction('scroll-app /deep/ #run-btn', () { + bindAction('#run-btn', () { runBenchmark(); }); - bindAction('scroll-app /deep/ #reset-btn', () { + bindAction('#reset-btn', () { scrollTop = 0; }); } diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/index.html b/modules/benchmarks_external/src/naive_infinite_scroll/index.html index bbdb070cec..701cdaecd5 100644 --- a/modules/benchmarks_external/src/naive_infinite_scroll/index.html +++ b/modules/benchmarks_external/src/naive_infinite_scroll/index.html @@ -9,6 +9,10 @@ Iteration count:
Scroll increment:
+
+ + +
$SCRIPTS$ diff --git a/protractor-shared.js b/protractor-shared.js index 9c25b853f5..98d2c135b5 100644 --- a/protractor-shared.js +++ b/protractor-shared.js @@ -33,17 +33,32 @@ var argv = require('yargs') var browsers = argv['browsers'].split(','); +var CHROME_OPTIONS = { + 'args': ['--js-flags=--expose-gc'], + 'perfLoggingPrefs': { + 'traceCategories': 'blink.console,disabled-by-default-devtools.timeline' + } +}; + +var CHROME_MOBILE_EMULATION = { + // Can't use 'deviceName':'Google Nexus 7 2' + // as this would yield wrong orientation, + // so we specify facts explicitly + 'deviceMetrics': { + 'width': 600, + 'height': 960, + 'pixelRatio': 2 + } +}; + var BROWSER_CAPS = { Dartium: { name: 'Dartium', browserName: 'chrome', - chromeOptions: { - 'binary': process.env.DARTIUM, - 'args': ['--js-flags=--expose-gc'], - 'perfLoggingPrefs': { - 'traceCategories': 'blink.console,disabled-by-default-devtools.timeline' - } - }, + chromeOptions: mergeInto(CHROME_OPTIONS, { + 'mobileEmulation': CHROME_MOBILE_EMULATION, + 'binary': process.env.DARTIUM + }), loggingPrefs: { performance: 'ALL', browser: 'ALL' @@ -51,12 +66,9 @@ var BROWSER_CAPS = { }, ChromeDesktop: { browserName: 'chrome', - chromeOptions: { - 'args': ['--js-flags=--expose-gc'], - 'perfLoggingPrefs': { - 'traceCategories': 'blink.console,disabled-by-default-devtools.timeline' - } - }, + chromeOptions: mergeInto(CHROME_OPTIONS, { + 'mobileEmulation': CHROME_MOBILE_EMULATION + }), loggingPrefs: { performance: 'ALL', browser: 'ALL' @@ -64,13 +76,9 @@ var BROWSER_CAPS = { }, ChromeAndroid: { browserName: 'chrome', - chromeOptions: { - androidPackage: 'com.android.chrome', - 'args': ['--js-flags=--expose-gc'], - 'perfLoggingPrefs': { - 'traceCategories': 'blink.console,disabled-by-default-devtools.timeline' - } - }, + chromeOptions: mergeInto(CHROME_OPTIONS, { + 'androidPackage': 'com.android.chrome', + }), loggingPrefs: { performance: 'ALL', browser: 'ALL' @@ -201,3 +209,10 @@ exports.createBenchpressRunner = function(options) { global.benchpressRunner = new benchpress.Runner(bindings); } + +function mergeInto(src, target) { + for (var prop in src) { + target[prop] = src[prop]; + } + return target; + } \ No newline at end of file