• Akihiro Ota's avatar
    TTS: Perform case-insensitive comparison on locales when choosing voice. · 636e8ad5
    Akihiro Ota authored
    Consider the following scenario:
    Voice1.lang = "en-us" (all lower case)
    Voice2.lang = "en-US" (country code is upper case)
    Utterance.lang = "en-us" (all lower case)
    The user has set Voice2 as their preferred voice for English.
    
    The old code would choose voice1 as the best voice for the utterance
    because voice1.lang == utterance.lang. voice2.lang != utterance.lang
    because of the difference in casing. This was leading to issues in
    ChromeVox's voice switching behavior, where eSpeak was sometimes being
    used, even if the user had set Chrome OS US English as their preferred
    voice.
    
    The tangible effect of this change is that ChromeVox voice switching
    will respect the user's preferred voices.
    
    voices.
    --gtest_filter="TtsControllerTest.TestGetMatchingVoice"'. Also manually
    verify the bug no longer repros after the fix.
    
    Fixed: 1121592
    AX-Relnotes: ChromeVox voice switching now respects the user's preferred
    Test: 'out/cros/content_unittests
    Change-Id: I0588b50fbbc4ee7f0b71741b2bb312c9d6d5b14c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617511
    Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
    Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#842270}
    636e8ad5
tts_controller_impl.cc 27.9 KB