Backed out changeset 5a7b47cb1498 (bug 1058158) for Marionette-webapi permafails.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 16 Sep 2014 14:53:53 -0400
changeset 224882 549846c956b8ccc08b69d534ea25103ecba1190b
parent 224881 5b4236189b9b15876b12ab54d52d4f548683ca2e
child 224883 fe591acbe83b8a4464edd27b532cbb52a8bc3f0c
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1058158
milestone34.0a2
backs out5a7b47cb1498339045989692a41da8ad57676e74
Backed out changeset 5a7b47cb1498 (bug 1058158) for Marionette-webapi permafails.
testing/marionette/client/marionette/marionette_test.py
testing/marionette/client/marionette/runner/base.py
testing/marionette/client/marionette/tests/unit-tests.ini
testing/marionette/client/marionette/tests/unit/oop/manifest-oop-both.ini
testing/marionette/client/marionette/tests/unit/oop/manifest-oop-false.ini
testing/marionette/client/marionette/tests/unit/oop/manifest-oop-true.ini
testing/marionette/client/marionette/tests/unit/oop/manifest-oop-unspecified.ini
testing/marionette/client/marionette/tests/unit/oop/manifest.ini
testing/marionette/client/marionette/tests/unit/oop/test_success_both.js
testing/marionette/client/marionette/tests/unit/oop/test_success_both2.js
testing/marionette/client/marionette/tests/unit/oop/test_success_in_non_oop.js
testing/marionette/client/marionette/tests/unit/oop/test_success_in_non_oop2.js
testing/marionette/client/marionette/tests/unit/oop/test_success_in_oop.js
testing/marionette/client/marionette/tests/unit/oop/test_success_in_oop2.js
testing/marionette/client/marionette/tests/unit/test_navigation.py
testing/marionette/client/marionette/tests/unit/test_specialpowers.py
testing/marionette/client/marionette/tests/unit/unit-tests.ini
--- a/testing/marionette/client/marionette/marionette_test.py
+++ b/testing/marionette/client/marionette/marionette_test.py
@@ -19,19 +19,16 @@ from errors import (
         JavascriptException, NoSuchElementException, XPathLookupException, NoSuchWindowException,
         StaleElementException, ScriptTimeoutException, ElementNotVisibleException,
         NoSuchFrameException, InvalidElementStateException, NoAlertPresentException,
         InvalidCookieDomainException, UnableToSetCookieException, InvalidSelectorException,
         MoveTargetOutOfBoundsException, FrameSendNotInitializedError, FrameSendFailureError
         )
 from marionette import Marionette
 from mozlog.structured.structuredlog import get_default_logger
-from wait import Wait
-from expected import element_present, element_not_present
-
 
 class SkipTest(Exception):
     """
     Raise this exception in a test to skip it.
 
     Usually you can use TestResult.skip() or one of the skipping decorators
     instead of raising this directly.
     """
@@ -77,20 +74,20 @@ def expectedFailure(func):
             func(*args, **kwargs)
         except Exception:
             raise _ExpectedFailure(sys.exc_info())
         raise _UnexpectedSuccess
     return wrapper
 
 def skip_if_b2g(target):
     def wrapper(self, *args, **kwargs):
-        if not self.marionette.session_capabilities['device'] == 'qemu':
+        if not hasattr(self.marionette, 'b2g') or not self.marionette.b2g:
             return target(self, *args, **kwargs)
         else:
-            raise SkipTest('skipping due to b2g')
+            sys.stderr.write('skipping ... ')
     return wrapper
 
 class CommonTestCase(unittest.TestCase):
 
     match_re = None
     failureException = AssertionError
 
     def __init__(self, methodName, **kwargs):
