summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 16:54:58 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 16:54:58 +0000
commit9bfd8727ff93b1d9528fb1216480f5f848139e54 (patch)
tree7a9b9125693208e6a2c712821aa8a363e846058b /ppapi
parent1cad88020f0819a475874b7cb867619558dd9efc (diff)
downloadchromium_src-9bfd8727ff93b1d9528fb1216480f5f848139e54.zip
chromium_src-9bfd8727ff93b1d9528fb1216480f5f848139e54.tar.gz
chromium_src-9bfd8727ff93b1d9528fb1216480f5f848139e54.tar.bz2
[NaCl browser_tester] Add "enable_sockets" flag.
This flag passes "--allow-nacl-socket-api=<host>" to the Chrome arguments. Using localhost for <host> does not work because browser_tester launches using the external IP address. Instead of using localhost, the browser_tester generates the argument with the correct server address. BUG=none R=ncbray@chromium.org Review URL: https://chromiumcodereview.appspot.com/22928002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217277 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rwxr-xr-xppapi/native_client/tools/browser_tester/browser_tester.py6
-rwxr-xr-xppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py11
2 files changed, 12 insertions, 5 deletions
diff --git a/ppapi/native_client/tools/browser_tester/browser_tester.py b/ppapi/native_client/tools/browser_tester/browser_tester.py
index 513a091..fb96443 100755
--- a/ppapi/native_client/tools/browser_tester/browser_tester.py
+++ b/ppapi/native_client/tools/browser_tester/browser_tester.py
@@ -138,6 +138,10 @@ def BuildArgParser():
parser.add_option('--enable_crash_reporter', dest='enable_crash_reporter',
action='store_true', default=False,
help='Force crash reporting on.')
+ parser.add_option('--enable_sockets', dest='enable_sockets',
+ action='store_true', default=False,
+ help='Pass --allow-nacl-socket-api=<host> to Chrome, where '
+ '<host> is the name of the browser tester\'s web server.')
return parser
@@ -242,7 +246,7 @@ def RunTestsOnce(url, options):
full_url = 'http://%s:%d/%s' % (host, port, url)
if len(options.test_args) > 0:
full_url += '?' + urllib.urlencode(options.test_args)
- browser.Run(full_url, port)
+ browser.Run(full_url, host, port)
server.TestingBegun(0.125)
# In Python 2.5, server.handle_request may block indefinitely. Serving pages
diff --git a/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py b/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py
index 256a1cb..c8842be 100755
--- a/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py
+++ b/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py
@@ -9,6 +9,7 @@ import shutil
import sys
import tempfile
import time
+import urlparse
import browserprocess
@@ -105,7 +106,7 @@ class BrowserLauncher(object):
def CreateProfile(self):
raise NotImplementedError
- def MakeCmd(self, url):
+ def MakeCmd(self, url, host, port):
raise NotImplementedError
def CreateToolLogDir(self):
@@ -205,12 +206,12 @@ class BrowserLauncher(object):
def GetReturnCode(self):
return self.browser_process.GetReturnCode()
- def Run(self, url, port):
+ def Run(self, url, host, port):
self.binary = EscapeSpaces(self.FindBinary())
self.profile = self.CreateProfile()
if self.options.tool is not None:
self.tool_log_dir = self.CreateToolLogDir()
- cmd = self.MakeCmd(url, port)
+ cmd = self.MakeCmd(url, host, port)
self.Launch(cmd, MakeEnv(self.options))
@@ -262,7 +263,7 @@ class ChromeLauncher(BrowserLauncher):
def NetLogName(self):
return os.path.join(self.profile, 'netlog.json')
- def MakeCmd(self, url, port):
+ def MakeCmd(self, url, host, port):
cmd = [self.binary,
# Note that we do not use "--enable-logging" here because
# it actually turns off logging to the Buildbot logs on
@@ -335,6 +336,8 @@ class ChromeLauncher(BrowserLauncher):
'--log-file=%s/log.%%p' % (self.tool_log_dir,)] + cmd
elif self.options.tool != None:
raise LaunchFailure('Invalid tool name "%s"' % (self.options.tool,))
+ if self.options.enable_sockets:
+ cmd.append('--allow-nacl-socket-api=%s' % host)
cmd.extend(self.options.browser_flags)
cmd.append(url)
return cmd