Bug 1054326: Initial attempt to submit Imagecompare test framework and test cases int...

...o the main branch
I did the following, but I ran into an issue.  If I take the screenshot while I'm running the browser, the test will fail, because when the browser is running, it is already on top level frame.  Is there a way to find which frame I am currently in, remember that, and return to that frame?  I tried with get_active_frame(), but I don't think I'm doing this properly.


        self.marionette.switch_to_frame()
        if self.is_element_displayed(*System._status_bar_locator):
            # get the size of the status bar to crop off
            status_bar = self.marionette.find_element(*System._status_bar_locator)
            # get the size of the status bar, and multiply it by the device pixel ratio to get the exact size on device
            self.crop_height = int(status_bar.size['height']
                                   * self.marionette.execute_script('return window.wrappedJSObject.devicePixelRatio;'))
        else:
            self.crop_height = 0
        self.apps.switch_to_displayed_app()