Update e2e tests
Bug: 277181336 Test: npm run test:all Change-Id: I7eb923367191a47d3b50b31ee66f147ff1d6923a
This commit is contained in:
@@ -124,6 +124,7 @@ describe('Cross-Tool Protocol', () => {
|
|||||||
'ProtoLog',
|
'ProtoLog',
|
||||||
'Surface Flinger',
|
'Surface Flinger',
|
||||||
'Transactions',
|
'Transactions',
|
||||||
|
'Transitions',
|
||||||
'Window Manager',
|
'Window Manager',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -44,14 +44,24 @@ describe('Upload traces', () => {
|
|||||||
|
|
||||||
const checkHasLoadedTraces = async () => {
|
const checkHasLoadedTraces = async () => {
|
||||||
const text = await element(by.css('.uploaded-files')).getText();
|
const text = await element(by.css('.uploaded-files')).getText();
|
||||||
expect(text).toContain('wm_log.winscope (ProtoLog)');
|
expect(text).toContain('ProtoLog');
|
||||||
expect(text).toContain('ime_trace_service.winscope (IME Service)');
|
expect(text).toContain('IME Service');
|
||||||
expect(text).toContain('ime_trace_managerservice.winscope (IME Manager Service)');
|
expect(text).toContain('IME Manager Service)');
|
||||||
expect(text).toContain('wm_trace.winscope (Window Manager)');
|
expect(text).toContain('Window Manager)');
|
||||||
expect(text).toContain('layers_trace_from_transactions.winscope (Surface Flinger)');
|
expect(text).toContain('Surface Flinger)');
|
||||||
expect(text).toContain('ime_trace_clients.winscope (IME Clients)');
|
expect(text).toContain('IME Clients)');
|
||||||
expect(text).toContain('transactions_trace.winscope (Transactions)');
|
expect(text).toContain('Transactions)');
|
||||||
expect(text).toContain('transition_trace.winscope (Transitions)');
|
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 () => {
|
const checkEmitsUnsupportedFileFormatMessages = async () => {
|
||||||
|
|||||||
@@ -22,9 +22,12 @@ class E2eTestUtils extends CommonTestUtils {
|
|||||||
return path.join(CommonTestUtils.getProjectRootPath(), 'dist/prod/index.html');
|
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"]'));
|
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() {
|
static async clickViewTracesButton() {
|
||||||
|
|||||||
@@ -22,8 +22,10 @@ describe('Viewer Transitions', () => {
|
|||||||
browser.get('file://' + E2eTestUtils.getProductionIndexHtmlPath());
|
browser.get('file://' + E2eTestUtils.getProductionIndexHtmlPath());
|
||||||
});
|
});
|
||||||
it('processes trace and renders view', async () => {
|
it('processes trace and renders view', async () => {
|
||||||
await E2eTestUtils.uploadFixture('traces/elapsed_and_real_timestamp/wm_transition_trace.pb');
|
await E2eTestUtils.uploadFixture(
|
||||||
await E2eTestUtils.uploadFixture('traces/elapsed_and_real_timestamp/shell_transition_trace.pb');
|
'traces/elapsed_and_real_timestamp/wm_transition_trace.pb',
|
||||||
|
'traces/elapsed_and_real_timestamp/shell_transition_trace.pb'
|
||||||
|
);
|
||||||
await E2eTestUtils.closeSnackBarIfNeeded();
|
await E2eTestUtils.closeSnackBarIfNeeded();
|
||||||
await E2eTestUtils.clickViewTracesButton();
|
await E2eTestUtils.clickViewTracesButton();
|
||||||
|
|
||||||
|
|||||||
@@ -281,8 +281,9 @@ export class ViewerTransitionsComponent {
|
|||||||
startOf(transition: Transition) {
|
startOf(transition: Transition) {
|
||||||
const fullRange = this.getMaxOfRanges() - this.getMinOfRanges();
|
const fullRange = this.getMaxOfRanges() - this.getMinOfRanges();
|
||||||
return `${
|
return `${
|
||||||
Number((BigInt(transition.createTime.elapsedNanos.toString()) - this.getMinOfRanges()) * 100n) /
|
Number(
|
||||||
Number(fullRange)
|
(BigInt(transition.createTime.elapsedNanos.toString()) - this.getMinOfRanges()) * 100n
|
||||||
|
) / Number(fullRange)
|
||||||
}%`;
|
}%`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user