Fix bug 908745 - Add tests for the changes from bugs 872195, 899326 & 899770. r=philipp