It looks like switch_to_displayed_app won't work because of https://bugzilla.mozilla.org/show_bug.cgi?id=962078, which I just opened. Could you please add a TODO to this file to change the code to use switch_to_displayed_app when bug 962078 is fixed?