Bug 1109183 - Fix imports of the marionette client and remove spurious entry from sys.path provided by mach. r=ahal
authorChris Manchester <cmanchester@mozilla.com>
Tue, 03 Mar 2015 17:37:19 -0800
changeset 231821 8add60e27b0a9210a092058a1afe20f36cf21f43
parent 231820 da4499b5210574bd4053d9240fc723cf9b4d30e4
child 231822 4674f09e977f0aa2f32e64a2770ff86dc6334f1c
push id56370
push userryanvm@gmail.com
push dateWed, 04 Mar 2015 14:39:31 +0000
treeherdermozilla-inbound@a190978e94f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1109183
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1109183 - Fix imports of the marionette client and remove spurious entry from sys.path provided by mach. r=ahal
browser/components/loop/test/functional/test_1_browser_call.py
browser/components/loop/test/shared/frontend_tester.py
build/mach_bootstrap.py
layout/base/tests/marionette/test_selectioncarets.py
layout/base/tests/marionette/test_selectioncarets_multiplerange.py
layout/base/tests/marionette/test_touchcaret.py
testing/marionette/client/marionette/tests/unit/test_accessibility.py
testing/marionette/client/marionette/tests/unit/test_anonymous_content.py
testing/marionette/client/marionette/tests/unit/test_appcache.py
testing/marionette/client/marionette/tests/unit/test_capabilities.py
testing/marionette/client/marionette/tests/unit/test_clearing.py
testing/marionette/client/marionette/tests/unit/test_click.py
testing/marionette/client/marionette/tests/unit/test_click_chrome.py
testing/marionette/client/marionette/tests/unit/test_click_scrolling.py
testing/marionette/client/marionette/tests/unit/test_cookies.py
testing/marionette/client/marionette/tests/unit/test_data_driven.py
testing/marionette/client/marionette/tests/unit/test_date_time_value.py
testing/marionette/client/marionette/tests/unit/test_elementState.py
testing/marionette/client/marionette/tests/unit/test_elementState_chrome.py
testing/marionette/client/marionette/tests/unit/test_element_touch.py
testing/marionette/client/marionette/tests/unit/test_elementsize.py
testing/marionette/client/marionette/tests/unit/test_emulator.py
testing/marionette/client/marionette/tests/unit/test_errors.py
testing/marionette/client/marionette/tests/unit/test_execute_async_script.py
testing/marionette/client/marionette/tests/unit/test_execute_isolate.py
testing/marionette/client/marionette/tests/unit/test_execute_script.py
testing/marionette/client/marionette/tests/unit/test_expected.py
testing/marionette/client/marionette/tests/unit/test_expectedfail.py
testing/marionette/client/marionette/tests/unit/test_findelement.py
testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py
testing/marionette/client/marionette/tests/unit/test_gesture.py
testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
testing/marionette/client/marionette/tests/unit/test_getattr.py
testing/marionette/client/marionette/tests/unit/test_getattr_chrome.py
testing/marionette/client/marionette/tests/unit/test_implicit_waits.py
testing/marionette/client/marionette/tests/unit/test_import_script.py
testing/marionette/client/marionette/tests/unit/test_import_script_reuse_window.py
testing/marionette/client/marionette/tests/unit/test_key_actions.py
testing/marionette/client/marionette/tests/unit/test_log.py
testing/marionette/client/marionette/tests/unit/test_marionette.py
testing/marionette/client/marionette/tests/unit/test_modal_dialogs.py
testing/marionette/client/marionette/tests/unit/test_multi_finger.py
testing/marionette/client/marionette/tests/unit/test_navigation.py
testing/marionette/client/marionette/tests/unit/test_pagesource.py
testing/marionette/client/marionette/tests/unit/test_position.py
testing/marionette/client/marionette/tests/unit/test_profile_management.py
testing/marionette/client/marionette/tests/unit/test_rendered_element.py
testing/marionette/client/marionette/tests/unit/test_report.py
testing/marionette/client/marionette/tests/unit/test_run_js_test.py
testing/marionette/client/marionette/tests/unit/test_screen_orientation.py
testing/marionette/client/marionette/tests/unit/test_screenshot.py
testing/marionette/client/marionette/tests/unit/test_selected.py
testing/marionette/client/marionette/tests/unit/test_selected_chrome.py
testing/marionette/client/marionette/tests/unit/test_session.py
testing/marionette/client/marionette/tests/unit/test_set_window_size.py
testing/marionette/client/marionette/tests/unit/test_simpletest_sanity.py
testing/marionette/client/marionette/tests/unit/test_single_finger.py
testing/marionette/client/marionette/tests/unit/test_single_finger_desktop.py
testing/marionette/client/marionette/tests/unit/test_skip_setup.py
testing/marionette/client/marionette/tests/unit/test_specialpowers.py
testing/marionette/client/marionette/tests/unit/test_submit.py
testing/marionette/client/marionette/tests/unit/test_switch_frame.py
testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py
testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
testing/marionette/client/marionette/tests/unit/test_text.py
testing/marionette/client/marionette/tests/unit/test_text_chrome.py
testing/marionette/client/marionette/tests/unit/test_timeouts.py
testing/marionette/client/marionette/tests/unit/test_typing.py
testing/marionette/client/marionette/tests/unit/test_visibility.py
testing/marionette/client/marionette/tests/unit/test_wait.py
testing/marionette/client/marionette/tests/unit/test_window_handles.py
testing/marionette/client/marionette/tests/unit/test_window_management.py
testing/marionette/client/marionette/tests/unit/test_window_position.py
testing/marionette/client/marionette/tests/unit/test_window_switching.py
testing/marionette/client/marionette/tests/unit/test_window_title.py
testing/marionette/client/marionette/tests/unit/test_window_type.py
testing/marionette/client/marionette/tests/unit/test_with_using_context.py
testing/marionette/mach_commands.py
--- a/browser/components/loop/test/functional/test_1_browser_call.py
+++ b/browser/components/loop/test/functional/test_1_browser_call.py
@@ -1,19 +1,20 @@
-from marionette_test import MarionetteTestCase
 try:
     from by import By
     from errors import NoSuchElementException, StaleElementException
     # noinspection PyUnresolvedReferences
     from wait import Wait
