• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import {browser} from 'protractor';
18import {E2eTestUtils} from './utils';
19
20describe('Viewer Protolog', () => {
21  const viewerSelector = 'viewer-protolog';
22  const totalEntries = 7295;
23
24  beforeEach(async () => {
25    jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
26    await E2eTestUtils.beforeEach(1000);
27    await browser.get(E2eTestUtils.WINSCOPE_URL);
28  });
29
30  it('processes trace from zip and navigates correctly', async () => {
31    await E2eTestUtils.loadTraceAndCheckViewer(
32      'traces/deployment_full_trace_phone.zip',
33      'ProtoLog',
34      viewerSelector,
35    );
36    await E2eTestUtils.checkScrollPresent(viewerSelector);
37    await E2eTestUtils.checkTotalScrollEntries(
38      viewerSelector,
39      totalEntries,
40      true,
41    );
42    await E2eTestUtils.checkTimelineTraceSelector({
43      icon: 'notes',
44      color: 'rgba(52, 168, 83, 1)',
45    });
46    await E2eTestUtils.checkFinalRealTimestamp('2022-11-21, 18:05:18.259');
47    await E2eTestUtils.checkInitialRealTimestamp('2022-11-21, 18:05:09.777');
48
49    await E2eTestUtils.checkSelectFilter(
50      viewerSelector,
51      '.source-file',
52      ['com/android/server/wm/ActivityStarter.java'],
53      1,
54      totalEntries,
55    );
56
57    await E2eTestUtils.checkSelectFilter(
58      viewerSelector,
59      '.source-file',
60      [
61        'com/android/server/wm/ActivityStarter.java',
62        'com/android/server/wm/ActivityClientController.java',
63      ],
64      4,
65      totalEntries,
66    );
67
68    await filterByText('FREEZE');
69    await E2eTestUtils.checkTotalScrollEntries(viewerSelector, 4);
70  });
71
72  async function filterByText(filterString: string) {
73    await E2eTestUtils.updateInputField(
74      `${viewerSelector} .headers .text`,
75      'Search text',
76      filterString,
77    );
78  }
79});
80