Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/servers/layout_tests_server.py

Issue 2831883002: webkitpy: Reduce usage of path_from_webkit_base(). (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2010 Google Inc. All rights reserved. 1 # Copyright (c) 2010 Google Inc. All rights reserved.
2 # Copyright (C) 2014 Samsung Electronics. All rights reserved. 2 # Copyright (C) 2014 Samsung Electronics. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class LayoutTestsServerHTTPRequestHandler(ReflectionHandler): 48 class LayoutTestsServerHTTPRequestHandler(ReflectionHandler):
49 49
50 def do_POST(self): 50 def do_POST(self):
51 json_raw_data = self.rfile.read(int(self.headers.getheader('content-leng th'))) 51 json_raw_data = self.rfile.read(int(self.headers.getheader('content-leng th')))
52 json_data = json.loads(json_raw_data) 52 json_data = json.loads(json_raw_data)
53 test_list = '' 53 test_list = ''
54 for each in json_data['tests']: 54 for each in json_data['tests']:
55 test_list += each + ' ' 55 test_list += each + ' '
56 filesystem = FileSystem() 56 filesystem = FileSystem()
57 webkit_finder = WebKitFinder(filesystem) 57 webkit_finder = WebKitFinder(filesystem)
58 script_dir = webkit_finder.path_from_webkit_base('Tools', 'Scripts') 58 script_dir = webkit_finder.path_from_tools_scripts()
59 executable_path = script_dir + '/run-webkit-tests' 59 executable_path = script_dir + '/run-webkit-tests'
60 cmd = 'python ' + executable_path + ' --no-show-results ' 60 cmd = 'python ' + executable_path + ' --no-show-results '
61 cmd += test_list 61 cmd += test_list
62 process = subprocess.Popen(cmd, shell=True, cwd=script_dir, env=None, st dout=subprocess.PIPE, stderr=STDOUT) 62 process = subprocess.Popen(cmd, shell=True, cwd=script_dir, env=None, st dout=subprocess.PIPE, stderr=STDOUT)
63 self.send_response(200) 63 self.send_response(200)
64 self.send_header('Access-Control-Allow-Origin', '*') 64 self.send_header('Access-Control-Allow-Origin', '*')
65 self.send_header('Content-type', 'text/html') 65 self.send_header('Content-type', 'text/html')
66 self.end_headers() 66 self.end_headers()
67 while process.poll() is None: 67 while process.poll() is None:
68 html_output = '<br>' + str(process.stdout.readline()) 68 html_output = '<br>' + str(process.stdout.readline())
69 self.wfile.write(html_output) 69 self.wfile.write(html_output)
70 self.wfile.flush() 70 self.wfile.flush()
71 time.sleep(0.05) 71 time.sleep(0.05)
72 process.wait() 72 process.wait()
73 73
74 def do_OPTIONS(self): 74 def do_OPTIONS(self):
75 self.send_response(200, 'ok') 75 self.send_response(200, 'ok')
76 self.send_header('Access-Control-Allow-Origin', '*') 76 self.send_header('Access-Control-Allow-Origin', '*')
77 self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') 77 self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
78 self.send_header('Access-Control-Allow-Headers', 'Content-type') 78 self.send_header('Access-Control-Allow-Headers', 'Content-type')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698