From 737a2618b5343018134ee7ef4e4df1d5ed35f56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 24 May 2017 11:41:46 +0200 Subject: [PATCH] [IMP web: improve list benchmarks With this commit, we just slightly improve list benchmarks, to make them go through a wider variery of code. Since we aim to use these benchmarks to track changes in performance through various versions, it is useful to have a good version in saas-16. --- .../web/static/tests/views/list_benchmarks.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/addons/web/static/tests/views/list_benchmarks.js b/addons/web/static/tests/views/list_benchmarks.js index 7b4e1f7e0c7..4dadbcb47bd 100644 --- a/addons/web/static/tests/views/list_benchmarks.js +++ b/addons/web/static/tests/views/list_benchmarks.js @@ -23,7 +23,7 @@ QUnit.module('List View', { }, }; this.arch = null; - this.run = function (assert, done) { + this.run = function (assert, done, cb) { var data = this.data; var arch = this.arch; new Benchmark.Suite({}) @@ -34,6 +34,9 @@ QUnit.module('List View', { data: data, arch: arch, }); + if (cb) { + cb(list); + } list.destroy(); }) .on('cycle', function(event) { @@ -82,7 +85,7 @@ QUnit.module('List View', { this.run(assert, done); }); - QUnit.test('simple readonly list with 200 rows 4 fields', function (assert) { + QUnit.test('editable list with 200 rows 4 fields', function (assert) { var done = assert.async(); assert.expect(1); @@ -94,8 +97,16 @@ QUnit.module('List View', { bar: i % 2 === 0, }); } - this.arch = ''; - this.run(assert, done); + this.arch = '' + + '' + + '' + + '' + + '' + + ''; + this.run(assert, done, function (list) { + list.$buttons.find('.o_list_button_add').click(); + list.$buttons.find('.o_list_button_discard').click(); + }); }); });