Open Bug 676968 Opened 13 years ago Updated 2 years ago

xpcshell test image/test/unit/test_imgtools.js fails on Android

Categories

(Core :: Graphics: ImageLib, defect)

x86
Android
defect

Tracking

()

REOPENED

People

(Reporter: gbrown, Unassigned)

Details

(Whiteboard: [mobile-testing][xpcshell])

With patches for bug 668349 and 668351, xpcshell tests can be run on an Android device, and the majority of tests pass. 

However, modules/libpr0n/test/unit/test_imgtools.js fails consistently when run on Android.
Whiteboard: [mobile-testing][xpcshell]
OS: Linux → Android
A log of the failures would be helpful in all of the xpcshell bugs.
geoff@geoff-MacBookPro:~/src/mozilla-central/objdir-droid$ make SOLO_FILE=test_imgtools.js -C modules/libpr0n/test check-one-remote
make: Entering directory `/home/geoff/src/mozilla-central/objdir-droid/modules/libpr0n/test'
/usr/bin/python2.6 -u ../../../../config/pythonpath.py \
	  -I../../../../build \
	  -I../../../../build/mobile \
	  ../../../../testing/xpcshell/remotexpcshelltests.py \
	  --symbols-path=../../../dist/crashreporter-symbols \
	  --build-info-json=../../../mozinfo.json \
	  --test-path=test_imgtools.js \
	  --profile-name=fennec \
	  --verbose \
	   \
	  --dm_trans=adb \
	  --deviceIP= \
	  --objdir=../../.. \
	  --apk=../../../dist/fennec-8.0a1.en-US.eabi-arm.apk \
          --noSetup \
	  ../../../_tests/xpcshell/modules/libpr0n/test/unit
package set: org.mozilla.fennec_unofficial
chmod /data/local/tests/xpcshell/p
TEST-INFO | profile dir is /data/local/tests/xpcshell/p
TEST-INFO | /home/geoff/src/mozilla-central/objdir-droid/_tests/xpcshell/modules/libpr0n/test/unit/test_imgtools.js | running test ...
cd /data/local/tests/xpcshell/modules/libpr0n/test/unit; LD_LIBRARY_PATH=/data/local/tests/xpcshell/b; export CACHE_PATH=/data/local/tests/xpcshell/b; export GRE_HOME=/data/data/org.mozilla.fennec_unofficial; export XPCSHELL_TEST_PROFILE_DIR=/data/local/tests/xpcshell/p; /data/local/tests/xpcshell/b/xpcshell -r /data/local/tests/xpcshell/c/httpd.manifest --greomni /data/local/tests/xpcshell/b/fennec-8.0a1.en-US.eabi-arm.apk -j -s -e 'const _HTTPD_JS_PATH = "/data/local/tests/xpcshell/c/httpd.js";' -e 'const _HEAD_JS_PATH = "/data/local/tests/xpcshell/head.js";' -f /data/local/tests/xpcshell/head.js -e 'const _SERVER_ADDR = "localhost"' -e 'const _HEAD_FILES = [];' -e 'const _TAIL_FILES = [];' -e 'const _TEST_FILE = ["test_imgtools.js"];' -e '_execute_test(); quit(0);'
TEST-KNOWN-FAIL | /home/geoff/src/mozilla-central/objdir-droid/_tests/xpcshell/modules/libpr0n/test/unit/test_imgtools.js | test passed
>>>>>>>
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/geoff/src/mozilla-central/xpcom/base/nsTraceRefcntImpl.cpp, line 172
WARNING: No default pref files found.: file /home/geoff/src/mozilla-central/modules/libpref/src/Preferences.cpp, line 923
WARNING: GetIsLinkUp is not supported without a bridge connection: file /home/geoff/src/mozilla-central/netwerk/system/android/nsAndroidNetworkLinkService.cpp, line 61

TEST-INFO | (xpcshell/head.js) | test 1 pending

TEST-PASS | test_imgtools.js | [run_test : 150] 10698 == 10698

TEST-PASS | test_imgtools.js | [run_test : 158] 64 == 64

TEST-PASS | test_imgtools.js | [run_test : 159] 64 == 64

TEST-PASS | test_imgtools.js | [run_test : 174] 1081 == 1081

TEST-UNEXPECTED-FAIL | test_imgtools.js | 1079 == 1081 - See following stack:
JS frame :: /data/local/tests/xpcshell/head.js :: do_throw :: line 445
JS frame :: /data/local/tests/xpcshell/head.js :: _do_check_eq :: line 539
JS frame :: /data/local/tests/xpcshell/head.js :: do_check_eq :: line 560
JS frame :: test_imgtools.js :: compareArrays :: line 86
JS frame :: test_imgtools.js :: run_test :: line 178
JS frame :: /data/local/tests/xpcshell/head.js :: _execute_test :: line 326
JS frame :: -e :: <TOP_LEVEL> :: line 1

TEST-INFO | (xpcshell/head.js) | exiting test

TEST-UNEXPECTED-FAIL | (xpcshell/head.js) | FAILED in test #2 -- test encoding a scaled JPEG: 2147500036
WARNING: nsExceptionService ignoring thread destruction after shutdown: file /home/geoff/src/mozilla-central/xpcom/base/nsExceptionService.cpp, line 197
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
Assertion failed at /home/geoff/src/mozilla-central/gfx/cairo/cairo/src/cairo-ft-font.c:443: unscaled->face == NULL
WARNING: OOPDeinit() without successful OOPInit(): file /home/geoff/src/mozilla-central/toolkit/crashreporter/nsExceptionHandler.cpp, line 1830
nsStringStats
 => mAllocCount:           1668
 => mReallocCount:           94
 => mFreeCount:            1578  --  LEAKED 90 !!!
 => mShareCount:           7294
 => mAdoptCount:             57
 => mAdoptFreeCount:         57
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /home/geoff/src/mozilla-central/xpcom/base/nsTraceRefcntImpl.cpp, line 172
<<<<<<<
INFO | Result summary:
INFO | Passed: 0
INFO | Failed: 0
INFO | Todo: 1
make: Leaving directory `/home/geoff/src/mozilla-central/objdir-droid/modules/libpr0n/test'
geoff@geoff-MacBookPro:~/src/mozilla-central/objdir-droid$
It seems modules/libpr0n no longer exists!
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Sorry - I see the test now in image/test...and it still fails.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: xpcshell test modules/libpr0n/test/unit/test_imgtools.js fails on Android → xpcshell test image/test/unit/test_imgtools.js fails on Android
When I test this on my Nexus 5 the first failure is on test #5. This test takes 'container', which is image2.jpg decoded to an imgIContainer, then it encodes this imgIContainer to a PNG and compares it to image2jpg16x16.png. The thing is that the imgIContainer has the format SurfaceFormat::R5G6B5. Almost certainly what's happening here is that the use of SurfaceFormat::R5G6B5 results in a loss of precision which causing this failure.

The imgIContainer has format SurfaceFormat::R5G6B5 because when image2.jpg is decoded, RasterImage::DecodingComplete() calls RasterImage::Optimize() which has an |ifdef ANDROID| section that optimizes to SurfaceFormat::R5G6B5.

CC'ing :mwu since he added the |ifdef ANDROID| section in bug 980035, and :seth because he reviewed that change.
The 16 bit optimization was there long before bug 980035 though - it just took a more roundabout path.

Not all devices optimize to 16 bits though. What device are we running the tests on? ICS and newer devices are likely to use 32bit formats, so the test should pass there.
(In reply to Michael Wu [:mwu] from comment #6)
> What device are we running the
> tests on? ICS and newer devices are likely to use 32bit formats, so the test
> should pass there.

When I first reported this, I probably tested on Android 2.2.

tbpl runs xpcshell tests on Android 2.3, Android 4.0, and Android 4.2 (x86), and Android 2.2 for just a little longer.
Jonathan was testing on a Nexus 5, which really shouldn't be using the 16bit optimization path. I'm not sure why Optimal2DFormatForContent(gfxContentType::COLOR) is returning SurfaceFormat::R5G6B5 there - that's clearly a bug.

Brian, looks like you touched the depth detection code last. Any ideas?
Flags: needinfo?(bnicholson)
Sorry, but I'm probably not the best person to ask. My only experience with this code is bug 894087, which was a relatively trivial change. Chris worked on bug 803299, so forwarding NEEDINFO to him.
Flags: needinfo?(bnicholson) → needinfo?(chrislord.net)
(In reply to Michael Wu [:mwu] from comment #8)
> Jonathan was testing on a Nexus 5, which really shouldn't be using the 16bit
> optimization path. I'm not sure why
> Optimal2DFormatForContent(gfxContentType::COLOR) is returning
> SurfaceFormat::R5G6B5 there - that's clearly a bug.

Has anyone debugged to see why 565 is being returned on a Nexus 5? It certainly isn't for content rendering, is this some other path that was missed?
Flags: needinfo?(chrislord.net)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.