summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKean Mariotti <keanmariotti@google.com>2023-05-31 14:38:36 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-31 14:38:36 +0000
commitf3f404439ea4a512c4e712f315b5c72e6d8fc5a9 (patch)
tree52344a51fef3d25bbf6d60cd88d771eb4c55d4c9
parentdd8cd04eff667135c8ef1a6c143b1d055570a9fd (diff)
parent35e2e69f95eb8ad75736ea0c27242ec7e46d0318 (diff)
downloaddevelopment-f3f404439ea4a512c4e712f315b5c72e6d8fc5a9.tar.gz
Fix broken tests am: 35e2e69f95
Original change: https://googleplex-android-review.googlesource.com/c/platform/development/+/23478816 Change-Id: I3d3a67cf722904a78a516a6b81ec753d948e3f75 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--tools/winscope/src/app/components/timeline/timeline_component_test.ts5
-rw-r--r--tools/winscope/src/app/components/trace_view_component.ts4
-rw-r--r--tools/winscope/src/test/e2e/cross_tool_protocol_test.ts13
-rw-r--r--tools/winscope/src/test/e2e/upload_traces_test.ts22
-rw-r--r--tools/winscope/src/viewers/viewer_stub.ts5
-rw-r--r--tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component_test.ts4
6 files changed, 33 insertions, 20 deletions
diff --git a/tools/winscope/src/app/components/timeline/timeline_component_test.ts b/tools/winscope/src/app/components/timeline/timeline_component_test.ts
index 1676e1110..7720b09c0 100644
--- a/tools/winscope/src/app/components/timeline/timeline_component_test.ts
+++ b/tools/winscope/src/app/components/timeline/timeline_component_test.ts
@@ -20,9 +20,9 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {MatButtonModule} from '@angular/material/button';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatIconModule} from '@angular/material/icon';
-import {MatSelectModule} from '@angular/material/select';
-
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 {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {
@@ -66,6 +66,7 @@ describe('TimelineComponent', () => {
MatInputModule,
MatIconModule,
MatSelectModule,
+ MatTooltipModule,
ReactiveFormsModule,
BrowserAnimationsModule,
],
diff --git a/tools/winscope/src/app/components/trace_view_component.ts b/tools/winscope/src/app/components/trace_view_component.ts
index 3ba76fc06..7bd3bd842 100644
--- a/tools/winscope/src/app/components/trace_view_component.ts
+++ b/tools/winscope/src/app/components/trace_view_component.ts
@@ -51,7 +51,9 @@ interface Tab extends View {
[style]="{color: TRACE_INFO[tab.traceType].color, marginRight: '0.5rem'}">
{{ TRACE_INFO[tab.traceType].icon }}
</mat-icon>
- {{ tab.title }}
+ <p>
+ {{ tab.title }}
+ </p>
</a>
</nav>
<button
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 8fc15a22c..86ea574f2 100644
--- a/tools/winscope/src/test/e2e/cross_tool_protocol_test.ts
+++ b/tools/winscope/src/test/e2e/cross_tool_protocol_test.ts
@@ -26,7 +26,8 @@ describe('Cross-Tool Protocol', () => {
const TIMESTAMP_FROM_WINSCOPE_TO_REMOTE_TOOL = '1670509913000000000';
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('Winscope', WINSCOPE_URL);
});
@@ -111,13 +112,13 @@ describe('Cross-Tool Protocol', () => {
};
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(
- (linkElements as ElementFinder[]).map(async (linkElement) => await linkElement.getText())
+ const actualTabParagraphs = await Promise.all(
+ (tabParagraphs as ElementFinder[]).map(async (paragraph) => await paragraph.getText())
);
- const expectedLinks = [
+ const expectedTabParagraphs = [
'Input Method Clients',
'Input Method Manager Service',
'Input Method Service',
@@ -128,7 +129,7 @@ describe('Cross-Tool Protocol', () => {
'Window Manager',
];
- expect(actualLinks.sort()).toEqual(expectedLinks.sort());
+ expect(actualTabParagraphs.sort()).toEqual(expectedTabParagraphs.sort());
};
const checkWinscopeAppliedTimestampInBugreportMessage = async () => {
diff --git a/tools/winscope/src/test/e2e/upload_traces_test.ts b/tools/winscope/src/test/e2e/upload_traces_test.ts
index 8be4f7871..72554a36d 100644
--- a/tools/winscope/src/test/e2e/upload_traces_test.ts
+++ b/tools/winscope/src/test/e2e/upload_traces_test.ts
@@ -18,8 +18,11 @@ import {browser, by, element} from 'protractor';
import {E2eTestUtils} from './utils';
describe('Upload traces', () => {
+ const DEFAULT_TIMEOUT_MS = 15000;
+
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 () => {
@@ -46,11 +49,11 @@ describe('Upload traces', () => {
const text = await element(by.css('.uploaded-files')).getText();
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('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');
@@ -75,7 +78,12 @@ describe('Upload traces', () => {
};
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 () => {
diff --git a/tools/winscope/src/viewers/viewer_stub.ts b/tools/winscope/src/viewers/viewer_stub.ts
index 95f8f2cb8..46a7f99c1 100644
--- a/tools/winscope/src/viewers/viewer_stub.ts
+++ b/tools/winscope/src/viewers/viewer_stub.ts
@@ -15,6 +15,7 @@
*/
import {TracePosition} from 'trace/trace_position';
+import {TraceType} from 'trace/trace_type';
import {View, Viewer, ViewType} from './viewer';
class ViewerStub implements Viewer {
@@ -45,8 +46,8 @@ class ViewerStub implements Viewer {
];
}
- getDependencies(): any {
- return;
+ getDependencies(): TraceType[] {
+ return [TraceType.WINDOW_MANAGER];
}
private htmlElement: HTMLElement;
diff --git a/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component_test.ts b/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component_test.ts
index 238862bbc..feb61c596 100644
--- a/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component_test.ts
+++ b/tools/winscope/src/viewers/viewer_transitions/viewer_transitions_component_test.ts
@@ -101,8 +101,8 @@ function createMockTransition(
const abortTime = null;
const finishTime = CrossPlatform.timestamp.fromString(finishTimeNanos.toString(), null, null);
- const startTransactionId = -1;
- const finishTransactionId = -1;
+ const startTransactionId = '-1';
+ const finishTransactionId = '-1';
const type = TransitionType.TO_FRONT;
const changes: TransitionChange[] = [];