Update e2e tests am: 8317c066aa

Original change: https://googleplex-android-review.googlesource.com/c/platform/development/+/23369063

Change-Id: I2c2616c1b3e73ba23b08223b3ea6093e1526ed5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Pablo Gamito
2023-05-23 07:37:20 +00:00
committed by Automerger Merge Worker
5 changed files with 31 additions and 14 deletions

View File

@@ -124,6 +124,7 @@ describe('Cross-Tool Protocol', () => {
'ProtoLog',
'Surface Flinger',
'Transactions',
'Transitions',
'Window Manager',
];

View File

@@ -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 () => {

View File

@@ -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() {

View File

@@ -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();

View File

@@ -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)
}%`;
}