rebaseline-server: Make it possible to not launch a browser with the server.
authorrakuco@FreeBSD.org <rakuco@FreeBSD.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 08:32:34 +0000 (08:32 +0000)
committerrakuco@FreeBSD.org <rakuco@FreeBSD.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 08:32:34 +0000 (08:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82999

Reviewed by Adam Barth.

Add the `--no-show-results' option, which lets one decide not to
launch a web browser when running the rebaseline server.  This is
especially useful if the default browser is not the wanted one, or
if the rebaseline server page is already open.

* Scripts/webkitpy/tool/commands/abstractlocalservercommand.py:
(AbstractLocalServerCommand.__init__):
(AbstractLocalServerCommand.execute):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112995 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/tool/commands/abstractlocalservercommand.py

index acb4019..cb4d348 100644 (file)
@@ -1,3 +1,19 @@
+2012-04-03  Raphael Kubo da Costa  <rakuco@FreeBSD.org>
+
+        rebaseline-server: Make it possible to not launch a browser with the server.
+        https://bugs.webkit.org/show_bug.cgi?id=82999
+
+        Reviewed by Adam Barth.
+
+        Add the `--no-show-results' option, which lets one decide not to
+        launch a web browser when running the rebaseline server.  This is
+        especially useful if the default browser is not the wanted one, or
+        if the rebaseline server page is already open.
+
+        * Scripts/webkitpy/tool/commands/abstractlocalservercommand.py:
+        (AbstractLocalServerCommand.__init__):
+        (AbstractLocalServerCommand.execute):
+
 2012-04-02  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         EFL's LayoutTestController disableImageLoading implementation.
index 269cf25..6c54da2 100644 (file)
@@ -35,6 +35,7 @@ class AbstractLocalServerCommand(AbstractDeclarativeCommand):
     def __init__(self):
         options = [
             make_option("--httpd-port", action="store", type="int", default=8127, help="Port to use for the HTTP server"),
+            make_option("--no-show-results", action="store_false", default=True, dest="show_results", help="Don't launch a browser with the rebaseline server"),
         ]
         AbstractDeclarativeCommand.__init__(self, options=options)
 
@@ -48,8 +49,9 @@ class AbstractLocalServerCommand(AbstractDeclarativeCommand):
         print "Starting server at %s" % server_url
         print "Use the 'Exit' link in the UI, %squitquitquit or Ctrl-C to stop" % server_url
 
-        # FIXME: This seems racy.
-        threading.Timer(0.1, lambda: self._tool.user.open_url(server_url)).start()
+        if options.show_results:
+            # FIXME: This seems racy.
+            threading.Timer(0.1, lambda: self._tool.user.open_url(server_url)).start()
 
         httpd = self.server(httpd_port=options.httpd_port, config=config)
         httpd.serve_forever()