@@ -284,22 +281,16 @@ permissions.forEach(function (perm) {
         if self.marionette.session is None:
             self.marionette.start_session()
         if self.marionette.timeout is not None:
             self.marionette.timeouts(self.marionette.TIMEOUT_SEARCH, self.marionette.timeout)
             self.marionette.timeouts(self.marionette.TIMEOUT_SCRIPT, self.marionette.timeout)
             self.marionette.timeouts(self.marionette.TIMEOUT_PAGE, self.marionette.timeout)
         else:
             self.marionette.timeouts(self.marionette.TIMEOUT_PAGE, 30000)
-        if hasattr(self, 'test_container') and self.test_container:
-            self.switch_into_test_container()
-        else:
-            if self.marionette.session_capabilities.has_key('b2g') \
-            and self.marionette.session_capabilities['b2g'] == True:
-                self.close_test_container()
 
     def tearDown(self):
         pass
 
     def cleanTest(self):
         self._deleteSession()
 
     def _deleteSession(self):
@@ -317,119 +308,28 @@ permissions.forEach(function (perm) {
                     # Gecko has crashed?
                     self.marionette.session = None
                     try:
                         self.marionette.client.close()
                     except socket.error:
                         pass
         self.marionette = None
 
-    def switch_into_test_container(self):
-        self.marionette.set_context("content")
-        frame = None
-        try:
-            frame = self.marionette.find_element(
-                'css selector',
-                'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
-            )
-        except NoSuchElementException:
-            result = self.marionette.execute_async_script("""
-if((navigator.mozSettings == undefined) || (navigator.mozSettings == null) || (navigator.mozApps == undefined) || (navigator.mozApps == null)) {
-    marionetteScriptFinished(false);
-    return;
-}
-let setReq = navigator.mozSettings.createLock().set({'lockscreen.enabled': false});
-setReq.onsuccess = function() {
-    let appsReq = navigator.mozApps.mgmt.getAll();
-    appsReq.onsuccess = function() {
-        let apps = appsReq.result;
-        for (let i = 0; i < apps.length; i++) {
-            let app = apps[i];
-            if (app.manifest.name === 'Test Container') {
-                app.launch();
-                window.addEventListener('apploadtime', function apploadtime(){
-                    window.removeEventListener('apploadtime', apploadtime);
-                    marionetteScriptFinished(true);
-                });
-                return;
-            }
-        }
-        marionetteScriptFinished(false);
-    }
-    appsReq.onerror = function() {
-        marionetteScriptFinished(false);
-    }
-}
-setReq.onerror = function() {
-    marionetteScriptFinished(false);
-}""", script_timeout=60000)
-
-            self.assertTrue(result)
-            frame = Wait(self.marionette, timeout=10, interval=0.2).until(element_present(
-                'css selector',
-                'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
-            ))
-
-        self.marionette.switch_to_frame(frame)
-
-    def close_test_container(self):
-        self.marionette.set_context("content")
-        self.marionette.switch_to_frame()
-        result = self.marionette.execute_async_script("""
-if((navigator.mozSettings == undefined) || (navigator.mozSettings == null) || (navigator.mozApps == undefined) || (navigator.mozApps == null)) {
-    marionetteScriptFinished(false);
-    return;
-}
-let setReq = navigator.mozSettings.createLock().set({'lockscreen.enabled': false});
-setReq.onsuccess = function() {
-    let appsReq = navigator.mozApps.mgmt.getAll();
-    appsReq.onsuccess = function() {
-        let apps = appsReq.result;
-        for (let i = 0; i < apps.length; i++) {
-            let app = apps[i];
-            if (app.manifest.name === 'Test Container') {
-                let manager = window.wrappedJSObject.AppWindowManager || window.wrappedJSObject.WindowManager;
-                if (!manager) {
-                    marionetteScriptFinished(false);
-                    return;
-                }
-                manager.kill(app.origin);
-                marionetteScriptFinished(true);
-                return;
-            }
-        }
-        marionetteScriptFinished(false);
-    }
-    appsReq.onerror = function() {
-        marionetteScriptFinished(false);
-    }
-}
-setReq.onerror = function() {
-    marionetteScriptFinished(false);
-}""", script_timeout=60000)
-
-        frame = Wait(self.marionette, timeout=10, interval=0.2).until(element_not_present(
-            'css selector',
-            'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
-        ))
-
-
 class MarionetteTestCase(CommonTestCase):
 
     match_re = re.compile(r"test_(.*)\.py$")
 
     def __init__(self, marionette_weakref, methodName='runTest',
                  filepath='', **kwargs):
         self._marionette_weakref = marionette_weakref
         self.marionette = None
         self.extra_emulator_index = -1
         self.methodName = methodName
         self.filepath = filepath
         self.testvars = kwargs.pop('testvars', None)
-        self.test_container = kwargs.pop('test_container', False)
         CommonTestCase.__init__(self, methodName, **kwargs)
 
     @classmethod
     def add_tests_to_suite(cls, mod_name, filepath, suite, testloader, marionette, testvars, **kwargs):
         test_mod = imp.load_source(mod_name, filepath)
 
         for name in dir(test_mod):
             obj = getattr(test_mod, name)
@@ -490,17 +390,17 @@ class MarionetteJSTestCase(CommonTestCas
     inactivity_timeout_re = re.compile(r"MARIONETTE_INACTIVITY_TIMEOUT(\s*)=(\s*)(\d+);")
     match_re = re.compile(r"test_(.*)\.js$")
 
     def __init__(self, marionette_weakref, methodName='runTest', jsFile=None, **kwargs):
         assert(jsFile)
         self.jsFile = jsFile
         self._marionette_weakref = marionette_weakref
         self.marionette = None
-        self.test_container = kwargs.pop('test_container', False)
+        self.oop = kwargs.pop('oop')
         CommonTestCase.__init__(self, methodName)
 
     @classmethod
     def add_tests_to_suite(cls, mod_name, filepath, suite, testloader, marionette, testvars, **kwargs):
         suite.addTest(cls(weakref.ref(marionette), jsFile=filepath, **kwargs))
 
     def runTest(self):
         if self.marionette.session is None:
@@ -514,16 +414,64 @@ class MarionetteJSTestCase(CommonTestCas
 
         if os.path.basename(self.jsFile).startswith('test_'):
             head_js = self.head_js_re.search(js);
             if head_js:
                 head_js = head_js.group(3)
                 head = open(os.path.join(os.path.dirname(self.jsFile), head_js), 'r')
                 js = head.read() + js;
 
+        if self.oop:
+            print 'running oop'
+            frame = None
+            try:
+                frame = self.marionette.find_element(
+                    'css selector',
+                    'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
+                )
+            except NoSuchElementException:
+                result = self.marionette.execute_async_script("""
+let setReq = navigator.mozSettings.createLock().set({'lockscreen.enabled': false});
+setReq.onsuccess = function() {
+    let appsReq = navigator.mozApps.mgmt.getAll();
+    appsReq.onsuccess = function() {
+        let apps = appsReq.result;
+        for (let i = 0; i < apps.length; i++) {
+            let app = apps[i];
+            if (app.manifest.name === 'Test Container') {
+                app.launch();
+                window.addEventListener('apploadtime', function apploadtime(){
+                    window.removeEventListener('apploadtime', apploadtime);
+                    marionetteScriptFinished(true);
+                });
+                return;
+            }
+        }
+        marionetteScriptFinished(false);
+    }
+    appsReq.onerror = function() {
+        marionetteScriptFinished(false);
+    }
+}
+setReq.onerror = function() {
+    marionetteScriptFinished(false);
+}""", script_timeout=60000)
+                self.assertTrue(result)
+
+                frame = self.marionette.find_element(
+                    'css selector',
+                    'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
+                )
+
+            self.marionette.switch_to_frame(frame)
+            main_process = self.marionette.execute_script("""
+                return SpecialPowers.isMainProcess();
+                """)
+            self.assertFalse(main_process)
+
         context = self.context_re.search(js)
         if context:
             context = context.group(3)
             self.marionette.set_context(context)
 
         if context != "chrome":
             self.marionette.navigate('data:text/html,<html>test page</html>')
 
@@ -582,10 +530,13 @@ class MarionetteJSTestCase(CommonTestCas
         except ScriptTimeoutException:
             if 'timeout' in self.jsFile:
                 # expected exception
                 pass
             else:
                 self.loglines = self.marionette.get_logs()
                 raise
 
+        if self.oop:
+            self.marionette.switch_to_frame()
+
         self.marionette.execute_script("log('TEST-END: %s');" % self.jsFile.replace('\\', '\\\\'))
         self.marionette.test_name = None
--- a/testing/marionette/client/marionette/runner/base.py
+++ b/testing/marionette/client/marionette/runner/base.py
@@ -691,17 +691,17 @@ class BaseMarionetteTestRunner(object):
 
         for run_tests in self.mixin_run_tests:
             run_tests(tests)
         if self.shuffle:
             self.logger.info("Using seed where seed is:%d" % self.shuffle_seed)
 
         self.logger.suite_end()
 
-    def add_test(self, test, expected='pass', test_container=False):
+    def add_test(self, test, expected='pass', oop=None):
         filepath = os.path.abspath(test)
 
         if os.path.isdir(filepath):
             for root, dirs, files in os.walk(filepath):
                 for filename in files:
                     if (filename.startswith('test_') and
                         (filename.endswith('.py') or filename.endswith('.js'))):
                         filepath = os.path.join(root, filename)
@@ -714,17 +714,18 @@ class BaseMarionetteTestRunner(object):
             for atype in testtypes:
                 if atype.startswith('+'):
                     testargs.update({ atype[1:]: 'true' })
                 elif atype.startswith('-'):
                     testargs.update({ atype[1:]: 'false' })
                 else:
                     testargs.update({ atype: 'true' })
 
-        testarg_b2g = bool(testargs.get('b2g'))
+        # testarg_oop = either None, 'true' or 'false'.
+        testarg_oop = testargs.get('oop')
 
         file_ext = os.path.splitext(os.path.split(filepath)[-1])[1]
 
         if file_ext == '.ini':
             manifest = TestManifest()
             manifest.read(filepath)
 
             manifest_tests = manifest.active_tests(exists=False,
@@ -734,41 +735,79 @@ class BaseMarionetteTestRunner(object):
                                                    **mozinfo.info)
             unfiltered_tests = []
             for test in manifest_tests:
                 if test.get('disabled'):
                     self.manifest_skipped_tests.append(test)
                 else:
                     unfiltered_tests.append(test)
 
+            # Don't filter tests with "oop" flag because manifest parser can't
+            # handle it well.
+            if testarg_oop is not None:
+                del testargs['oop']
+
             target_tests = manifest.get(tests=unfiltered_tests, **testargs)
             for test in unfiltered_tests:
                 if test['path'] not in [x['path'] for x in target_tests]:
                     test.setdefault('disabled', 'filtered by type (%s)' % self.type)
                     self.manifest_skipped_tests.append(test)
 
             for i in target_tests:
                 if not os.path.exists(i["path"]):
                     raise IOError("test file: %s does not exist" % i["path"])
 
+                # manifest_oop is either 'false', 'true' or 'both'.  Anything
+                # else implies 'false'.
+                manifest_oop = i.get('oop', 'false')
+
+                # We only add an oop test when following conditions are met:
+                # 1) It's written by javascript because we have only
+                #    MarionetteJSTestCase that supports oop mode.
+                # 2) we're running with "--type=+oop" or no "--type=-oop", which
+                #    follows testarg_oop is either None or 'true' and must not
+                #    be 'false'.
+                # 3) When no "--type=[+-]oop" is applied, all active tests are
+                #    included in target_tests, so we must filter out those
+                #    really capable of running in oop mode. Besides, oop tests
+                #    must be explicitly specified for backward compatibility. So
+                #    test manifest_oop equals to either 'both' or 'true'.
                 file_ext = os.path.splitext(os.path.split(i['path'])[-1])[-1]
-                test_container = False
-                if i.get('test_container') and i.get('test_container') == 'true' and testarg_b2g:
-                    test_container = True
-                self.add_test(i["path"], i["expected"], test_container)
+                if (file_ext == '.js' and
+                    testarg_oop != 'false' and
+                    (manifest_oop == 'both' or manifest_oop == 'true')):
+                    self.add_test(i["path"], i["expected"], True)
+
+                # We only add an in-process test when following conditions are
+                # met:
+                # 1) we're running with "--type=-oop" or no "--type=+oop", which
+                #    follows testarg_oop is either None or 'false' and must not
+                #    be 'true'.
+                # 2) When no "--type=[+-]oop" is applied, all active tests are
+                #    included in target_tests, so we must filter out those
+                #    really capable of running in in-process mode.
+                if (testarg_oop != 'true' and
+                    (manifest_oop == 'both' or manifest_oop != 'true')):
+                    self.add_test(i["path"], i["expected"], False)
             return
 
-        self.tests.append({'filepath': filepath, 'expected': expected, 'test_container': test_container})
+        if oop is None:
+            # This test is added by directory enumeration or directly specified
+            # in argument list.  We have no manifest information here so we just
+            # respect the "--type=[+-]oop" argument here.
+            oop = file_ext == '.js' and testarg_oop == 'true'
 
-    def run_test(self, filepath, expected, test_container):
+        self.tests.append({'filepath': filepath, 'expected': expected, 'oop': oop})
+
+    def run_test(self, filepath, expected, oop):
 
         testloader = unittest.TestLoader()
         suite = unittest.TestSuite()
         self.test_kwargs['expected'] = expected
-        self.test_kwargs['test_container'] = test_container
+        self.test_kwargs['oop'] = oop
         mod_name = os.path.splitext(os.path.split(filepath)[-1])[0]
         for handler in self.test_handlers:
             if handler.match(os.path.basename(filepath)):
                 handler.add_tests_to_suite(mod_name,
                                            filepath,
                                            suite,
                                            testloader,
                                            self.marionette,
@@ -799,17 +838,17 @@ class BaseMarionetteTestRunner(object):
                 self.todo += len(results.expectedFailures)
 
     def run_test_set(self, tests):
         if self.shuffle:
             random.seed(self.shuffle_seed)
             random.shuffle(tests)
 
         for test in tests:
-            self.run_test(test['filepath'], test['expected'], test['test_container'])
+            self.run_test(test['filepath'], test['expected'], test['oop'])
             if self.marionette.check_for_crash():
                 break
 
     def run_test_sets(self):
         if self.total_chunks > len(self.tests):
             raise ValueError('Total number of chunks must be between 1 and %d.' % len(self.tests))
         if self.total_chunks > 1:
             chunks = [[] for i in range(self.total_chunks)]
@@ -818,17 +857,21 @@ class BaseMarionetteTestRunner(object):
                 chunks[target_chunk].append(test)
 
             self.logger.info('Running chunk %d of %d (%d tests selected from a '
                              'total of %d)' % (self.this_chunk, self.total_chunks,
                                                len(chunks[self.this_chunk - 1]),
                                                len(self.tests)))
             self.tests = chunks[self.this_chunk - 1]
 
-        self.run_test_set(self.tests)
+        oop_tests = [x for x in self.tests if x.get('oop')]
+        self.run_test_set(oop_tests)
+
+        in_process_tests = [x for x in self.tests if not x.get('oop')]
+        self.run_test_set(in_process_tests)
 
     def cleanup(self):
         if self.httpd:
             self.httpd.stop()
 
     __del__ = cleanup
 
     def generate_xml(self, results_list):
--- a/testing/marionette/client/marionette/tests/unit-tests.ini
+++ b/testing/marionette/client/marionette/tests/unit-tests.ini
@@ -8,17 +8,16 @@ browser = true
 ; true if the test is compatible with b2g, otherwise false
 b2g = true
 
 ; true if the test should be skipped
 skip = false
 
 ; marionette unit tests
 [include:unit/unit-tests.ini]
-test_container = true
 
 ; webapi tests
 [include:../../../../../dom/bluetooth/tests/marionette/manifest.ini]
 [include:../../../../../dom/telephony/test/marionette/manifest.ini]
 [include:../../../../../dom/voicemail/test/marionette/manifest.ini]
 [include:../../../../../dom/battery/test/marionette/manifest.ini]
 [include:../../../../../dom/mobilemessage/tests/marionette/manifest.ini]
 [include:../../../../../dom/mobileconnection/tests/marionette/manifest.ini]
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/manifest-oop-both.ini
@@ -0,0 +1,16 @@
+[DEFAULT]
+qemu = false
+browser = false
+b2g = true
+skip = false
+
+oop = both
+
+[test_success_both2.js]
+; oop unspecified
+[test_success_in_non_oop.js]
+oop = false
+[test_success_in_oop.js]
+oop = true
+[test_success_both.js]
+oop = both
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/manifest-oop-false.ini
@@ -0,0 +1,16 @@
+[DEFAULT]
+qemu = false
+browser = false
+b2g = true
+skip = false
+
+oop = false
+
+[test_success_in_non_oop2.js]
+; oop unspecified
+[test_success_in_non_oop.js]
+oop = false
+[test_success_in_oop.js]
+oop = true
+[test_success_both.js]
+oop = both
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/manifest-oop-true.ini
@@ -0,0 +1,16 @@
+[DEFAULT]
+qemu = false
+browser = false
+b2g = true
+skip = false
+
+oop = true
+
+[test_success_in_oop2.js]
+; oop unspecified
+[test_success_in_non_oop.js]
+oop = false
+[test_success_in_oop.js]
+oop = true
+[test_success_both.js]
+oop = both
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/manifest-oop-unspecified.ini
@@ -0,0 +1,14 @@
+[DEFAULT]
+qemu = false
+browser = false
+b2g = true
+skip = false
+
+[test_success_in_non_oop2.js]
+; oop unspecified
+[test_success_in_non_oop.js]
+oop = false
+[test_success_in_oop.js]
+oop = true
+[test_success_both.js]
+oop = both
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/manifest.ini
@@ -0,0 +1,10 @@
+[DEFAULT]
+qemu = false
+browser = false
+b2g = true
+skip = false
+
+[include:manifest-oop-unspecified.ini]
+[include:manifest-oop-both.ini]
+[include:manifest-oop-true.ini]
+[include:manifest-oop-false.ini]
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/test_success_both.js
@@ -0,0 +1,3 @@
+MARIONETTE_TIMEOUT = 60000;
+ok(true, "Always success");
+finish();
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/test_success_both2.js
@@ -0,0 +1,3 @@
+MARIONETTE_TIMEOUT = 60000;
+ok(true, "Always success");
+finish();
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/test_success_in_non_oop.js
@@ -0,0 +1,3 @@
+MARIONETTE_TIMEOUT = 60000;
+ok(SpecialPowers.isMainProcess(), "SpecialPowers.isMainProcess()");
+finish();
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/test_success_in_non_oop2.js
@@ -0,0 +1,3 @@
+MARIONETTE_TIMEOUT = 60000;
+ok(SpecialPowers.isMainProcess(), "SpecialPowers.isMainProcess()");
+finish();
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/test_success_in_oop.js
@@ -0,0 +1,3 @@
+MARIONETTE_TIMEOUT = 60000;
+ok(!SpecialPowers.isMainProcess(), "SpecialPowers.isMainProcess()");
+finish();
new file mode 100644
--- /dev/null
+++ b/testing/marionette/client/marionette/tests/unit/oop/test_success_in_oop2.js
@@ -0,0 +1,3 @@
+MARIONETTE_TIMEOUT = 60000;
+ok(!SpecialPowers.isMainProcess(), "SpecialPowers.isMainProcess()");
+finish();
--- a/testing/marionette/client/marionette/tests/unit/test_navigation.py
+++ b/testing/marionette/client/marionette/tests/unit/test_navigation.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_test import MarionetteTestCase
 from 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)
@@ -55,17 +55,16 @@ class TestNavigate(MarionetteTestCase):
         self.assertEqual("Marionette Test", self.marionette.title)
         self.assertTrue(self.marionette.execute_script("var elem = window.document.createElement('div'); elem.id = 'someDiv';" +
                                         "window.document.body.appendChild(elem); return true;"))
         self.assertFalse(self.marionette.execute_script("return window.document.getElementById('someDiv') == undefined;"))
         self.marionette.refresh()
         self.assertEqual("Marionette Test", self.marionette.title)
         self.assertTrue(self.marionette.execute_script("return window.document.getElementById('someDiv') == undefined;"))
 
-    @skip_if_b2g
     def test_navigate_frame(self):
         self.marionette.navigate(self.marionette.absolute_url("test_iframe.html"))
         self.marionette.switch_to_frame(0)
         self.marionette.navigate(self.marionette.absolute_url("empty.html"))
         self.assertTrue('empty.html' in self.marionette.get_url())
         self.marionette.switch_to_frame()
         self.assertTrue('test_iframe.html' in self.marionette.get_url())
 
--- a/testing/marionette/client/marionette/tests/unit/test_specialpowers.py
+++ b/testing/marionette/client/marionette/tests/unit/test_specialpowers.py
@@ -1,22 +1,20 @@
 # 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_test import MarionetteTestCase
 from errors import JavascriptException, MarionetteException
 
 class TestSpecialPowersContent(MarionetteTestCase):
 
     testpref = "testing.marionette.contentcharpref"
     testvalue = "blabla"
 
-    # fails in b2g's test-container: "Error getting pref", Bug 1060061
-    @skip_if_b2g
     def test_prefs(self):
         result = self.marionette.execute_script("""
         SpecialPowers.setCharPref("%(pref)s", "%(value)s");
         return SpecialPowers.getCharPref("%(pref)s")
         """ % {'pref': self.testpref, 'value': self.testvalue}, special_powers=True);
         self.assertEqual(result, self.testvalue) 
 
     def test_prefs_after_navigate(self):
--- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini
+++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini
@@ -12,17 +12,16 @@ b2g = true
 skip = false
 
 [test_session.py]
 [test_capabilities.py]
 
 [test_expectedfail.py]
 expected = fail
 [test_import_script.py]
-b2g = false
 [test_import_script_reuse_window.py]
 b2g = false
 [test_click.py]
 [test_click_chrome.py]
 b2g = false
 [test_selected.py]
 [test_selected_chrome.py]
 b2g = false
@@ -60,43 +59,38 @@ b2g = false
 
 [test_timeouts.py]
 
 [test_element_touch.py]
 b2g = true
 browser = false
 
 [test_gesture.py]
-disabled = "Bug 1060060"
 b2g = true
 browser = false
 
 [test_single_finger.py]
-disabled = "Bug 1060060"
 b2g = true
 browser = false
 [test_single_finger_desktop.py]
 b2g = false
 
 [test_multi_finger.py]
-disabled = "Bug 1060060"
 b2g = true
 browser = false
 
 [test_simpletest_pass.js]
 [test_simpletest_sanity.py]
 [test_simpletest_chrome.js]
 [test_simpletest_timeout.js]
 [test_specialpowers.py]
 [test_switch_anonymous_content.py]
 [test_switch_frame.py]
 [test_switch_frame_chrome.py]
-b2g = false
 [test_switch_remote_frame.py]
-b2g = false
 
 [test_pagesource.py]
 b2g = false
 
 [test_visibility.py]
 [test_window_switching.py]
 b2g = false
 [test_window_management.py]
@@ -109,19 +103,20 @@ b2g = false
 [test_window_title.py]
 [test_window_type.py]
 [test_implicit_waits.py]
 [test_wait.py]
 [test_expected.py]
 [test_date_time_value.py]
 [test_getactiveframe_oop.py]
 disabled = "Bug 925688"
-b2g = false
 [test_submit.py]
 [test_chrome_async_finish.js]
 [test_screen_orientation.py]
 browser = false
 [test_errors.py]
 
 [test_execute_isolate.py]
 [test_click_scrolling.py]
 [test_profile_management.py]
 b2g = false
+
+[include:oop/manifest.ini]