Commit ec9efc80 authored by Ben Reich's avatar Ben Reich Committed by Commit Bot

[js-code-coverage] searchHidingViaTab to optionally use $i18n{} label

CL:2559234 introduced changes to disable $i18n{} template replacement
when the --devtools-code-coverage command line flag is passed and only
for the ChromeOS Files app extension in-test.

Identify when the files app searchHidingViaTab test is in code coverage
mode and use the $i18n{} label instead of the replaced string.

	--devtools-code-coverage

Bug: 1152612
Test: browser_tests --gtest_filter="*searchHidingViaTab*"
Test: browser_tests --gtest_filter="*searchHidingViaTab*"
Change-Id: I6c869e9d6a7bdec0737ede2d2ee67478bf3ba150
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2558819Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Ben Reich <benreich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831203}
parent f42aaef1
......@@ -181,11 +181,19 @@
// Wait for the search box to expand.
await remoteCall.waitForElementLost(appId, '#search-wrapper[collapsed]');
// Returns $i18n{} label if code coverage is enabled.
let expectedLabelText = 'Search';
const isDevtoolsCoverageActive =
await sendTestMessage({name: 'isDevtoolsCoverageActive'});
if (isDevtoolsCoverageActive === 'true') {
expectedLabelText = '$i18n{SEARCH_TEXT_LABEL}';
}
// Verify the search input has focus.
const input =
await remoteCall.callRemoteTestUtil('deepGetActiveElement', appId, []);
chrome.test.assertEq(input.attributes['id'], 'input');
chrome.test.assertEq(input.attributes['aria-label'], 'Search');
chrome.test.assertEq(input.attributes['aria-label'], expectedLabelText);
// Send Tab key to focus the next element.
const result = await sendTestMessage({name: 'dispatchTabKey'});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment