Closed Bug 833764 Opened 11 years ago Closed 11 years ago

[B2G] target is null after tapping on cards view

Categories

(Remote Protocol :: Marionette, defect)

Other
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: zcampbell, Assigned: automatedtester)

References

Details

Attachments

(1 file)

Attached file TC for target is null
In this test case, loading 3 apps, then loading cards view then switching to one of them causes marionette to lose its way.

Any commands to marionette will fail with "TypeError: target is null"

Marionette should stay on the homescreen frame.
I added a break point at line 
        self.marionette.tap(second_app_card) 

and fallowed the log cat:
http://pastebin.mozilla.org/2080604


This is what we get after the tap:

I/Gecko   (  110): 1358949065265        Marionette      DEBUG Got request: execute, data: {"to":"conn27.marionette1","specialPowers":false,"session":"6-b2g","newSandbox":true,"args":[],"type":"executeScript","value":"return typeof window.wrappedJSObject.MouseEventShim === 'undefined';"}, id: {59354758-e962-42e0-9bac-38167d59eb49}
I/Gecko   (  110): 1358949065355        Marionette      INFO  sendToClient: {"from":"conn27.marionette1","value":true}, {59354758-e962-42e0-9bac-38167d59eb49}, {59354758-e962-42e0-9bac-38167d59eb49}
I/Gecko   (  110): 1358949065363        Marionette      DEBUG Got request: execute, data: {"to":"conn27.marionette1","specialPowers":false,"session":"6-b2g","newSandbox":true,"args":[{"ELEMENT":"{3786edc5-fc84-465a-b23a-a10be3f0956b}"},true],"type":"executeScript","value":"SyntheticGestures.tap(arguments[0], null, null, null, null, arguments[1]);"}, id: {f7b9ad06-1765-4f08-a896-13e97a9c3f65}
I/Gecko   (  110): 1358949065438        Marionette      INFO  sendToClient: {"from":"conn27.marionette1","value":null}, {f7b9ad06-1765-4f08-a896-13e97a9c3f65}, {f7b9ad06-1765-4f08-a896-13e97a9c3f65}
E/GeckoConsole(  110): [JavaScript Error: "TypeError: target is null" {file: "chrome://marionette/content/marionette-listener.js" line: 902}]
D/memalloc(  110): /dev/pmem: Allocated buffer base:0x4ad5a000 size:614400 offset:1843200 fd:157
I/Gecko   (  110): 1358949065627        Marionette      INFO  sendToClient: {"from":"conn27.marionette1","error":{"message":"TypeError: target is null","status":17,"stacktrace":null}}, undefined, null
I/Gecko   (  110): 1358949065628        Marionette      WARN  got a response with no command_id
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4ae86000 size:614400 offset:1228800 fd:102
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4b028000 size:614400 offset:2940928 fd:160
D/memalloc(  110): /dev/pmem: Allocated buffer base:0x4ad5a000 size:614400 offset:1228800 fd:102
D/memalloc(  110): /dev/pmem: Allocated buffer base:0x4ad5a000 size:614400 offset:2940928 fd:160
D/memalloc( 1879): /dev/pmem: Mapped buffer base:0x44400000 size:3555328 offset:2940928 fd:27
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4ae86000 size:614400 offset:1228800 fd:102
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4af1c000 size:614400 offset:1843200 fd:157
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x44eeb000 size:2707456 offset:2699264
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x45208000 size:2805760 offset:2707456
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x454ea000 size:2818048 offset:2805760
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x44c58000 size:2699264 offset:2576384
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4afb2000 size:8192 offset:2457600 fd:127
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4afb4000 size:98304 offset:2465792 fd:130
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4afcc000 size:12288 offset:2564096 fd:134
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4b00a000 size:122880 offset:2818048 fd:154
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x44200000 size:2465792 offset:2457600
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x44503000 size:2564096 offset:2465792
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x44900000 size:2576384 offset:2564096
D/memalloc(  397): /dev/pmem: Unmapping buffer base:0x457c0000 size:2940928 offset:2818048
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4afed000 size:8192 offset:2699264 fd:142
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4afef000 size:98304 offset:2707456 fd:146
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4b007000 size:12288 offset:2805760 fd:150
D/memalloc(  110): /dev/pmem: Freeing buffer base:0x4afcf000 size:122880 offset:2576384 fd:138
I/Gecko   (  110): 1358949068345        Marionette      INFO  sendToClient: {"from":"conn27.marionette1","value":"{6bb1c1c6-a570-4c9a-8b23-4859ab9a991e}"}, {d799776e-5714-467a-b856-e85cf473483f}, {d799776e-5714-467a-b856-e85cf473483f}
I/Gecko   (  110): 1358949070377        Marionette      INFO  sendToClient: {"from":"conn27.marionette1","ok":true}, {047cdd6e-4327-4f55-918f-7d5735d0a658}, {047cdd6e-4327-4f55-918f-7d5735d0a658}
E/GeckoConsole(  110): [JavaScript Error: "[Exception... "Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIOutputStream.write]"  nsresult: "0x80470002 (NS_BASE_STREAM_CLOSED)"  location: "JS frame :: chrome://global/content/devtools/dbg-transport.js :: DT_onOutputStreamReady :: line 94"  data: no]" {file: "chrome://global/content/devtools/dbg-transport.js" line: 94}]
also any command run after that tap gets the target is null error.

