Bug 994483 Add Loop unit tests to tbpl. r=dburns
authorMark Banner <mbanner@mozilla.com>
Thu, 05 Jun 2014 15:45:16 +0100
changeset 187735 87e1572c63a39de626307d7bb392435d57a6cb11
parent 187734 fa0b0d413edbc44b117e888d0f7d74237bdbd65e
child 187736 34856bd5bbcbd7525ee1c377d4cef57913133c64
push id26931
push usermbanner@mozilla.com
push dateMon, 09 Jun 2014 22:07:01 +0000
treeherdermozilla-central@fc70d6d9a9b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdburns
bugs994483
milestone32.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 994483 Add Loop unit tests to tbpl. r=dburns
browser/components/loop/manifest.ini
browser/components/loop/test/desktop-local/test_desktop_all.py
browser/components/loop/test/manifest.ini
browser/components/loop/test/shared/frontend_tester.py
browser/components/loop/test/shared/test_shared_all.py
browser/components/loop/test/standalone/test_standalone_all.py
testing/marionette/client/marionette/tests/unit-tests.ini
new file mode 100644
--- /dev/null
+++ b/browser/components/loop/manifest.ini
@@ -0,0 +1,22 @@
+; This file is in the main loop directory, and not the test directory as we need
+; to include the content/ files in what is packaged as test support files.
+;
+; Although the content/ files would normally be tested from within the browser,
+; the issue is that they are seen to be loaded in a "chrome" privilaged context,
+; and hence are not allowed to be loaded via the content files that run the
+; tests.
+;
+; Hence we duplicate the same files as support files, so that they can be loaded
+; in a content context.
+;
+; This might get messy if we start having pre-processed files, but for now it
+; seems to work.
+
+[DEFAULT]
+b2g = false
+browser = true
+qemu = false
+
+[test/shared/test_shared_all.py]
+[test/desktop-local/test_desktop_all.py]
+[test/standalone/test_standalone_all.py]
--- a/browser/components/loop/test/desktop-local/test_desktop_all.py
+++ b/browser/components/loop/test/desktop-local/test_desktop_all.py
@@ -5,12 +5,12 @@ sys.path.append(os.path.join(os.path.dir
 
 from frontend_tester import BaseTestFrontendUnits
 
 
 class TestDesktopUnits(BaseTestFrontendUnits):
 
     def setUp(self):
         super(TestDesktopUnits, self).setUp()
-        self.set_server_prefix("browser/components/loop/test/desktop-local/")
+        self.set_server_prefix("build/tests/marionette/tests/browser/components/loop/test/desktop-local/")
 
     def test_units(self):
         self.check_page("index.html")
deleted file mode 100644
--- a/browser/components/loop/test/manifest.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-b2g = false
-browser = true
-qemu = false
-
-[shared/test_shared_all.py]
-[desktop-local/test_desktop_all.py]
-[standalone/test_standalone_all.py]
--- a/browser/components/loop/test/shared/frontend_tester.py
+++ b/browser/components/loop/test/shared/frontend_tester.py
@@ -51,16 +51,21 @@ class BaseTestFrontendUnits(MarionetteTe
         # test class.  Even though this is class-static, each subclass gets
         # its own instance of this stuff.
         cls.server_thread = None
         cls.server = None
 
     def setUp(self):
         super(BaseTestFrontendUnits, self).setUp()
 
+        # This extends the timeout for find_element to 10 seconds.
+        # We need this as the tests take an amount of time to run after loading,
+        # which we have to wait for.
+        self.marionette.set_search_timeout(10000)
+
     def set_server_prefix(self, srcdir_path=None):
         self.server_prefix = urlparse.urljoin("http://localhost:" + str(PORT),
                                               srcdir_path)
 
     def check_page(self, page):
 
         self.marionette.navigate(urlparse.urljoin(self.server_prefix, page))
         self.marionette.find_element("id", 'complete')
--- a/browser/components/loop/test/shared/test_shared_all.py
+++ b/browser/components/loop/test/shared/test_shared_all.py
@@ -5,12 +5,12 @@ sys.path.append(os.path.dirname(__file__
 
 from frontend_tester import BaseTestFrontendUnits
 
 
 class TestSharedUnits(BaseTestFrontendUnits):
 
     def setUp(self):
         super(TestSharedUnits, self).setUp()
-        self.set_server_prefix("browser/components/loop/test/shared/")
+        self.set_server_prefix("build/tests/marionette/tests/browser/components/loop/test/shared/")
 
     def test_units(self):
         self.check_page("index.html")
--- a/browser/components/loop/test/standalone/test_standalone_all.py
+++ b/browser/components/loop/test/standalone/test_standalone_all.py
@@ -5,12 +5,12 @@ sys.path.append(os.path.join(os.path.dir
 
 from frontend_tester import BaseTestFrontendUnits
 
 
 class TestDesktopUnits(BaseTestFrontendUnits):
 
     def setUp(self):
         super(TestDesktopUnits, self).setUp()
-        self.set_server_prefix("browser/components/loop/test/standalone/")
+        self.set_server_prefix("build/tests/marionette/tests/browser/components/loop/test/standalone/")
 
     def test_units(self):
         self.check_page("index.html")
--- a/testing/marionette/client/marionette/tests/unit-tests.ini
+++ b/testing/marionette/client/marionette/tests/unit-tests.ini
@@ -21,8 +21,11 @@ skip = false
 [include:../../../../../dom/battery/test/marionette/manifest.ini]
 [include:../../../../../dom/mobilemessage/tests/marionette/manifest.ini]
 [include:../../../../../dom/mobileconnection/tests/marionette/manifest.ini]
 [include:../../../../../dom/system/gonk/tests/marionette/manifest.ini]
 [include:../../../../../dom/icc/tests/marionette/manifest.ini]
 [include:../../../../../dom/system/tests/marionette/manifest.ini]
 [include:../../../../../dom/nfc/tests/marionette/manifest.ini]
 [include:../../../../../dom/events/test/marionette/manifest.ini]
+
+; loop tests
+[include:../../../../../browser/components/loop/manifest.ini]