def test_in_app_quit_with_callback(self): if self.marionette.session_capabilities["platformName"] != "windows_nt": skip("Bug 1363368 - Wrong window handles after in_app restarts") self.marionette.quit(in_app=True, callback=self.shutdown) self.assertEqual(self.marionette.session, None) with self.assertRaisesRegexp(errors.MarionetteException, "Please start a session"): self.marionette.get_url() self.marionette.start_session() self.assertNotEqual(self.marionette.session_id, self.session_id) self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"), "about:")
def test_in_app_quit_with_callback(self): if self.marionette.session_capabilities["platformName"] != "windows_nt": skip("Bug 1363368 - Wrong window handles after in_app restarts") self.marionette.quit(in_app=True, callback=self.shutdown) self.assertEqual(self.marionette.session, None) with self.assertRaisesRegexp(errors.MarionetteException, "Please start a session"): self.marionette.get_url() self.marionette.start_session() self.assertNotEqual(self.marionette.session_id, self.session_id) self.assertNotEqual( self.marionette.get_pref("startup.homepage_welcome_url"), "about:")
def test_in_app_restart(self): if self.marionette.session_capabilities["platformName"] != "windows_nt": skip("Bug 1363368 - Wrong window handles after in_app restarts") self.marionette.restart(in_app=True) self.assertEqual(self.marionette.session_id, self.session_id) # An in-app restart will keep the same process id only on Linux if self.marionette.session_capabilities["platformName"] == "linux": self.assertEqual(self.marionette.process_id, self.pid) else: self.assertNotEqual(self.marionette.process_id, self.pid) self.assertNotEqual( self.marionette.get_pref("startup.homepage_welcome_url"), "about:")
def test_reset_context_after_quit_by_using_context(self): if self.marionette.session_capabilities["platformName"] != "windows_nt": skip("Bug 1363368 - Wrong window handles after in_app restarts") # Check that we are in content context which is used by default in # Marionette self.assertNotIn("chrome://", self.marionette.get_url(), "Context does not default to content") with self.marionette.using_context("chrome"): self.marionette.quit(in_app=True) self.assertEqual(self.marionette.session, None) self.marionette.start_session() self.assertNotIn("chrome://", self.marionette.get_url(), "Not in content context after quit with using_context")
def test_in_app_restart(self): if self.marionette.session_capabilities["platformName"] != "windows_nt": skip("Bug 1363368 - Wrong window handles after in_app restarts") self.marionette.restart(in_app=True) self.assertEqual(self.marionette.session_id, self.session_id) # An in-app restart will keep the same process id only on Linux if self.marionette.session_capabilities["platformName"] == "linux": self.assertEqual(self.marionette.process_id, self.pid) else: self.assertNotEqual(self.marionette.process_id, self.pid) self.assertNotEqual(self.marionette.get_pref("startup.homepage_welcome_url"), "about:")
def test_keep_context_after_restart_by_using_context(self): if self.marionette.session_capabilities["platformName"] != "windows_nt": skip("Bug 1363368 - Wrong window handles after in_app restarts") # Check that we are in content context which is used by default in # Marionette self.assertNotIn("chrome://", self.marionette.get_url(), "Context does not default to content") # restart while we are in chrome context with self.marionette.using_context('chrome'): self.marionette.restart(in_app=True) # An in-app restart will keep the same process id only on Linux if self.marionette.session_capabilities["platformName"] == "linux": self.assertEqual(self.marionette.process_id, self.pid) else: self.assertNotEqual(self.marionette.process_id, self.pid) self.assertIn("chrome://", self.marionette.get_url(), "Not in chrome context after a restart with using_context")