diff options
author | Pablo Gamito <pablogamito@google.com> | 2023-05-22 16:17:05 +0000 |
---|---|---|
committer | Pablo Gamito <pablogamito@google.com> | 2023-05-22 16:40:57 +0000 |
commit | 8317c066aa5cc20ad0655aa438adbc156062c6d2 (patch) | |
tree | 1d9629c4afc5fd437fc03632ee6efedcc2b50f71 | |
parent | 4d49b499a9e96d236b871fca6664dfa475abe8c7 (diff) | |
download | development-8317c066aa5cc20ad0655aa438adbc156062c6d2.tar.gz |
Update e2e tests
Bug: 277181336
Test: npm run test:all
Change-Id: I7eb923367191a47d3b50b31ee66f147ff1d6923a
5 files changed, 31 insertions, 14 deletions
diff --git a/tools/winscope/src/test/e2e/cross_tool_protocol_test.ts b/tools/winscope/src/test/e2e/cross_tool_protocol_test.ts index 1d941fb6e..8fc15a22c 100644 --- a/tools/winscope/src/test/e2e/cross_tool_protocol_test.ts +++ b/tools/winscope/src/test/e2e/cross_tool_protocol_test.ts @@ -124,6 +124,7 @@ describe('Cross-Tool Protocol', () => { 'ProtoLog', 'Surface Flinger', 'Transactions', + 'Transitions', 'Window Manager', ]; diff --git a/tools/winscope/src/test/e2e/upload_traces_test.ts b/tools/winscope/src/test/e2e/upload_traces_test.ts index 2936a11d9..8be4f7871 100644 --- a/tools/winscope/src/test/e2e/upload_traces_test.ts +++ b/tools/winscope/src/test/e2e/upload_traces_test.ts @@ -44,14 +44,24 @@ describe('Upload traces', () => { const checkHasLoadedTraces = async () => { const text = await element(by.css('.uploaded-files')).getText(); - expect(text).toContain('wm_log.winscope (ProtoLog)'); - expect(text).toContain('ime_trace_service.winscope (IME Service)'); - expect(text).toContain('ime_trace_managerservice.winscope (IME Manager Service)'); - expect(text).toContain('wm_trace.winscope (Window Manager)'); - expect(text).toContain('layers_trace_from_transactions.winscope (Surface Flinger)'); - expect(text).toContain('ime_trace_clients.winscope (IME Clients)'); - expect(text).toContain('transactions_trace.winscope (Transactions)'); - expect(text).toContain('transition_trace.winscope (Transitions)'); + expect(text).toContain('ProtoLog'); + expect(text).toContain('IME Service'); + expect(text).toContain('IME Manager Service)'); + expect(text).toContain('Window Manager)'); + expect(text).toContain('Surface Flinger)'); + expect(text).toContain('IME Clients)'); + expect(text).toContain('Transactions)'); + expect(text).toContain('Transitions'); + + expect(text).toContain('wm_log.winscope'); + expect(text).toContain('ime_trace_service.winscope'); + expect(text).toContain('ime_trace_managerservice.winscope'); + expect(text).toContain('wm_trace.winscope'); + expect(text).toContain('layers_trace_from_transactions.winscope'); + expect(text).toContain('ime_trace_clients.winscope'); + expect(text).toContain('transactions_trace.winscope'); + expect(text).toContain('wm_transition_trace.winscope'); + expect(text).toContain('shell_transition_trace.winscope'); }; const checkEmitsUnsupportedFileFormatMessages = async () => { diff --git a/tools/winscope/src/test/e2e/utils.ts b/tools/winscope/src/test/e2e/utils.ts index 9a1999a2b..738aae0bb 100644 --- a/tools/winscope/src/test/e2e/utils.ts +++ b/tools/winscope/src/test/e2e/utils.ts @@ -22,9 +22,12 @@ class E2eTestUtils extends CommonTestUtils { return path.join(CommonTestUtils.getProjectRootPath(), 'dist/prod/index.html'); } - static async uploadFixture(path: string) { + static async uploadFixture(...paths: string[]) { const inputFile = element(by.css('input[type="file"]')); - await inputFile.sendKeys(E2eTestUtils.getFixturePath(path)); + + // Uploading multiple files is not properly supported but + // chrome handles file paths joined with new lines + await inputFile.sendKeys(paths.map((it) => E2eTestUtils.getFixturePath(it)).join('\n')); } static async clickViewTracesButton() { diff --git a/tools/winscope/src/test/e2e/viewer_transitions_test.ts b/tools/winscope/src/test/e2e/viewer_transitions_test.ts index 85b6dbca1..1161c5fea 100644 --- a/tools/winscope/src/test/e2e/viewer_transitions_test.ts +++ b/tools/winscope/src/test/e2e/viewer_transitions_test.ts @@ -22,8 +22,10 @@ describe('Viewer Transitions', () => { browser.get('file://' + E2eTestUtils.getProductionIndexHtmlPath()); }); it('processes trace and renders view', async () => { - await E2eTestUtils.uploadFixture('traces/elapsed_and_real_timestamp/wm_transition_trace.pb'); - await E2eTestUtils.uploadFixture('traces/elapsed_and_real_timestamp/shell_transition_trace.pb'); + await E2eTestUtils.uploadFixture( + 'traces/elapsed_and_real_timestamp/wm_transition_trace.pb', + 'traces/elapsed_and_real_timestamp/shell_transition_trace.pb' + ); await E2eTestUtils.closeSnackBarIfNeeded(); await E2eTestUtils.clickViewTracesButton(); diff --git a/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component.ts b/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component.ts index 997a19b90..4ce4e3200 100644 --- a/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component.ts +++ b/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component.ts @@ -281,8 +281,9 @@ export class ViewerTransitionsComponent { startOf(transition: Transition) { const fullRange = this.getMaxOfRanges() - this.getMinOfRanges(); return `${ - Number((BigInt(transition.createTime.elapsedNanos.toString()) - this.getMinOfRanges()) * 100n) / - Number(fullRange) + Number( + (BigInt(transition.createTime.elapsedNanos.toString()) - this.getMinOfRanges()) * 100n + ) / Number(fullRange) }%`; } |