Bug 1040342 - Follow up to bug 1039199 with tests
Merge pull request #21893 from etiennesegonzac/bug-1040342

Bug 1040342 - Follow up to bug 1039199 with tests r=Rik