| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import socket | 6 import socket |
| 7 import sys | 7 import sys |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 _SRC_DIR = os.path.abspath(os.path.join( | 10 _SRC_DIR = os.path.abspath(os.path.join( |
| 11 os.path.dirname(__file__), '..', '..', '..')) | 11 os.path.dirname(__file__), '..', '..', '..', '..')) |
| 12 sys.path.append(os.path.join(_SRC_DIR, 'tools', 'android', 'loading')) | 12 sys.path.append(os.path.join(_SRC_DIR, 'tools', 'android', 'loading')) |
| 13 | 13 |
| 14 import options | 14 import options |
| 15 from trace_test import webserver_test | 15 from trace_test import webserver_test |
| 16 | 16 |
| 17 | 17 |
| 18 OPTIONS = options.OPTIONS | 18 OPTIONS = options.OPTIONS |
| 19 | 19 |
| 20 | 20 |
| 21 class TracingTrackTestCase(unittest.TestCase): | 21 class TracingTrackTestCase(unittest.TestCase): |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | 42 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| 43 sock.connect((host, int(port))) | 43 sock.connect((host, int(port))) |
| 44 sock.sendall('GET test.html HTTP/1.1\n\n') | 44 sock.sendall('GET test.html HTTP/1.1\n\n') |
| 45 data = sock.recv(4096) | 45 data = sock.recv(4096) |
| 46 print '%%% ' + data | 46 print '%%% ' + data |
| 47 self.assertTrue('HTTP/1.0 200 OK' in data) | 47 self.assertTrue('HTTP/1.0 200 OK' in data) |
| 48 | 48 |
| 49 sock.close() | 49 sock.close() |
| 50 self.assertTrue(server.Stop()) | 50 self.assertTrue(server.Stop()) |
| 51 |
| 52 |
| 53 if __name__ == '__main__': |
| 54 unittest.main() |
| OLD | NEW |