Skip to content

Commit 16c3441

Browse files
szuendDevtools-frontend LUCI CQ
authored andcommitted
[browser_tests] Remove unnecessary try-catch
The C++ side no longer uses DOMMessageQueue to call this function so we can let the async function resolve/reject directly. [email protected] Bug: 382003727 Change-Id: I5385a9be1374c1321bdc524a4ba076cecaa048a3 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6074128 Commit-Queue: Simon Zünd <[email protected]> Auto-Submit: Simon Zünd <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent fd0f11e commit 16c3441

File tree

1 file changed

+27
-34
lines changed

1 file changed

+27
-34
lines changed

front_end/Tests.js

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -158,40 +158,33 @@
158158
};
159159

160160
TestSuite.prototype.setupLegacyFilesForTest = async function() {
161-
try {
162-
// 'Tests.js' is executed on 'about:blank' so we can't use `import` directly without
163-
// specifying the full devtools://devtools/bundled URL.
164-
([
165-
Common,
166-
HostModule,
167-
Root,
168-
SDK,
169-
Sources,
170-
Timeline,
171-
UI,
172-
Workspace,
173-
] =
174-
await Promise.all([
175-
self.runtime.loadLegacyModule('core/common/common.js'),
176-
self.runtime.loadLegacyModule('core/host/host.js'),
177-
self.runtime.loadLegacyModule('core/root/root.js'),
178-
self.runtime.loadLegacyModule('core/sdk/sdk.js'),
179-
self.runtime.loadLegacyModule('panels/sources/sources.js'),
180-
self.runtime.loadLegacyModule('panels/timeline/timeline.js'),
181-
self.runtime.loadLegacyModule('ui/legacy/legacy.js'),
182-
self.runtime.loadLegacyModule('models/workspace/workspace.js'),
183-
]));
184-
185-
// We have to map 'Host.InspectorFrontendHost' as the C++ uses it directly.
186-
self.Host = {};
187-
self.Host.InspectorFrontendHost = HostModule.InspectorFrontendHost.InspectorFrontendHostInstance;
188-
self.Host.InspectorFrontendHostAPI = HostModule.InspectorFrontendHostAPI;
189-
190-
this.reportOk_();
191-
} catch (e) {
192-
this.reportFailure_(e);
193-
throw e;
194-
}
161+
// 'Tests.js' is executed on 'about:blank' so we can't use `import` directly without
162+
// specifying the full devtools://devtools/bundled URL.
163+
([
164+
Common,
165+
HostModule,
166+
Root,
167+
SDK,
168+
Sources,
169+
Timeline,
170+
UI,
171+
Workspace,
172+
] =
173+
await Promise.all([
174+
self.runtime.loadLegacyModule('core/common/common.js'),
175+
self.runtime.loadLegacyModule('core/host/host.js'),
176+
self.runtime.loadLegacyModule('core/root/root.js'),
177+
self.runtime.loadLegacyModule('core/sdk/sdk.js'),
178+
self.runtime.loadLegacyModule('panels/sources/sources.js'),
179+
self.runtime.loadLegacyModule('panels/timeline/timeline.js'),
180+
self.runtime.loadLegacyModule('ui/legacy/legacy.js'),
181+
self.runtime.loadLegacyModule('models/workspace/workspace.js'),
182+
]));
183+
184+
// We have to map 'Host.InspectorFrontendHost' as the C++ uses it directly.
185+
self.Host = {};
186+
self.Host.InspectorFrontendHost = HostModule.InspectorFrontendHost.InspectorFrontendHostInstance;
187+
self.Host.InspectorFrontendHostAPI = HostModule.InspectorFrontendHostAPI;
195188
};
196189

197190
/**

0 commit comments

Comments
 (0)