From 5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 Mon Sep 17 00:00:00 2001 From: Iain Merrick Date: Mon, 13 Sep 2010 16:35:48 +0100 Subject: Merge WebKit at r67178 : Initial merge by git. Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18 --- .../layout_tests/run_webkit_tests_unittest.py | 50 ++++++++++++++++------ 1 file changed, 38 insertions(+), 12 deletions(-) (limited to 'WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py') diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py index 4cbfdfc..aa96962 100644 --- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py +++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py @@ -32,9 +32,9 @@ import codecs import logging import os -import pdb import Queue import sys +import tempfile import thread import time import threading @@ -59,7 +59,10 @@ def passing_run(args=[], port_obj=None, record_results=False, new_args.extend(args) if not tests_included: # We use the glob to test that globbing works. - new_args.extend(['passes', 'failures/expected/*']) + new_args.extend(['passes', + 'http/tests', + 'websocket/tests', + 'failures/expected/*']) options, parsed_args = run_webkit_tests.parse_args(new_args) if port_obj is None: port_obj = port.get(options.platform, options) @@ -71,10 +74,12 @@ def logging_run(args=[], tests_included=False): new_args = ['--no-record-results'] if not '--platform' in args: new_args.extend(['--platform', 'test']) - if args: - new_args.extend(args) + new_args.extend(args) if not tests_included: - new_args.extend(['passes', 'failures/expected/*']) + new_args.extend(['passes', + 'http/tests' + 'websocket/tests', + 'failures/expected/*']) options, parsed_args = run_webkit_tests.parse_args(new_args) port_obj = port.get(options.platform, options) buildbot_output = array_stream.ArrayStream() @@ -119,6 +124,14 @@ class MainTest(unittest.TestCase): self.assertTrue(out.empty()) self.assertFalse(err.empty()) + def test_hung_thread(self): + res, out, err = logging_run(['--run-singly', '--time-out-ms=50', + 'failures/expected/hang.html'], + tests_included=True) + self.assertEqual(res, 0) + self.assertFalse(out.empty()) + self.assertFalse(err.empty()) + def test_keyboard_interrupt(self): # Note that this also tests running a test marked as SKIP if # you specify it explicitly. @@ -175,6 +188,19 @@ class MainTest(unittest.TestCase): # FIXME: verify # of tests run self.assertTrue(passing_run(['passes/text.html'], tests_included=True)) + def test_test_list(self): + filename = tempfile.mktemp() + tmpfile = file(filename, mode='w+') + tmpfile.write('passes/text.html') + tmpfile.close() + self.assertTrue(passing_run(['--test-list=%s' % filename], + tests_included=True)) + os.remove(filename) + res, out, err = logging_run(['--test-list=%s' % filename], + tests_included=True) + self.assertEqual(res, -1) + self.assertFalse(err.empty()) + def test_unexpected_failures(self): # Run tests including the unexpected failures. res, out, err = logging_run(tests_included=True) @@ -279,6 +305,13 @@ class DryrunTest(unittest.TestCase): self.assertTrue(passing_run(['--platform', 'dryrun-mac', 'fast/html'])) + def test_test(self): + res, out, err = logging_run(['--platform', 'dryrun-test', + '--pixel-tests']) + self.assertEqual(res, 2) + self.assertFalse(out.empty()) + self.assertFalse(err.empty()) + class TestThread(dump_render_tree_thread.WatchableThread): def __init__(self, started_queue, stopping_queue): @@ -388,13 +421,6 @@ class StandaloneFunctionsTest(unittest.TestCase): self.assertFalse(child_thread.isAlive()) oc.restore_output() - def test_find_thread_stack(self): - id, stack = sys._current_frames().items()[0] - found_stack = run_webkit_tests._find_thread_stack(id) - self.assertNotEqual(found_stack, None) - - found_stack = run_webkit_tests._find_thread_stack(0) - self.assertEqual(found_stack, None) if __name__ == '__main__': unittest.main() -- cgit v1.1