Merge pull request #9377 from crdlc/bug-865197 a=npotb

Bug 865197 - Follow-up 861846 - Unit test fixed and added a new one r=julien
(cherry picked from commit 610a684aad80f4d1a4576b5dc1e42dfaba055346)