~extension-hackers/globalmenu-extension/3.5

« back to all changes in this revision

Viewing changes to build/pgo/profileserver.py.in

  • Committer: Chris Coulson
  • Date: 2011-01-12 23:59:38 UTC
  • Revision ID: chrisccoulson@ubuntu.com-20110112235938-55ewz4b5fcostv1k
* Refresh build system from build-system.tar.gz provided by xulrunner-dev 2.0~b9+build1+nobinonly-0ubuntu2

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
import shutil
48
48
from datetime import datetime
49
49
from automation import Automation
 
50
from automationutils import getDebuggerInfo, addCommonOptions
50
51
 
51
52
PORT = 8888
52
53
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0])))
58
59
  allow_reuse_address = True
59
60
 
60
61
if __name__ == '__main__':
 
62
  from optparse import OptionParser
61
63
  automation = Automation()
 
64
 
 
65
  parser = OptionParser()
 
66
  addCommonOptions(parser)
 
67
 
 
68
  options, args = parser.parse_args()
 
69
 
 
70
  debuggerInfo = getDebuggerInfo(".", options.debugger, options.debuggerArgs,
 
71
          options.debuggerInteractive)
 
72
 
62
73
  httpd = EasyServer(("", PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
63
74
  t = threading.Thread(target=httpd.serve_forever)
64
75
  t.setDaemon(True) # don't hang on exit
73
84
  url = "http://localhost:%d/index.html" % PORT
74
85
  appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
75
86
  status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
 
87
                             debuggerInfo=debuggerInfo,
76
88
                             # the profiling HTML doesn't output anything,
77
89
                             # so let's just run this without a timeout
78
90
                             timeout = None)