The command run after that gets as a response a mix or the output of the previous and/or the current command.

So if we run a page source after the tap it gets  the target is null error.
if we run a self.marionette.get_active_element() after the page source the returned object will "contain" a mix between the pages_source output and the the get_active_element() output

Here is a screencast http://www.youtube.com/watch?v=DPUYeZkIeAk&feature=youtu.be
hurray replicated, now to debug
It appears we are not returning the error straight away. Logcat is erroring on the tap saying its not there and then complaining that the ID is missing

I/Gecko   (  105): 1359127255815	Marionette	DEBUG	Got request: execute, data: {"to":"conn0.marionette1","specialPowers":false,"session":"6-b2g","newSandbox":true,"args":[{"ELEMENT":"{fd866d85-10bf-46b5-835d-9a2cabf24a0e}"},true],"type":"executeScript","value":"SyntheticGestures.tap(arguments[0], null, null, null, null, arguments[1]);"}, id: {704cea17-c28e-403d-b3c9-031c17c7afb9}
I/Gecko   (  105): 1359127255910	Marionette	INFO	sendToClient: {"from":"conn0.marionette1","value":null}, {704cea17-c28e-403d-b3c9-031c17c7afb9}, {704cea17-c28e-403d-b3c9-031c17c7afb9}
E/GeckoConsole(  105): [JavaScript Error: "TypeError: target is null" {file: "chrome://marionette/content/marionette-listener.js" line: 902}]
D/memalloc(  105): /dev/pmem: Allocated buffer base:0x4a05a000 size:614400 offset:2371584 fd:106
I/Gecko   (  105): 1359127256096	Marionette	INFO	sendToClient: {"from":"conn0.marionette1","error":{"message":"TypeError: target is null","status":17,"stacktrace":null}}, undefined, null
I/Gecko   (  105): 1359127256096	Marionette	WARN	got a response with no command_id
it is appearing that the element is being passed through to the synthetic gestures library but then it thinks it is null. I am wondering if the issue is down to context not being what we think it us when tap() is finally called.
i think that this is similar to bug 833761 but need more proof
I have the same issue when running gaia test_wallpaper.py, which needs to tap on an element that is not in view. It is down in the list of settings. If I manually scroll fast enough, the test manages to tap on the element and finally pass.
test case in bug 852985 is much prettier :)

def test_issue_550(self):
  self.lockscreen.lock()
  self.marionette.tap(self.marionette.find_element('id', 'lockscreen-area-camera'))
(In reply to David Burns :automatedtester from comment #9)
> test case in bug 852985 is much prettier :)
> 
> def test_issue_550(self):
>   self.lockscreen.lock()
>   self.marionette.tap(self.marionette.find_element('id',
> 'lockscreen-area-camera'))

Both this and the attached test pass for me using mozilla-inbound; I'm guessing this report was made against mozilla-b2g18, though.  I'll try reproducing it there.  It's likely some patches that need to be uplifted.
Yep, reproduced it against mozilla-b2g18.  So it's just a matter of figuring out what patches are missing and need to be uplifted.
Thanks for looking into this jgriffin!
Depends on: 814768
Depends on: 834266
Depends on: 845625
Uplifting the patches from bugs 814768, 834266 and 845625 seemed to do the trick.  Let me know if you run into this problem again.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Validated this with both test cases against 0.5.22, v1-train Gaia build 2013032507xx and it's nice and stable. great!
Status: RESOLVED → VERIFIED
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: