Skip to content

Commit b8eaf7a

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[cleanup] Fix some typos and unreachable code
A small improvement to the codebase Bug: none Change-Id: I648be119454c987b6c5fe849c7816f90d1a8c779 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6770019 Commit-Queue: Piotr Paulski <piotrpaulski@chromium.org> Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Piotr Paulski <piotrpaulski@chromium.org>
1 parent 15bcd9b commit b8eaf7a

3 files changed

Lines changed: 11 additions & 19 deletions

File tree

front_end/models/trace/helpers/TreeHelpers.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,13 @@ describe('TreeHelpers', () => {
211211
const nodeE = [...tree.roots].at(1);
212212
if (!nodeA || !nodeE) {
213213
assert(false, 'Root nodes were not found');
214-
return;
215214
}
216215
const taskA = nodeA.entry;
217216
const taskE = nodeE.entry;
218217
const nodeD = [...nodeA.children].at(1);
219218
const nodeB = [...nodeA.children].at(0);
220219
if (!nodeB || !nodeD) {
221220
assert(false, 'Child nodes were not found');
222-
return;
223221
}
224222
const taskD = nodeD.entry;
225223
const taskB = nodeB.entry;
@@ -228,46 +226,40 @@ describe('TreeHelpers', () => {
228226

229227
if (!nodeC) {
230228
assert(false, 'Child nodes were not found');
231-
return;
232229
}
233230
const taskC = nodeC.entry;
234231

235232
const taskCTotalTime = taskC.dur;
236233
if (taskCTotalTime === undefined) {
237234
assert.fail('Total time for task was not found');
238-
return;
239235
}
240236
assert.strictEqual(taskCTotalTime, Trace.Types.Timing.Micro(1));
241237
assert.strictEqual(nodeC.selfTime, taskCTotalTime);
242238

243239
const taskBTotalTime = taskB.dur;
244240
if (taskBTotalTime === undefined) {
245241
assert.fail('Total time for task was not found');
246-
return;
247242
}
248243
assert.strictEqual(taskBTotalTime, Trace.Types.Timing.Micro(3));
249244
assert.strictEqual(nodeB.selfTime, Trace.Types.Timing.Micro(taskBTotalTime - taskCTotalTime));
250245

251246
const taskDTotalTime = taskD.dur;
252247
if (taskDTotalTime === undefined) {
253248
assert.fail('Total time for task was not found');
254-
return;
255249
}
256250
assert.strictEqual(taskDTotalTime, Trace.Types.Timing.Micro(3));
257251
assert.strictEqual(nodeD.selfTime, taskDTotalTime);
258252

259253
const taskATotalTime = taskA.dur;
260254
if (taskATotalTime === undefined) {
261255
assert.fail('Total time for task was not found');
262-
return;
263256
}
264257
assert.strictEqual(taskATotalTime, Trace.Types.Timing.Micro(10));
265258
assert.strictEqual(nodeA.selfTime, Trace.Types.Timing.Micro(taskATotalTime - taskBTotalTime - taskDTotalTime));
266259

267260
const taskETotalTime = taskE.dur;
268261
if (taskETotalTime === undefined) {
269262
assert.fail('Total time for task was not found');
270-
return;
271263
}
272264
assert.strictEqual(taskETotalTime, Trace.Types.Timing.Micro(3));
273265
assert.strictEqual(nodeD.selfTime, taskETotalTime);

front_end/panels/settings/KeybindsSettingsTab.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ const UIStrings = {
8686
*/
8787
shortcutRemoved: '{PH1} Shortcut removed',
8888
/**
89-
*@description Screen reader announcment for shortcut restored to default
89+
*@description Screen reader announcement for shortcut restored to default
9090
*/
9191
shortcutChangesRestored: 'Changes to shortcut restored to default',
9292
/**
93-
*@description Screen reader announcment for applied short cut changes
93+
*@description Screen reader announcement for applied short cut changes
9494
*/
9595
shortcutChangesApplied: 'Changes to shortcut applied',
9696
/**
97-
*@description Screen reader announcment for discarded short cut changes
97+
*@description Screen reader announcement for discarded short cut changes
9898
*/
99-
shortcutChangesDiscared: 'Changes to shortcut discarded',
99+
shortcutChangesDiscarded: 'Changes to shortcut discarded',
100100
} as const;
101101
const str_ = i18n.i18n.registerUIStrings('panels/settings/KeybindsSettingsTab.ts', UIStrings);
102102
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -410,7 +410,7 @@ export class ShortcutListItem {
410410
this.element.appendChild(
411411
this.createIconButton(i18nString(UIStrings.discardChanges), 'cross', 'keybinds-cancel-button', 'cancel', () => {
412412
this.settingsTab.stopEditing(this.item);
413-
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.shortcutChangesDiscared));
413+
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.shortcutChangesDiscarded));
414414
}));
415415
this.element.addEventListener('keydown', event => {
416416
if (Platform.KeyboardUtilities.isEscKey(event)) {

test/e2e_non_hosted/memory/memory_test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ describe('The Memory Panel', function() {
154154
await devToolsPage.waitForFunction(async () => {
155155
const pendingActivitiesSpan =
156156
await devToolsPage.waitFor('//span[text()="Pending activities"]', undefined, undefined, 'xpath');
157-
const pendingActiviesRow =
157+
const pendingActivitiesRow =
158158
await devToolsPage.waitFor('ancestor-or-self::tr', pendingActivitiesSpan, undefined, 'xpath');
159159
try {
160160
await devToolsPage.clickElement(pendingActivitiesSpan);
161161
} catch {
162162
return false;
163163
}
164-
const res = await pendingActiviesRow.evaluate(x => x.classList.toString());
164+
const res = await pendingActivitiesRow.evaluate(x => x.classList.toString());
165165
return res.includes('selected');
166166
});
167167
await devToolsPage.page.keyboard.press('ArrowRight');
@@ -176,8 +176,8 @@ describe('The Memory Panel', function() {
176176
});
177177
await devToolsPage.page.keyboard.press('ArrowRight');
178178
await devToolsPage.waitForFunction(async () => {
179-
const pendingActiviesChildren = await devToolsPage.waitForElementsWithTextContent('MediaQueryList');
180-
return pendingActiviesChildren.length === 2;
179+
const pendingActivitiesChildren = await devToolsPage.waitForElementsWithTextContent('MediaQueryList');
180+
return pendingActivitiesChildren.length === 2;
181181
});
182182
});
183183

@@ -252,8 +252,8 @@ describe('The Memory Panel', function() {
252252

253253
// check that we found two V8EventListener objects
254254
await devToolsPage.waitForFunction(async () => {
255-
const pendingActiviesChildren = await devToolsPage.waitForElementsWithTextContent('V8EventListener');
256-
return pendingActiviesChildren.length === 2;
255+
const pendingActivitiesChildren = await devToolsPage.waitForElementsWithTextContent('V8EventListener');
256+
return pendingActivitiesChildren.length === 2;
257257
});
258258

259259
// Now we want to get the two rows below the "shared in leaking()" row and assert on them.

0 commit comments

Comments
 (0)