+    from marionette_test import MarionetteTestCase
 except ImportError:
     from marionette_driver.by import By
     from marionette_driver.errors import NoSuchElementException, StaleElementException
     # noinspection PyUnresolvedReferences
     from marionette_driver import Wait
+    from marionette import MarionetteTestCase
 
 import os
 import sys
 import urlparse
 sys.path.insert(1, os.path.dirname(os.path.abspath(__file__)))
 
 import pyperclip
 
--- a/browser/components/loop/test/shared/frontend_tester.py
+++ b/browser/components/loop/test/shared/frontend_tester.py
@@ -1,9 +1,9 @@
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import NoSuchElementException
 import threading
 import SimpleHTTPServer
 import SocketServer
 import BaseHTTPServer
 import socket
 import urllib
 import urlparse
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -44,17 +44,16 @@ SEARCH_PATHS = [
     'other-licenses/ply',
     'xpcom/idl-parser',
     'testing',
     'testing/taskcluster',
     'testing/xpcshell',
     'testing/web-platform',
     'testing/web-platform/harness',
     'testing/marionette/client',
-    'testing/marionette/client/marionette',
     'testing/marionette/transport',
     'testing/marionette/driver',
     'testing/mozbase/mozcrash',
     'testing/mozbase/mozdebug',
     'testing/mozbase/mozdevice',
     'testing/mozbase/mozfile',
     'testing/mozbase/mozhttpd',
     'testing/mozbase/mozlog',
--- a/layout/base/tests/marionette/test_selectioncarets.py
+++ b/layout/base/tests/marionette/test_selectioncarets.py
@@ -1,16 +1,16 @@
 # -*- coding: utf-8 -*-
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.by import By
 from marionette_driver.marionette import Actions
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.selection import SelectionManager
 from marionette_driver.gestures import long_press_without_contextmenu
 
 from math import ceil, floor
 
 
 class SelectionCaretsTest(MarionetteTestCase):
     _long_press_time = 1        # 1 second
--- a/layout/base/tests/marionette/test_selectioncarets_multiplerange.py
+++ b/layout/base/tests/marionette/test_selectioncarets_multiplerange.py
@@ -1,16 +1,16 @@
 # -*- coding: utf-8 -*-
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.by import By
 from marionette_driver.marionette import Actions
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.selection import SelectionManager
 from marionette_driver.gestures import long_press_without_contextmenu
 
 
 class SelectionCaretsMultipleRangeTest(MarionetteTestCase):
     _long_press_time = 1        # 1 second
 
     def setUp(self):
--- a/layout/base/tests/marionette/test_touchcaret.py
+++ b/layout/base/tests/marionette/test_touchcaret.py
@@ -1,17 +1,17 @@
 # -*- coding: utf-8 -*-
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.by import By
 from marionette_driver.marionette import Actions
 from marionette_driver.selection import SelectionManager
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TouchCaretTest(MarionetteTestCase):
     _input_selector = (By.ID, 'input')
     _textarea_selector = (By.ID, 'textarea')
     _contenteditable_selector = (By.ID, 'contenteditable')
     _large_expiration_time = 3000 * 20  # 60 seconds
 
--- a/testing/marionette/client/marionette/tests/unit/test_accessibility.py
+++ b/testing/marionette/client/marionette/tests/unit/test_accessibility.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import (ElementNotAccessibleException,
                                      ElementNotVisibleException)
 
 
 class TestAccessibility(MarionetteTestCase):
 
     # Elements that are accessible with and without the accessibliity API
     valid_elementIDs = [
--- a/testing/marionette/client/marionette/tests/unit/test_anonymous_content.py
+++ b/testing/marionette/client/marionette/tests/unit/test_anonymous_content.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 from marionette_driver.errors import NoSuchElementException
 from marionette_driver.expected import element_present
 from marionette_driver.marionette import HTMLElement
 from marionette_driver.wait import Wait
 
 class TestAnonymousContent(MarionetteTestCase):
     def setUp(self):
--- a/testing/marionette/client/marionette/tests/unit/test_appcache.py
+++ b/testing/marionette/client/marionette/tests/unit/test_appcache.py
@@ -9,17 +9,17 @@
 #
 #Unless required by applicable law or agreed to in writing, software
 #distributed under the License is distributed on an "AS IS" BASIS,
 #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 #See the License for the specific language governing permissions and
 #limitations under the License.
 
 from marionette_driver.application_cache import ApplicationCache
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class AppCacheTests(MarionetteTestCase):
 
     def testWeCanGetTheStatusOfTheAppCache(self):
         test_url = self.marionette.absolute_url('html5Page')
         self.marionette.navigate(test_url)
         app_cache = self.marionette.application_cache
--- a/testing/marionette/client/marionette/tests/unit/test_capabilities.py
+++ b/testing/marionette/client/marionette/tests/unit/test_capabilities.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import SessionNotCreatedException
 
 class TestCapabilities(MarionetteTestCase):
     def setUp(self):
         super(TestCapabilities, self).setUp()
         self.caps = self.marionette.session_capabilities
         self.marionette.set_context("chrome")
         self.appinfo = self.marionette.execute_script(
@@ -75,9 +75,9 @@ class TestCapabilities(MarionetteTestCas
             self.marionette.start_session(capabilities)
             self.fail("Marionette Should have throw an exception")
         except SessionNotCreatedException as e:
             # We want an exception
             self.assertIn("CookiesAndCream does not equal", str(e))
 
         # Start a new session just to make sure we leave the browser in the
         # same state it was before it started the test
-        self.marionette.start_session()
\ No newline at end of file
+        self.marionette.start_session()
--- a/testing/marionette/client/marionette/tests/unit/test_clearing.py
+++ b/testing/marionette/client/marionette/tests/unit/test_clearing.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import InvalidElementStateException
 
 class TestClear(MarionetteTestCase):
     def testWriteableTextInputShouldClear(self):
         test_html = self.marionette.absolute_url("test_clearing.html")
         self.marionette.navigate(test_html)
         element = self.marionette.find_element("id", "writableTextInput")
         element.clear()
--- a/testing/marionette/client/marionette/tests/unit/test_click.py
+++ b/testing/marionette/client/marionette/tests/unit/test_click.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException, ElementNotVisibleException
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.marionette import Actions
 from marionette_driver.keys import Keys
 from marionette_driver.wait import Wait
 
 
 class TestClick(MarionetteTestCase):
     def test_click(self):
         test_html = self.marionette.absolute_url("test.html")
--- a/testing/marionette/client/marionette/tests/unit/test_click_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_click_chrome.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.by import By
 
 
 class TestClickChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
--- a/testing/marionette/client/marionette/tests/unit/test_click_scrolling.py
+++ b/testing/marionette/client/marionette/tests/unit/test_click_scrolling.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.by import By
 from marionette_driver.errors import MoveTargetOutOfBoundsException
-from marionette_test import MarionetteTestCase, skip
+from marionette import MarionetteTestCase, skip
 
 
 class TestClickScrolling(MarionetteTestCase):
 
     def test_clicking_on_anchor_scrolls_page(self):
         scrollScript = """
             var pageY;
             if (typeof(window.pageYOffset) == 'number') {
--- a/testing/marionette/client/marionette/tests/unit/test_cookies.py
+++ b/testing/marionette/client/marionette/tests/unit/test_cookies.py
@@ -1,12 +1,12 @@
 import calendar
 import time
 import random
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class CookieTest(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
         test_url = self.marionette.absolute_url('test.html')
         self.marionette.navigate(test_url)
--- a/testing/marionette/client/marionette/tests/unit/test_data_driven.py
+++ b/testing/marionette/client/marionette/tests/unit/test_data_driven.py
@@ -1,10 +1,18 @@
-from marionette_test import parameterized, with_parameters, MetaParameterized, \
-                            MarionetteTestCase
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from marionette.marionette_test import (
+    parameterized,
+    with_parameters,
+    MetaParameterized,
+    MarionetteTestCase
+)
 
 class Parameterizable(object):
     __metaclass__ = MetaParameterized
 
 class TestDataDriven(MarionetteTestCase):
     def test_parameterized(self):
         class Test(Parameterizable):
             def __init__(self):
--- a/testing/marionette/client/marionette/tests/unit/test_date_time_value.py
+++ b/testing/marionette/client/marionette/tests/unit/test_date_time_value.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from datetime import datetime
 from marionette_driver.date_time_value import DateTimeValue
 
 class TestDateTime(MarionetteTestCase):
 
     def test_set_date(self):
         test_html = self.marionette.absolute_url("datetimePage.html")
         self.marionette.navigate(test_html)
--- a/testing/marionette/client/marionette/tests/unit/test_elementState.py
+++ b/testing/marionette/client/marionette/tests/unit/test_elementState.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestState(MarionetteTestCase):
     def test_isEnabled(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
         l = self.marionette.find_element("name", "myCheckBox")
         self.assertTrue(l.is_enabled())
--- a/testing/marionette/client/marionette/tests/unit/test_elementState_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_elementState_chrome.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestStateChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
--- a/testing/marionette/client/marionette/tests/unit/test_element_touch.py
+++ b/testing/marionette/client/marionette/tests/unit/test_element_touch.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import MarionetteException
 
 class testElementTouch(MarionetteTestCase):
     def test_touch(self):
       testAction = self.marionette.absolute_url("testAction.html")
       self.marionette.navigate(testAction)
       button = self.marionette.find_element("id", "button1")
       button.tap()
--- a/testing/marionette/client/marionette/tests/unit/test_elementsize.py
+++ b/testing/marionette/client/marionette/tests/unit/test_elementsize.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestElementSize(MarionetteTestCase):
     def testShouldReturnTheSizeOfALink(self):
         test_html = self.marionette.absolute_url("testSize.html")
         self.marionette.navigate(test_html)
         shrinko = self.marionette.find_element('id', 'linkId')
         size = shrinko.rect
         self.assertTrue(size['width'] > 0)
--- a/testing/marionette/client/marionette/tests/unit/test_emulator.py
+++ b/testing/marionette/client/marionette/tests/unit/test_emulator.py
@@ -1,15 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
-from marionette_driver.errors import (JavascriptException,
-                                      MarionetteException)
+from marionette import MarionetteTestCase
+from marionette_driver.errors import MarionetteException
 
 
 class TestEmulatorContent(MarionetteTestCase):
 
     def test_emulator_cmd(self):
         self.marionette.set_script_timeout(10000)
         expected = ["<build>",
                     "OK"]
--- a/testing/marionette/client/marionette/tests/unit/test_errors.py
+++ b/testing/marionette/client/marionette/tests/unit/test_errors.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import sys
 
-import marionette_test
+from marionette import marionette_test
 from marionette_driver import errors
 from marionette_driver.errors import ErrorCodes
 
 def fake_cause():
     try:
         raise ValueError("bar")
     except ValueError as e:
         return sys.exc_info()
--- a/testing/marionette/client/marionette/tests/unit/test_execute_async_script.py
+++ b/testing/marionette/client/marionette/tests/unit/test_execute_async_script.py
@@ -1,17 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import ( JavascriptException,
                                        MarionetteException,
                                        ScriptTimeoutException )
-import time
 
 
 class TestExecuteAsyncContent(MarionetteTestCase):
     def setUp(self):
         super(TestExecuteAsyncContent, self).setUp()
         self.marionette.set_script_timeout(1000)
 
     def test_execute_async_simple(self):
--- a/testing/marionette/client/marionette/tests/unit/test_execute_isolate.py
+++ b/testing/marionette/client/marionette/tests/unit/test_execute_isolate.py
@@ -1,15 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, skip_if_b2g
-from marionette_driver.errors import (JavascriptException,
-                                      MarionetteException,
+from marionette import MarionetteTestCase
+from marionette_driver.errors import (MarionetteException,
                                       ScriptTimeoutException)
 
 class TestExecuteIsolationContent(MarionetteTestCase):
     def setUp(self):
         super(TestExecuteIsolationContent, self).setUp()
         self.content = True
 
     def test_execute_async_isolate(self):
--- a/testing/marionette/client/marionette/tests/unit/test_execute_script.py
+++ b/testing/marionette/client/marionette/tests/unit/test_execute_script.py
@@ -1,17 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import urllib
 
 from marionette_driver.by import By
-from marionette_driver.errors import JavascriptException, MarionetteException
-from marionette_test import MarionetteTestCase
+from marionette_driver.errors import JavascriptException
+from marionette import MarionetteTestCase
 
 def inline(doc):
     return "data:text/html;charset=utf-8,%s" % urllib.quote(doc)
 
 elements = inline("<p>foo</p> <p>bar</p>")
 
 class TestExecuteContent(MarionetteTestCase):
     def test_stack_trace(self):
--- a/testing/marionette/client/marionette/tests/unit/test_expected.py
+++ b/testing/marionette/client/marionette/tests/unit/test_expected.py
@@ -2,17 +2,17 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import urllib
 
 from marionette_driver import expected
 from marionette_driver.by import By
 
-import marionette_test
+from marionette import marionette_test
 
 
 def inline(doc):
     return "data:text/html;charset=utf-8,%s" % urllib.quote(doc)
 
 static_element = inline("""<p>foo</p>""")
 static_elements = static_element + static_element
 
--- a/testing/marionette/client/marionette/tests/unit/test_expectedfail.py
+++ b/testing/marionette/client/marionette/tests/unit/test_expectedfail.py
@@ -1,10 +1,10 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestFail(MarionetteTestCase):
     def test_fails(self):
         # this test is supposed to fail!
         self.assertEquals(True, False)
--- a/testing/marionette/client/marionette/tests/unit/test_findelement.py
+++ b/testing/marionette/client/marionette/tests/unit/test_findelement.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.marionette import HTMLElement
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException, InvalidSelectorException
 
 
 class TestElements(MarionetteTestCase):
     def test_id(self):
         test_html = self.marionette.absolute_url("test.html")
--- a/testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_findelement_chrome.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.marionette import HTMLElement
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException
 
 
 class TestElementsChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
--- a/testing/marionette/client/marionette/tests/unit/test_gesture.py
+++ b/testing/marionette/client/marionette/tests/unit/test_gesture.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
-from gestures import smooth_scroll, pinch
+from marionette import MarionetteTestCase
+from marionette.gestures import smooth_scroll
 
 class testGestures(MarionetteTestCase):
     check_in_viewport = """
         function elementInViewport(el) {
           let rect = el.getBoundingClientRect();
           return (rect.top >= window.pageYOffset &&
                  rect.left >= window.pageXOffset &&
                  rect.bottom <= (window.pageYOffset + window.innerHeight) &&
--- a/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
+++ b/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestGetActiveFrameOOP(MarionetteTestCase):
     def setUp(self):
         super(TestGetActiveFrameOOP, self).setUp()
         self.oop_by_default = self.marionette.execute_script("""
             try {
               return SpecialPowers.getBoolPref('dom.ipc.browser_frames.oop_by_default');
--- a/testing/marionette/client/marionette/tests/unit/test_getattr.py
+++ b/testing/marionette/client/marionette/tests/unit/test_getattr.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestGetAttribute(MarionetteTestCase):
     def test_getAttribute(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
         l = self.marionette.find_element("id", "mozLink")
         self.assertEqual("mozLink", l.get_attribute("id"))
--- a/testing/marionette/client/marionette/tests/unit/test_getattr_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_getattr_chrome.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestGetAttributeChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
--- a/testing/marionette/client/marionette/tests/unit/test_implicit_waits.py
+++ b/testing/marionette/client/marionette/tests/unit/test_implicit_waits.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import NoSuchElementException
 
 class TestImplicitWaits(MarionetteTestCase):
     def testShouldImplicitlyWaitForASingleElement(self):
         test_html = self.marionette.absolute_url("test_dynamic.html")
         self.marionette.navigate(test_html)
         add = self.marionette.find_element("id", "adder")
         self.marionette.set_search_timeout("30000")
--- a/testing/marionette/client/marionette/tests/unit/test_import_script.py
+++ b/testing/marionette/client/marionette/tests/unit/test_import_script.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import JavascriptException
 
 class TestImportScript(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
 
     def clear_other_context(self):
         self.marionette.set_context("chrome")
--- a/testing/marionette/client/marionette/tests/unit/test_import_script_reuse_window.py
+++ b/testing/marionette/client/marionette/tests/unit/test_import_script_reuse_window.py
@@ -1,15 +1,15 @@
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestImportScriptContent(MarionetteTestCase):
 
     def test_importing_script_then_reusing_it(self):
         test_html = self.marionette.absolute_url("test_windows.html")
         self.marionette.navigate(test_html)
         js = os.path.abspath(os.path.join(__file__, os.path.pardir, "importscript.js"))
         self.current_window = self.marionette.current_window_handle
--- a/testing/marionette/client/marionette/tests/unit/test_key_actions.py
+++ b/testing/marionette/client/marionette/tests/unit/test_key_actions.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import (MarionetteTestCase,
-                             skip_if_b2g,
-                             skip_if_e10s)
+from marionette.marionette_test import (MarionetteTestCase,
+                                        skip_if_b2g,
+                                        skip_if_e10s)
 from marionette_driver.keys import Keys
 from marionette_driver.marionette import Actions
 
 class TestKeyActions(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
         if self.marionette.session_capabilities['platformName'] == 'DARWIN':
--- a/testing/marionette/client/marionette/tests/unit/test_log.py
+++ b/testing/marionette/client/marionette/tests/unit/test_log.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-import os
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
+
 
 class TestLog(MarionetteTestCase):
     def test_log_basic(self):
         # clear any previous data
         self.marionette.get_logs()
 
         self.marionette.log("I am info")
         self.assertTrue("I am info" in self.marionette.get_logs()[0])
--- a/testing/marionette/client/marionette/tests/unit/test_marionette.py
+++ b/testing/marionette/client/marionette/tests/unit/test_marionette.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver import errors
-import marionette_test
+from marionette import marionette_test
 
 
 class TestHandleError(marionette_test.MarionetteTestCase):
     def test_malformed_packet(self):
         for t in [{}, {"error": None}]:
             with self.assertRaisesRegexp(errors.MarionetteException, "Malformed packet"):
                 self.marionette._handle_error(t)
 
--- a/testing/marionette/client/marionette/tests/unit/test_modal_dialogs.py
+++ b/testing/marionette/client/marionette/tests/unit/test_modal_dialogs.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, skip_if_e10s
+from marionette.marionette_test import MarionetteTestCase, skip_if_e10s
 from marionette_driver.errors import NoAlertPresentException, ElementNotVisibleException
 from marionette_driver.marionette import Alert
 from marionette_driver.wait import Wait
 
 class TestTabModals(MarionetteTestCase):
 
     def setUp(self):
         MarionetteTestCase.setUp(self)
--- a/testing/marionette/client/marionette/tests/unit/test_multi_finger.py
+++ b/testing/marionette/client/marionette/tests/unit/test_multi_finger.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
-from marionette import MultiActions, Actions
+from marionette import MarionetteTestCase
+from marionette.marionette import MultiActions, Actions
 
 class testMultiFinger(MarionetteTestCase):
     def test_move_element(self):
       testAction = self.marionette.absolute_url("testAction.html")
       self.marionette.navigate(testAction)
       start = self.marionette.find_element("id", "button1")
       drop = self.marionette.find_element("id", "button2")
       ele = self.marionette.find_element("id", "button3")
--- a/testing/marionette/client/marionette/tests/unit/test_navigation.py
+++ b/testing/marionette/client/marionette/tests/unit/test_navigation.py
@@ -1,13 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, skip_if_b2g, skip_if_e10s
+from marionette.marionette_test import (
+    MarionetteTestCase,
+    skip_if_b2g,
+    skip_if_e10s
+)
 from marionette_driver.errors import MarionetteException, TimeoutException
 
 class TestNavigate(MarionetteTestCase):
     def test_navigate(self):
         self.assertTrue(self.marionette.execute_script("window.location.href = 'about:blank'; return true;"))
         self.assertEqual("about:blank", self.marionette.execute_script("return window.location.href;"))
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
--- a/testing/marionette/client/marionette/tests/unit/test_pagesource.py
+++ b/testing/marionette/client/marionette/tests/unit/test_pagesource.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, skip_if_b2g
+from marionette.marionette_test import MarionetteTestCase, skip_if_b2g
 
 class TestPageSource(MarionetteTestCase):
     def testShouldReturnTheSourceOfAPage(self):
         test_html = self.marionette.absolute_url("testPageSource.html")
         self.marionette.navigate(test_html)
         source = self.marionette.page_source
         self.assertTrue("<html" in source)
         self.assertTrue("PageSource" in source)
--- a/testing/marionette/client/marionette/tests/unit/test_position.py
+++ b/testing/marionette/client/marionette/tests/unit/test_position.py
@@ -1,9 +1,9 @@
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestPosition(MarionetteTestCase):
 
     def test_should_get_element_position_back(self):
         test_url = self.marionette.absolute_url('rectangles.html')
         self.marionette.navigate(test_url)
 
--- a/testing/marionette/client/marionette/tests/unit/test_profile_management.py
+++ b/testing/marionette/client/marionette/tests/unit/test_profile_management.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os
 from marionette_driver.errors import JavascriptException
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestLog(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.enforce_gecko_prefs({"marionette.test.bool": True, "marionette.test.string": "testing", "marionette.test.int": 3})
 
     def test_preferences_are_set(self):
         bool_value = self.marionette.execute_script("return SpecialPowers.getBoolPref('marionette.test.bool');")
--- a/testing/marionette/client/marionette/tests/unit/test_rendered_element.py
+++ b/testing/marionette/client/marionette/tests/unit/test_rendered_element.py
@@ -8,17 +8,17 @@
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
 #Unless required by applicable law or agreed to in writing, software
 #distributed under the License is distributed on an "AS IS" BASIS,
 #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 #See the License for the specific language governing permissions and
 #limitations under the License.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class RenderedElementTests(MarionetteTestCase):
 
     def testWeCanGetComputedStyleValueOnElement(self):
         test_url = self.marionette.absolute_url('javascriptPage.html')
         self.marionette.navigate(test_url)
         element = self.marionette.find_element('id', "green-parent")
--- a/testing/marionette/client/marionette/tests/unit/test_report.py
+++ b/testing/marionette/client/marionette/tests/unit/test_report.py
@@ -1,14 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-import unittest
-from marionette_test import MarionetteTestCase, expectedFailure, skip
+from marionette import MarionetteTestCase, expectedFailure, skip
 
 
 class TestReport(MarionetteTestCase):
 
     def test_pass(self):
         assert True
 
     def test_fail(self):
--- a/testing/marionette/client/marionette/tests/unit/test_run_js_test.py
+++ b/testing/marionette/client/marionette/tests/unit/test_run_js_test.py
@@ -1,10 +1,9 @@
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
-from marionette_test import MarionetteTestCase
-import unittest
+from marionette import MarionetteTestCase
 
 class TestRunJSTest(MarionetteTestCase):
     def test_basic(self):
         self.run_js_test('test_simpletest_pass.js')
         self.run_js_test('test_simpletest_fail.js')
--- a/testing/marionette/client/marionette/tests/unit/test_screen_orientation.py
+++ b/testing/marionette/client/marionette/tests/unit/test_screen_orientation.py
@@ -1,16 +1,16 @@
 # -*- fill-column: 100; comment-column: 100; -*-
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.errors import MarionetteException
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from mozrunner.devices.emulator_screen import EmulatorScreen
 
 default_orientation = "portrait-primary"
 unknown_orientation = "Unknown screen orientation: %s"
 
 class TestScreenOrientation(MarionetteTestCase):
     def tearDown(self):
         self.marionette.set_orientation(default_orientation)
--- a/testing/marionette/client/marionette/tests/unit/test_screenshot.py
+++ b/testing/marionette/client/marionette/tests/unit/test_screenshot.py
@@ -1,12 +1,12 @@
 import base64
 import imghdr
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 RED_ELEMENT_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAVUlEQVRoge3PsQ0AIAzAsI78fzBwBhHykD2ePev80LweAAGJB1ILpBZILZBaILVAaoHUAqkFUgukFkgtkFogtUBqgdQCqQVSC6QWSC2QWiC1QGp9A7ma+7nyXgOpzQAAAABJRU5ErkJggg=='
 GREEN_ELEMENT_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAV0lEQVRoge3PQRGAQAwAsWINvXgsNnI3+4iAzM7sDWZn9vneoxXRFNEU0RTRFNEU0RTRFNEU0RTRFNEU0RTRFNEU0RTRFNEU0RTRFNEU0RTRFNHcF7nBD/Ha5Ye4BbsYAAAAAElFTkSuQmCC'
 
 class ScreenshotTests(MarionetteTestCase):
 
     def testWeCanTakeAScreenShotOfEntireViewport(self):
--- a/testing/marionette/client/marionette/tests/unit/test_selected.py
+++ b/testing/marionette/client/marionette/tests/unit/test_selected.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestSelected(MarionetteTestCase):
     def test_selected(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
         box = self.marionette.find_element("name", "myCheckBox")
         self.assertFalse(box.is_selected())
--- a/testing/marionette/client/marionette/tests/unit/test_selected_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_selected_chrome.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestSelectedChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', '_blank', 'chrome,centerscreen');")
--- a/testing/marionette/client/marionette/tests/unit/test_session.py
+++ b/testing/marionette/client/marionette/tests/unit/test_session.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-import marionette_test
+from marionette import MarionetteTestCase
 
-class TestSession(marionette_test.MarionetteTestCase):
+class TestSession(MarionetteTestCase):
     def setUp(self):
         super(TestSession, self).setUp()
         self.marionette.delete_session()
 
     def test_new_session_returns_capabilities(self):
         # Sends newSession
         caps = self.marionette.start_session()
 
@@ -36,9 +36,9 @@ class TestSession(marionette_test.Marion
         self.assertTrue(self.marionette.session_id is not None)
         self.assertTrue(isinstance(self.marionette.session_id, unicode))
 
     def test_we_can_set_the_session_id(self):
         # Sends newSession
         caps = self.marionette.start_session(session_id="ILoveCheese")
 
         self.assertEqual(self.marionette.session_id, "ILoveCheese")
-        self.assertTrue(isinstance(self.marionette.session_id, unicode))
\ No newline at end of file
+        self.assertTrue(isinstance(self.marionette.session_id, unicode))
--- a/testing/marionette/client/marionette/tests/unit/test_set_window_size.py
+++ b/testing/marionette/client/marionette/tests/unit/test_set_window_size.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver.errors import MarionetteException
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestSetWindowSize(MarionetteTestCase):
     def setUp(self):
         super(MarionetteTestCase, self).setUp()
         self.start_size = self.marionette.window_size
         self.max_width = self.marionette.execute_script("return window.screen.availWidth;")
         self.max_height = self.marionette.execute_script("return window.screen.availHeight;")
 
--- a/testing/marionette/client/marionette/tests/unit/test_simpletest_sanity.py
+++ b/testing/marionette/client/marionette/tests/unit/test_simpletest_sanity.py
@@ -1,16 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
-from marionette_driver.errors import (JavascriptException,
-                                      MarionetteException,
-                                      ScriptTimeoutException)
+from marionette import MarionetteTestCase
 
 class SimpletestSanityTest(MarionetteTestCase):
 
     callFinish = "return finish();"
 
     def test_is(self):
         def runtests():
             sentFail1 = "is(true, false, 'isTest1', TEST_UNEXPECTED_FAIL, TEST_PASS);" + self.callFinish
--- a/testing/marionette/client/marionette/tests/unit/test_single_finger.py
+++ b/testing/marionette/client/marionette/tests/unit/test_single_finger.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.marionette import Actions
 from marionette_driver.errors import MarionetteException
 #add this directory to the path
 import os
 import sys
 sys.path.append(os.path.dirname(__file__))
 from single_finger_functions import (
         chain, chain_flick, context_menu, double_tap,
--- a/testing/marionette/client/marionette/tests/unit/test_single_finger_desktop.py
+++ b/testing/marionette/client/marionette/tests/unit/test_single_finger_desktop.py
@@ -1,10 +1,9 @@
-from marionette_test import MarionetteTestCase
-from marionette_driver.marionette import Actions
+from marionette import MarionetteTestCase
 from marionette_driver.errors import MarionetteException
 #add this directory to the path
 import os
 import sys
 sys.path.append(os.path.dirname(__file__))
 from single_finger_functions import (
         chain, chain_flick, context_menu, double_tap,
         long_press_action, long_press_on_xy_action,
--- a/testing/marionette/client/marionette/tests/unit/test_skip_setup.py
+++ b/testing/marionette/client/marionette/tests/unit/test_skip_setup.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, SkipTest
+from marionette import MarionetteTestCase, SkipTest
 
 class TestSetUpSkipped(MarionetteTestCase):
 
     testVar = {'test':'SkipTest'}
 
     def setUp(self):
         try:
             self.testVar['email']
--- a/testing/marionette/client/marionette/tests/unit/test_specialpowers.py
+++ b/testing/marionette/client/marionette/tests/unit/test_specialpowers.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
-from marionette_driver.errors import JavascriptException, MarionetteException
+from marionette import MarionetteTestCase
+
 
 class TestSpecialPowersContent(MarionetteTestCase):
 
     testpref = "testing.marionette.contentcharpref"
     testvalue = "blabla"
 
     def test_prefs(self):
         result = self.marionette.execute_script("""
--- a/testing/marionette/client/marionette/tests/unit/test_submit.py
+++ b/testing/marionette/client/marionette/tests/unit/test_submit.py
@@ -2,17 +2,17 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import time
 
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException
 from marionette_driver.wait import Wait
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestSubmit(MarionetteTestCase):
 
     def test_should_be_able_to_submit_forms(self):
         test_html = self.marionette.absolute_url("formPage.html")
         self.marionette.navigate(test_html)
         self.marionette.find_element(By.NAME, "login").submit()
         for x in xrange(1, 10):
--- a/testing/marionette/client/marionette/tests/unit/test_switch_frame.py
+++ b/testing/marionette/client/marionette/tests/unit/test_switch_frame.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import (JavascriptException,
                                       NoSuchFrameException)
 
 
 class TestSwitchFrame(MarionetteTestCase):
     def test_switch_simple(self):
         start_url = "test_iframe.html"
         verify_title = "Marionette IFrame Test"
--- a/testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import JavascriptException
-from marionette_driver.by import By
+
 
 class TestSwitchFrameChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
         self.marionette.switch_to_window('foo')
--- a/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
+++ b/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TestSwitchRemoteFrame(MarionetteTestCase):
     def setUp(self):
         super(TestSwitchRemoteFrame, self).setUp()
         self.oop_by_default = self.marionette.execute_script("""
             try {
               return SpecialPowers.getBoolPref('dom.ipc.browser_frames.oop_by_default');
--- a/testing/marionette/client/marionette/tests/unit/test_text.py
+++ b/testing/marionette/client/marionette/tests/unit/test_text.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.keys import Keys
 
 
 class TestText(MarionetteTestCase):
     def test_getText(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
         l = self.marionette.find_element("id", "mozLink")
--- a/testing/marionette/client/marionette/tests/unit/test_text_chrome.py
+++ b/testing/marionette/client/marionette/tests/unit/test_text_chrome.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 ''' Disabled in bug 896043 and when working on Chrome code re-enable for bug 896046
 class TestTextChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
--- a/testing/marionette/client/marionette/tests/unit/test_timeouts.py
+++ b/testing/marionette/client/marionette/tests/unit/test_timeouts.py
@@ -1,17 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-import os
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.marionette import HTMLElement
 from marionette_driver.errors import (NoSuchElementException,
-                                      JavascriptException,
                                       MarionetteException,
                                       ScriptTimeoutException)
 
 class TestTimeouts(MarionetteTestCase):
     def test_pagetimeout_notdefinetimeout_pass(self):
         test_html = self.marionette.absolute_url("test.html")
         self.marionette.navigate(test_html)
 
--- a/testing/marionette/client/marionette/tests/unit/test_typing.py
+++ b/testing/marionette/client/marionette/tests/unit/test_typing.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, skip_if_b2g
+from marionette.marionette_test import MarionetteTestCase, skip_if_b2g
 from marionette_driver.keys import Keys
 from marionette_driver.errors import ElementNotVisibleException
 
 
 class TestTyping(MarionetteTestCase):
 
     def testShouldFireKeyPressEvents(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
--- a/testing/marionette/client/marionette/tests/unit/test_visibility.py
+++ b/testing/marionette/client/marionette/tests/unit/test_visibility.py
@@ -1,9 +1,9 @@
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestVisibility(MarionetteTestCase):
 
     def testShouldAllowTheUserToTellIfAnElementIsDisplayedOrNot(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         self.assertTrue(self.marionette.find_element('id', "displayed").is_displayed())
--- a/testing/marionette/client/marionette/tests/unit/test_wait.py
+++ b/testing/marionette/client/marionette/tests/unit/test_wait.py
@@ -4,17 +4,17 @@
 
 import sys
 import time
 
 from marionette_driver import errors
 from marionette_driver import wait
 from marionette_driver.wait import Wait
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 
 class TickingClock(object):
     def __init__(self, incr=1):
         self.ticks = 0
         self.increment = incr
 
     def sleep(self, dur):
--- a/testing/marionette/client/marionette/tests/unit/test_window_handles.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_handles.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase, skip_if_e10s
+from marionette.marionette_test import MarionetteTestCase, skip_if_e10s
 from marionette_driver.keys import Keys
 
 
 class TestWindowHandles(MarionetteTestCase):
 
     @skip_if_e10s # Interactions with about: pages need e10s support (bug 1096488).
     def test_new_tab_window_handles(self):
         keys = [Keys.SHIFT]
--- a/testing/marionette/client/marionette/tests/unit/test_window_management.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_management.py
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import time
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestSwitchWindow(MarionetteTestCase):
     def open_new_window(self):
         self.marionette.set_context("chrome")
         self.marionette.set_script_timeout(5000)
         self.marionette.execute_async_script("""
 var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
                    .getService(Components.interfaces.nsIWindowWatcher);
--- a/testing/marionette/client/marionette/tests/unit/test_window_position.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_position.py
@@ -7,17 +7,17 @@
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
 #Unless required by applicable law or agreed to in writing, software
 #distributed under the License is distributed on an "AS IS" BASIS,
 #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 #See the License for the specific language governing permissions and
 #limitations under the License.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import MarionetteException
 
 class TestWindowPosition(MarionetteTestCase):
 
     def test_that_we_return_the_window_position(self):
         position = self.marionette.get_window_position()
         self.assertTrue(isinstance(position['x'], int))
         self.assertTrue(isinstance(position['y'], int))
--- a/testing/marionette/client/marionette/tests/unit/test_window_switching.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_switching.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 from marionette_driver.by import By
 from marionette_driver.errors import NoSuchElementException
 from marionette_driver.wait import Wait
 
 
 class TestWindowSwitching(MarionetteTestCase):
     def testJSWindowCreationAndSwitching(self):
--- a/testing/marionette/client/marionette/tests/unit/test_window_title.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_title.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 #TODO use @skip_if_b2g when Bug 875921 is fixed
 class TestTitleChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
--- a/testing/marionette/client/marionette/tests/unit/test_window_type.py
+++ b/testing/marionette/client/marionette/tests/unit/test_window_type.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 
 class TestWindowTypeChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
         self.marionette.switch_to_window('foo')
--- a/testing/marionette/client/marionette/tests/unit/test_with_using_context.py
+++ b/testing/marionette/client/marionette/tests/unit/test_with_using_context.py
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette_test import MarionetteTestCase
+from marionette import MarionetteTestCase
 from marionette_driver.errors import MarionetteException
 
 
 class TestSetContext(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
 
         # shortcuts to improve readability of these tests
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -33,30 +33,17 @@ VARIANT=eng ./build.sh
 
 # A parser that will accept structured logging commandline arguments.
 _parser = argparse.ArgumentParser()
 commandline.add_logging_group(_parser)
 
 def run_marionette(tests, b2g_path=None, emulator=None, testtype=None,
     address=None, binary=None, topsrcdir=None, **kwargs):
 
-    # Import the harness directly and under a different name here to avoid
-    # "marionette" being importable from two locations when "testing/marionette/client"
-    # is on sys.path.
-    # See bug 1050511 and bug 1114474. This needs to be removed with the
-    # resolution of bug 1109183.
-    clientdir = os.path.join(topsrcdir, 'testing/marionette/client')
-    if clientdir in sys.path:
-        sys.path.remove(clientdir)
-    path = os.path.join(topsrcdir, 'testing/marionette/client/marionette/runtests.py')
-    with open(path, 'r') as fh:
-        imp.load_module('marionetteharness', fh, path,
-                        ('.py', 'r', imp.PY_SOURCE))
-
-    from marionetteharness import (
+    from marionette.runtests import (
         MarionetteTestRunner,
         BaseMarionetteOptions,
         startTestRunner
     )
 
     parser = BaseMarionetteOptions()
     commandline.add_logging_group(parser)
     options, args = parser.parse_args()