bug 1504478: marionette: update tests to use non-deprecated commands; r=whimboo a=test-only
authorAndreas Tolfsen <ato@sny.no>
Mon, 05 Nov 2018 18:40:37 +0000
changeset 501174 acff7819c694bc9350247ca4ad3864dd583cf310
parent 501173 d6cb1ff3b59fe0e98d997dcacf77f7734dcbc9a8
child 501175 8c56b767fb9615ab078057390bb897a81538f7bd
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo, test-only
bugs1504478
milestone64.0
bug 1504478: marionette: update tests to use non-deprecated commands; r=whimboo a=test-only Depends on D10835 Differential Revision: https://phabricator.services.mozilla.com/D10836
testing/marionette/harness/marionette_harness/tests/unit/test_context.py
testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_context.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_context.py
@@ -19,17 +19,17 @@ class ContextTestCase(MarionetteTestCase
         self.content = self.marionette.CONTEXT_CONTENT
 
         self.assertEquals(self.get_context(), self.content)
 
         test_url = self.marionette.absolute_url("empty.html")
         self.marionette.navigate(test_url)
 
     def get_context(self):
-        return self.marionette._send_message("getContext", key="value")
+        return self.marionette._send_message("Marionette:GetContext", key="value")
 
 
 class TestSetContext(ContextTestCase):
 
     def test_switch_context(self):
         self.marionette.set_context(self.chrome)
         self.assertEquals(self.get_context(), self.chrome)
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
@@ -31,32 +31,32 @@ class TestMarionette(MarionetteTestCase)
         self.marionette.quit()
         self.assertIsNotNone(self.marionette.instance.runner.returncode)
         start_time = time.time()
         self.assertRaises(socket.timeout, self.marionette.raise_for_port, timeout=5)
         self.assertLess(time.time() - start_time, 5)
 
     def test_disable_enable_new_connections(self):
         # Do not re-create socket if it already exists
-        self.marionette._send_message("acceptConnections", {"value": True})
+        self.marionette._send_message("Marionette:AcceptConnections", {"value": True})
 
         try:
             # Disabling new connections does not affect existing ones...
-            self.marionette._send_message("acceptConnections", {"value": False})
+            self.marionette._send_message("Marionette:AcceptConnections", {"value": False})
             self.assertEqual(1, self.marionette.execute_script("return 1"))
 
             # but only new connection attempts
             marionette = Marionette(host=self.marionette.host, port=self.marionette.port)
             self.assertRaises(socket.timeout, marionette.raise_for_port, timeout=1.0)
 
-            self.marionette._send_message("acceptConnections", {"value": True})
+            self.marionette._send_message("Marionette:AcceptConnections", {"value": True})
             marionette.raise_for_port(timeout=10.0)
 
         finally:
-            self.marionette._send_message("acceptConnections", {"value": True})
+            self.marionette._send_message("Marionette:AcceptConnections", {"value": True})
 
     def test_client_socket_uses_expected_socket_timeout(self):
         current_socket_timeout = self.marionette.socket_timeout
 
         self.assertEqual(current_socket_timeout,
                          self.marionette.client.socket_timeout)
         self.assertEqual(current_socket_timeout,
                          self.marionette.client._sock.gettimeout())
@@ -64,20 +64,20 @@ class TestMarionette(MarionetteTestCase)
 
 class TestContext(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context(self.marionette.CONTEXT_CONTENT)
 
     def get_context(self):
-        return self.marionette._send_message("getContext", key="value")
+        return self.marionette._send_message("Marionette:GetContext", key="value")
 
     def set_context(self, value):
-        return self.marionette._send_message("setContext", {"value": value})
+        return self.marionette._send_message("Marionette:SetContext", {"value": value})
 
     def test_set_context(self):
         self.assertEqual(self.set_context("content"), {"value": None})
         self.assertEqual(self.set_context("chrome"), {"value": None})
 
         for typ in [True, 42, [], {}, None]:
             with self.assertRaises(errors.InvalidArgumentException):
                 self.set_context(typ)
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
@@ -26,17 +26,17 @@ class TestServerQuitApplication(Marionet
             self.marionette.start_session()
 
     def quit(self, flags=None):
         body = None
         if flags is not None:
             body = {"flags": list(flags)}
 
         try:
-            resp = self.marionette._send_message("quit", body)
+            resp = self.marionette._send_message("Marionette:Quit", body)
         finally:
             self.marionette.session_id = None
             self.marionette.session = None
             self.marionette.process_id = None
             self.marionette.profile = None
             self.marionette.window = None
 
         self.assertIn("cause", resp)
@@ -45,17 +45,17 @@ class TestServerQuitApplication(Marionet
         self.marionette.instance.runner.wait()
 
         return resp["cause"]
 
     def test_types(self):
         for typ in [42, True, "foo", []]:
             print("testing type {}".format(type(typ)))
             with self.assertRaises(errors.InvalidArgumentException):
-                self.marionette._send_message("quit", typ)
+                self.marionette._send_message("Marionette:Quit", typ)
 
         with self.assertRaises(errors.InvalidArgumentException):
             self.quit("foo")
 
     def test_undefined_default(self):
         cause = self.quit()
         self.assertEqual("shutdown", cause)
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
@@ -12,12 +12,12 @@ class TestTearDownContext(MarionetteTest
         MarionetteTestCase.setUp(self)
         self.marionette.set_context(self.marionette.CONTEXT_CHROME)
 
     def tearDown(self):
         self.assertEqual(self.get_context(), self.marionette.CONTEXT_CHROME)
         MarionetteTestCase.tearDown(self)
 
     def get_context(self):
-        return self.marionette._send_message("getContext", key="value")
+        return self.marionette._send_message("Marionette:GetContext", key="value")
 
     def test_skipped_teardown_ok(self):
         raise SkipTest("This should leave our teardown method in chrome context")