Fix broken tests
Test: npm run test:all Change-Id: I6f064dc8846b2e65dfb002d002aee80d8422c537
This commit is contained in:
@@ -20,9 +20,9 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
|||||||
import {MatButtonModule} from '@angular/material/button';
|
import {MatButtonModule} from '@angular/material/button';
|
||||||
import {MatFormFieldModule} from '@angular/material/form-field';
|
import {MatFormFieldModule} from '@angular/material/form-field';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
import {MatSelectModule} from '@angular/material/select';
|
|
||||||
|
|
||||||
import {MatInputModule} from '@angular/material/input';
|
import {MatInputModule} from '@angular/material/input';
|
||||||
|
import {MatSelectModule} from '@angular/material/select';
|
||||||
|
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||||
import {By} from '@angular/platform-browser';
|
import {By} from '@angular/platform-browser';
|
||||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||||
import {
|
import {
|
||||||
@@ -66,6 +66,7 @@ describe('TimelineComponent', () => {
|
|||||||
MatInputModule,
|
MatInputModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
|
MatTooltipModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ interface Tab extends View {
|
|||||||
[style]="{color: TRACE_INFO[tab.traceType].color, marginRight: '0.5rem'}">
|
[style]="{color: TRACE_INFO[tab.traceType].color, marginRight: '0.5rem'}">
|
||||||
{{ TRACE_INFO[tab.traceType].icon }}
|
{{ TRACE_INFO[tab.traceType].icon }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
{{ tab.title }}
|
<p>
|
||||||
|
{{ tab.title }}
|
||||||
|
</p>
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ describe('Cross-Tool Protocol', () => {
|
|||||||
const TIMESTAMP_FROM_WINSCOPE_TO_REMOTE_TOOL = '1670509913000000000';
|
const TIMESTAMP_FROM_WINSCOPE_TO_REMOTE_TOOL = '1670509913000000000';
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await browser.manage().timeouts().implicitlyWait(5000);
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
|
||||||
|
await browser.manage().timeouts().implicitlyWait(15000);
|
||||||
await checkServerIsUp('Remote tool mock', REMOTE_TOOL_MOCK_URL);
|
await checkServerIsUp('Remote tool mock', REMOTE_TOOL_MOCK_URL);
|
||||||
await checkServerIsUp('Winscope', WINSCOPE_URL);
|
await checkServerIsUp('Winscope', WINSCOPE_URL);
|
||||||
});
|
});
|
||||||
@@ -111,13 +112,13 @@ describe('Cross-Tool Protocol', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const checkWinscopeRenderedAllViewTabs = async () => {
|
const checkWinscopeRenderedAllViewTabs = async () => {
|
||||||
const linkElements = await element.all(by.css('.tabs-navigation-bar a'));
|
const tabParagraphs = await element.all(by.css('.tabs-navigation-bar a p'));
|
||||||
|
|
||||||
const actualLinks = await Promise.all(
|
const actualTabParagraphs = await Promise.all(
|
||||||
(linkElements as ElementFinder[]).map(async (linkElement) => await linkElement.getText())
|
(tabParagraphs as ElementFinder[]).map(async (paragraph) => await paragraph.getText())
|
||||||
);
|
);
|
||||||
|
|
||||||
const expectedLinks = [
|
const expectedTabParagraphs = [
|
||||||
'Input Method Clients',
|
'Input Method Clients',
|
||||||
'Input Method Manager Service',
|
'Input Method Manager Service',
|
||||||
'Input Method Service',
|
'Input Method Service',
|
||||||
@@ -128,7 +129,7 @@ describe('Cross-Tool Protocol', () => {
|
|||||||
'Window Manager',
|
'Window Manager',
|
||||||
];
|
];
|
||||||
|
|
||||||
expect(actualLinks.sort()).toEqual(expectedLinks.sort());
|
expect(actualTabParagraphs.sort()).toEqual(expectedTabParagraphs.sort());
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkWinscopeAppliedTimestampInBugreportMessage = async () => {
|
const checkWinscopeAppliedTimestampInBugreportMessage = async () => {
|
||||||
|
|||||||
@@ -18,8 +18,11 @@ import {browser, by, element} from 'protractor';
|
|||||||
import {E2eTestUtils} from './utils';
|
import {E2eTestUtils} from './utils';
|
||||||
|
|
||||||
describe('Upload traces', () => {
|
describe('Upload traces', () => {
|
||||||
|
const DEFAULT_TIMEOUT_MS = 15000;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await browser.manage().timeouts().implicitlyWait(5000);
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = DEFAULT_TIMEOUT_MS;
|
||||||
|
await browser.manage().timeouts().implicitlyWait(DEFAULT_TIMEOUT_MS);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@@ -46,11 +49,11 @@ describe('Upload traces', () => {
|
|||||||
const text = await element(by.css('.uploaded-files')).getText();
|
const text = await element(by.css('.uploaded-files')).getText();
|
||||||
expect(text).toContain('ProtoLog');
|
expect(text).toContain('ProtoLog');
|
||||||
expect(text).toContain('IME Service');
|
expect(text).toContain('IME Service');
|
||||||
expect(text).toContain('IME Manager Service)');
|
expect(text).toContain('IME Manager Service');
|
||||||
expect(text).toContain('Window Manager)');
|
expect(text).toContain('Window Manager');
|
||||||
expect(text).toContain('Surface Flinger)');
|
expect(text).toContain('Surface Flinger');
|
||||||
expect(text).toContain('IME Clients)');
|
expect(text).toContain('IME Clients');
|
||||||
expect(text).toContain('Transactions)');
|
expect(text).toContain('Transactions');
|
||||||
expect(text).toContain('Transitions');
|
expect(text).toContain('Transitions');
|
||||||
|
|
||||||
expect(text).toContain('wm_log.winscope');
|
expect(text).toContain('wm_log.winscope');
|
||||||
@@ -75,7 +78,12 @@ describe('Upload traces', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const areMessagesEmitted = async (): Promise<boolean> => {
|
const areMessagesEmitted = async (): Promise<boolean> => {
|
||||||
return element(by.css('snack-bar')).isPresent();
|
// Messages are emitted quickly. There is no Need to wait for the entire
|
||||||
|
// default timeout to understand whether the messages where emitted or not.
|
||||||
|
await browser.manage().timeouts().implicitlyWait(1000);
|
||||||
|
const emitted = await element(by.css('snack-bar')).isPresent();
|
||||||
|
await browser.manage().timeouts().implicitlyWait(DEFAULT_TIMEOUT_MS);
|
||||||
|
return emitted;
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkRendersSurfaceFlingerView = async () => {
|
const checkRendersSurfaceFlingerView = async () => {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {TracePosition} from 'trace/trace_position';
|
import {TracePosition} from 'trace/trace_position';
|
||||||
|
import {TraceType} from 'trace/trace_type';
|
||||||
import {View, Viewer, ViewType} from './viewer';
|
import {View, Viewer, ViewType} from './viewer';
|
||||||
|
|
||||||
class ViewerStub implements Viewer {
|
class ViewerStub implements Viewer {
|
||||||
@@ -45,8 +46,8 @@ class ViewerStub implements Viewer {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): any {
|
getDependencies(): TraceType[] {
|
||||||
return;
|
return [TraceType.WINDOW_MANAGER];
|
||||||
}
|
}
|
||||||
|
|
||||||
private htmlElement: HTMLElement;
|
private htmlElement: HTMLElement;
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ function createMockTransition(
|
|||||||
const abortTime = null;
|
const abortTime = null;
|
||||||
const finishTime = CrossPlatform.timestamp.fromString(finishTimeNanos.toString(), null, null);
|
const finishTime = CrossPlatform.timestamp.fromString(finishTimeNanos.toString(), null, null);
|
||||||
|
|
||||||
const startTransactionId = -1;
|
const startTransactionId = '-1';
|
||||||
const finishTransactionId = -1;
|
const finishTransactionId = '-1';
|
||||||
const type = TransitionType.TO_FRONT;
|
const type = TransitionType.TO_FRONT;
|
||||||
const changes: TransitionChange[] = [];
|
const changes: TransitionChange[] = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user