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 Window Manager', () => { 21 const viewerSelector = 'viewer-window-manager'; 22 23 beforeEach(async () => { 24 await E2eTestUtils.beforeEach(1000); 25 await browser.get(E2eTestUtils.WINSCOPE_URL); 26 }); 27 28 it('processes trace from zip and navigates correctly', async () => { 29 await E2eTestUtils.loadTraceAndCheckViewer( 30 'traces/deployment_full_trace_phone.zip', 31 'Window Manager', 32 viewerSelector, 33 ); 34 await E2eTestUtils.checkTimelineTraceSelector({ 35 icon: 'web', 36 color: 'rgba(175, 92, 247, 1)', 37 }); 38 await E2eTestUtils.checkInitialRealTimestamp('2022-11-21, 18:05:09.753'); 39 await E2eTestUtils.checkFinalRealTimestamp('2022-11-21, 18:05:18.269'); 40 41 await E2eTestUtils.changeRealTimestampInWinscope( 42 '2022-11-21, 18:05:09.753', 43 ); 44 await E2eTestUtils.checkWinscopeRealTimestamp('18:05:09.753'); 45 await E2eTestUtils.selectItemInHierarchy(viewerSelector, 'root'); 46 await checkRootProperties(); 47 48 await E2eTestUtils.changeRealTimestampInWinscope( 49 '2022-11-21, 18:05:14.544', 50 ); 51 await E2eTestUtils.checkWinscopeRealTimestamp('18:05:14.544'); 52 await E2eTestUtils.filterHierarchy(viewerSelector, 'InputMethod'); 53 await E2eTestUtils.selectItemInHierarchy(viewerSelector, 'InputMethod'); 54 await checkInputMethodWindowProperties(); 55 }); 56 57 async function checkRootProperties() { 58 await E2eTestUtils.checkItemInPropertiesTree( 59 viewerSelector, 60 'focusedApp', 61 'focusedApp:\ncom.google.android.apps.messaging/.ui.ConversationListActivity', 62 ); 63 await E2eTestUtils.checkRectLabel( 64 viewerSelector, 65 'com.google.android.apps.messaging/com.google.android.apps.messaging.ui.ConversationListActivity', 66 ); 67 } 68 69 async function checkInputMethodWindowProperties() { 70 await E2eTestUtils.checkItemInPropertiesTree( 71 viewerSelector, 72 'fitInsetsTypes', 73 'fitInsetsTypes:\nNAVIGATION_BARS | STATUS_BARS', 74 ); 75 76 await E2eTestUtils.checkItemInPropertiesTree( 77 viewerSelector, 78 'flags', 79 'flags:\nFLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | FLAG_HARDWARE_ACCELERATED | FLAG_SPLIT_TOUCH | FLAG_LAYOUT_IN_SCREEN | FLAG_NOT_FOCUSABLE', 80 ); 81 82 await E2eTestUtils.checkItemInPropertiesTree( 83 viewerSelector, 84 'compatFrame', 85 'compatFrame:\n(136, 74) - (2340, 1080)', 86 ); 87 } 88}); 89