Open Bug 1982951 Opened 1 year ago Updated 9 days ago

widget/tests/test_clipboard_getDataSnapshot[Sync].html fails on new android 14 emulator image

Categories

(Core :: Widget, defect)

defect

Tracking

()

People

(Reporter: jmaher, Assigned: m_kato)

References

Details

Attachments

(1 file)

on this try push, there are many failures, but it appears that in most instances widget/tests/test_clipboard_getDataSnapshot.html is failing with errors (such as got text/plain, expecting text/html) (as per this log)

I am planning on skipping this test on android 14 in bug 1982943.

Severity: -- → S4
Assignee: nobody → m_kato

https://searchfox.org/firefox-main/rev/eb8ceeebe16204dabfc82bd9673a09e3db4d0217/mobile/android/geckoview/src/main/java/org/mozilla/gecko/Clipboard.java#235-239

Android ClipItem can has text, html, url and intent on one mime type. So before Android P, we check text and htmltext in ClipData, then if HTML text exists, it can HTML mime type. After Android change (https://developer.android.com/about/versions/12/behavior-changes-all#clipboard-access-notifications), we check MIME type instead. text/plain in Gecko means text/plain and text/html in GV.

Also the following WPTs are failed by same reason.

  • /clipboard-apis/async-html-script-removal.https.html
  • /clipboard-apis/async-write-html-read-html.https.html

https://treeherder.mozilla.org/jobs?repo=try&revision=cd24ac2c4505d7a360e40c80fe010cf12acf8e3d

This issue occurs by bug 1755052 since we cannot check content data
without clipboard notifications after Android 12.

Even if text/html type, Android's ClipData can have both text and html.
Before Android 12, we check text data into ClipData whether it has
text. But, by Android 12 changes, we cannot check it without clipboard
access notifications.

So then, we check MIME type only whether this is text/html or text/plain
on Android 12+. If Gecko requests text/plain, we allow text/html too.
But this causes that several tests are failed.

So we should add both mimetypes when plain text and html text are set.
Also, we shouldn't contain HTML when requesting plain text.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: