New issue
Advanced search Search tips

Issue 901230 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Task



Sign in to add a comment

AcceptLanguageTest#testAcceptLanguage* depends on actual device locale

Project Member Reported by ntfschr@chromium.org, Nov 2

Issue description

I tried running AcceptLanguageTest#testAcceptLanguage* tests, and was surprised to find that these fail on master branch if my device is in a non-English locale. Even if my device *is* in US English, it still fails tests if I have other languages in my "language preferences" list.

BTW I think Nougat introduced locale lists. Prior to that, the device could only be in a single locale at a time.

We should see if we can remove a dependency on the actual device locale if possible, or we should comment the tests to indicate this is a dependency. I think this line [1] is supposed to fix this for pre-N devices (haven't confirmed though), although this is definitely broken for N+.

[1] https://cs.chromium.org/chromium/src/android_webview/javatests/src/org/chromium/android_webview/test/AcceptLanguageTest.java?l=91&rcl=4f9c35c3635144e2c2d1b87d09cbcf076d138b66
 
Owner: changwan@chromium.org
Thanks, let me take a look.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a540d48c6f40a4a17d3fa14f6ae7f50c9f0a00fb

commit a540d48c6f40a4a17d3fa14f6ae7f50c9f0a00fb
Author: Changwan Ryu <changwan@google.com>
Date: Tue Nov 06 00:26:32 2018

Fix AcceptLanguageTest for N+

The test fails when non-English locale is used, or even when there is a
secondary language set in the language preferences.

Nougat introduced local lists, so checking the default locale isn't
enough to ensure that there isn't any secondary locale, and setting
the default locale does not remove the secondary locale.

This CL provides a separate code path for multiple locale check in N+.

Bug:  901230 
Change-Id: I181378e79888a36d47db7c1c3ca360573fdec235
Reviewed-on: https://chromium-review.googlesource.com/c/1318670
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605536}
[modify] https://crrev.com/a540d48c6f40a4a17d3fa14f6ae7f50c9f0a00fb/android_webview/javatests/src/org/chromium/android_webview/test/AcceptLanguageTest.java

Status: Fixed (was: Available)

Sign in to add a comment