Task 54279: Backport device-orientation tests

Checked out tests/ at ce6ab12 (initial porting/minor test fix) and
backported to 3.6.1