Bug 1040342 - Follow up to bug 1039199 with tests