Bug 791346 - Fix Marionette shutdown problems on Windows, r=dburns, DONTBUILD because NPOTB
authorJonathan Griffin <jgriffin@mozilla.com>
Thu, 20 Sep 2012 11:13:42 -0700
changeset 107588 f627a702d90d0030d850562700ff22a260fd2718
parent 107587 f8d30ea0974c940e915b2b8bc5539a182374c7b1
child 107589 7b8dca41f2d6df946bf12793db26aacefbf1f9a3
push id23492
push userjgriffin@mozilla.com
push dateThu, 20 Sep 2012 18:13:54 +0000
treeherdermozilla-central@f627a702d90d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdburns, DONTBUILD
bugs791346
milestone18.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 791346 - Fix Marionette shutdown problems on Windows, r=dburns, DONTBUILD because NPOTB
testing/marionette/client/marionette/geckoinstance.py
testing/marionette/client/marionette/marionette.py
testing/marionette/client/marionette/marionette_test.py
testing/marionette/client/marionette/runtests.py
--- a/testing/marionette/client/marionette/geckoinstance.py
+++ b/testing/marionette/client/marionette/geckoinstance.py
@@ -16,17 +16,18 @@ class GeckoInstance(object):
         self.bin = bin
         self.profile = profile
         self.runner = None
 
     def start(self):
         profile = self.profile
         if not profile:
             prefs = {"marionette.defaultPrefs.enabled": True,
-                     "marionette.defaultPrefs.port": 2828}
+                     "marionette.defaultPrefs.port": 2828,
+                     "browser.warnOnQuit": False}
             profile = {"preferences": prefs, "restore":False}
         print "starting runner"
         self.runner = Runner.create(binary=self.bin, profile_args=profile, cmdargs=['-no-remote'])
         self.runner.start()
 
     def close(self):
         self.runner.stop()
         self.runner.cleanup()
--- a/testing/marionette/client/marionette/marionette.py
+++ b/testing/marionette/client/marionette/marionette.py
@@ -126,17 +126,17 @@ class Marionette(object):
             self.port = self.emulator.setup_port_forwarding(self.port)
             assert(self.emulator.wait_for_port())
 
         self.client = MarionetteClient(self.host, self.port)
 
     def __del__(self):
         if self.emulator:
             self.emulator.close()
-        if self.bin:
+        if self.instance:
             self.instance.close()
         for qemu in self.extra_emulators:
             qemu.emulator.close()
 
     def _send_message(self, command, response_key, **kwargs):
         if not self.session and command not in ('newSession', 'getStatus'):
             raise MarionetteException(message="Please start a session")
 
--- a/testing/marionette/client/marionette/marionette_test.py
+++ b/testing/marionette/client/marionette/marionette_test.py
@@ -214,12 +214,12 @@ class MarionetteJSTestCase(CommonTestCas
         except ScriptTimeoutException:
             if 'timeout' in self.jsFile:
                 # expected exception
                 pass
             else:
                 self.loglines = self.marionette.get_logs()
                 raise
 
-        self.marionette.execute_script("log('TEST-END: %s');" % self.jsFile)
+        self.marionette.execute_script("log('TEST-END: %s');" % self.jsFile.replace('\\', '\\\\'))
 
 
 
--- a/testing/marionette/client/marionette/runtests.py
+++ b/testing/marionette/client/marionette/runtests.py
@@ -322,16 +322,21 @@ class MarionetteTestRunner(object):
             except Exception, e:
                 print "Could not submit to datazilla"
                 print e
 
         if self.xml_output:
             with open(self.xml_output, 'w') as f:
                 f.write(self.generate_xml(self.results))
 
+        if self.marionette.instance:
+            self.marionette.instance.close()
+            self.marionette.instance = None
+        del self.marionette
+
     def run_test(self, test, testtype):
         if not self.httpd:
             print "starting httpd"
             self.start_httpd()
         
         if not self.marionette:
             self.start_marionette()