Bug 797177 - Unbreak b2g mochitests, r=ahal
authorDavid Chan <dchan@mozilla.com>
Tue, 02 Oct 2012 15:43:19 -0700
changeset 109145 a63c507a673a48dd117cdd8952604272ff26259b
parent 109144 13fd49ef7786369ee42f505160122b196a6994b0
child 109146 da6230dfa32ebda657ef39552d0f5ca5d8f4796b
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersahal
bugs797177
milestone18.0a1
Bug 797177 - Unbreak b2g mochitests, r=ahal
build/mobile/b2gautomation.py
testing/mochitest/runtestsb2g.py
--- a/build/mobile/b2gautomation.py
+++ b/build/mobile/b2gautomation.py
@@ -80,17 +80,17 @@ class B2GRemoteAutomation(Automation):
         # We always hide the results table in B2G; it's much slower if we don't.
         env['MOZ_HIDE_RESULTS_TABLE'] = '1'
         return env
 
     def waitForNet(self): 
         active = False
         time_out = 0
         while not active and time_out < 40:
-            data = self._devicemanager.runCmd(['shell', '/system/bin/netcfg']).stdout.readlines()
+            data = self._devicemanager._runCmd(['shell', '/system/bin/netcfg']).stdout.readlines()
             data.pop(0)
             for line in data:
                 if (re.search(r'UP\s+(?:[0-9]{1,3}\.){3}[0-9]{1,3}', line)):
                     active = True
                     break
             time_out += 1
             time.sleep(1)
         return active
@@ -151,17 +151,17 @@ class B2GRemoteAutomation(Automation):
 
     def getDeviceStatus(self, serial=None):
         # Get the current status of the device.  If we know the device
         # serial number, we look for that, otherwise we use the (presumably
         # only) device shown in 'adb devices'.
         serial = serial or self._devicemanager.deviceSerial
         status = 'unknown'
 
-        for line in self._devicemanager.runCmd(['devices']).stdout.readlines():
+        for line in self._devicemanager._runCmd(['devices']).stdout.readlines():
             result =  re.match('(.*?)\t(.*)', line)
             if result:
                 thisSerial = result.group(1)
                 if not serial or thisSerial == serial:
                     serial = thisSerial
                     status = result.group(2)
 
         return (serial, status)
@@ -176,17 +176,17 @@ class B2GRemoteAutomation(Automation):
         if self._is_emulator:
             self.marionette.emulator.wait_for_port()
 
     def rebootDevice(self):
         # find device's current status and serial number
         serial, status = self.getDeviceStatus()
 
         # reboot!
-        self._devicemanager.runCmd(['shell', '/system/bin/reboot'])
+        self._devicemanager._runCmd(['shell', '/system/bin/reboot'])
 
         # The above command can return while adb still thinks the device is
         # connected, so wait a little bit for it to disconnect from adb.
         time.sleep(10)
 
         # wait for device to come back to previous status
         print 'waiting for device to come back online after reboot'
         start = time.time()
@@ -216,17 +216,17 @@ class B2GRemoteAutomation(Automation):
             self.rebootDevice()
             time.sleep(5)
             #wait for wlan to come up 
             if not self.waitForNet():
                 raise Exception("network did not come up, please configure the network" + 
                                 " prior to running before running the automation framework")
 
         # stop b2g
-        self._devicemanager.runCmd(['shell', 'stop', 'b2g'])
+        self._devicemanager._runCmd(['shell', 'stop', 'b2g'])
         time.sleep(5)
 
         # relaunch b2g inside b2g instance
         instance = self.B2GInstance(self._devicemanager)
 
         time.sleep(5)
 
         # Set up port forwarding again for Marionette, since any that
--- a/testing/mochitest/runtestsb2g.py
+++ b/testing/mochitest/runtestsb2g.py
@@ -210,31 +210,31 @@ class B2GMochitest(Mochitest):
         self.localLog = None
         self.userJS = '/data/local/user.js'
         self.remoteMozillaPath = '/data/b2g/mozilla'
         self.remoteProfilesIniPath = os.path.join(self.remoteMozillaPath, 'profiles.ini')
         self.originalProfilesIni = None
 
     def copyRemoteFile(self, src, dest):
         if self._dm.useDDCopy:
-            self._dm.checkCmdAs(['shell', 'dd', 'if=%s' % src,'of=%s' % dest])
+            self._dm._checkCmdAs(['shell', 'dd', 'if=%s' % src,'of=%s' % dest])
         else:
-            self._dm.checkCmdAs(['shell', 'cp', src, dest])
+            self._dm._checkCmdAs(['shell', 'cp', src, dest])
 
     def origUserJSExists(self):
         return self._dm.fileExists('/data/local/user.js.orig')
 
     def cleanup(self, manifest, options):
         if self.localLog:
             self._dm.getFile(self.remoteLog, self.localLog)
             self._dm.removeFile(self.remoteLog)
 
         if not options.emulator:
             # Remove the test profile
-            self._dm.checkCmdAs(['shell', 'rm', '-r', self.remoteProfile])
+            self._dm._checkCmdAs(['shell', 'rm', '-r', self.remoteProfile])
 
             if self.origUserJSExists():
                 # Restore the original user.js
                 self._dm.removeFile(self.userJS)
                 self.copyRemoteFile('%s.orig' % self.userJS, self.userJS)
                 self._dm.removeFile("%s.orig" % self.userJS)
 
             if self._dm.fileExists('%s.orig' % self.remoteProfilesIniPath):
@@ -382,17 +382,17 @@ user_pref("dom.ipc.tabs.disabled", false
 user_pref("dom.ipc.browser_frames.oop_by_default", true);\n
 user_pref("browser.manifestURL","app://system.gaiamobile.org/manifest.webapp");\n
 user_pref("dom.mozBrowserFramesWhitelist","app://system.gaiamobile.org,http://mochi.test:8888");\n
 user_pref("network.dns.localDomains","app://system.gaiamobile.org");\n
 """)
         f.close()
 
         # Copy the profile to the device.
-        self._dm.checkCmdAs(['shell', 'rm', '-r', self.remoteProfile])
+        self._dm._checkCmdAs(['shell', 'rm', '-r', self.remoteProfile])
         if self._dm.pushDir(options.profilePath, self.remoteProfile) == None:
             raise devicemanager.FileError("Unable to copy profile to device.")
 
         # In B2G, user.js is always read from /data/local, not the profile
         # directory.  Backup the original user.js first so we can restore it.
         if not self._dm.fileExists('%s.orig' % self.userJS):
             self.copyRemoteFile(self.userJS, '%s.orig' % self.userJS)
         self._dm.pushFile(os.path.join(options.profilePath, "user.js"), self.userJS)