forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree.perf-spec.ts
More file actions
49 lines (44 loc) · 1.42 KB
/
tree.perf-spec.ts
File metadata and controls
49 lines (44 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {$} from 'protractor';
import {runTreeBenchmark} from './test_utils';
describe('tree benchmark perf', () => {
it('should work for createOnly', async () => {
await runTreeBenchmark({
// This cannot be called "createOnly" because the actual destroy benchmark
// has the "createOnly" id already. See: https://github.com/angular/angular/pull/21503
id: 'createOnlyForReal',
prepare: () => $('#destroyDom').click(),
work: () => $('#createDom').click(),
});
});
it('should work for destroy', async () => {
await runTreeBenchmark({
// This is actually a benchmark for destroying the dom, but it has been accidentally
// named "createOnly". See https://github.com/angular/angular/pull/21503.
id: 'createOnly',
prepare: () => $('#createDom').click(),
work: () => $('#destroyDom').click(),
});
});
it('should work for createDestroy', async () => {
await runTreeBenchmark({
id: 'createDestroy',
work: () => {
$('#destroyDom').click();
$('#createDom').click();
},
});
});
it('should work for update', async () => {
await runTreeBenchmark({
id: 'update',
work: () => $('#createDom').click(),
});
});
});