Created
November 15, 2011 13:23
-
-
Save Smith1123/1367062 to your computer and use it in GitHub Desktop.
Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/LayoutTests/platform/qt-wk2/Skipped b/LayoutTests/platform/qt-wk2/Skipped | |
index 3583404..bda08b5 100644 | |
--- a/LayoutTests/platform/qt-wk2/Skipped | |
+++ b/LayoutTests/platform/qt-wk2/Skipped | |
@@ -1855,3 +1855,5 @@ fast/css/font-face-descending-unicode-range.html | |
# [Qt][WK2] fast/transforms/scrollIntoView-transformed.html is flaky | |
# https://bugs.webkit.org/show_bug.cgi?id=70935 | |
fast/transforms/scrollIntoView-transformed.html | |
+ | |
+editing/pasteboard/data-transfer-items-image-png.html | |
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py | |
index c49fa3d..d10edfb 100644 | |
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py | |
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py | |
@@ -55,6 +55,7 @@ class SingleTestRunner: | |
self._timeout = test_input.timeout | |
self._worker_name = worker_name | |
self._test_name = test_input.test_name | |
+ self._should_run_pixel_test = test_input.should_run_pixel_test | |
self._is_reftest = False | |
self._is_mismatch_reftest = False | |
@@ -102,6 +103,8 @@ class SingleTestRunner: | |
self._port.expected_audio(self._test_name)) | |
def _should_fetch_expected_checksum(self): | |
+ if not self._should_run_pixel_test: | |
+ return False | |
return (self._options.pixel_tests and | |
not (self._options.new_baseline or self._options.reset_results)) | |
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py b/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py | |
index ab8aa75..496a613 100644 | |
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py | |
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py | |
@@ -104,10 +104,23 @@ class Worker(manager_worker_broker.AbstractWorker): | |
self.cleanup() | |
_log.debug("%s exiting" % self._name) | |
+ def pixel_tests(self, test_list): | |
+ no_png = [] | |
+ for test_input in test_list: | |
+ if self._port.expected_checksum(test_input.test_name) == None: | |
+ no_png.append(test_input) | |
+ return no_png | |
+ | |
def handle_test_list(self, src, list_name, test_list): | |
start_time = time.time() | |
num_tests = 0 | |
+ no_png_list = [] | |
+ print test_list | |
+ if self._port.driver_name() == "WebKitTestRunner" and self._port.get_option('skip_pixel_test_if_no_baseline') and self._port.get_option('pixel_tests'): | |
+ no_png_list = self.pixel_tests(test_list) | |
for test_input in test_list: | |
+ if test_input in no_png_list: | |
+ test_input.should_run_pixel_test = False | |
self._run_test(test_input) | |
num_tests += 1 | |
self._worker_connection.yield_to_broker() | |
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_input.py b/Tools/Scripts/webkitpy/layout_tests/models/test_input.py | |
index b738aef..548acdd 100644 | |
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_input.py | |
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_input.py | |
@@ -36,7 +36,7 @@ class TestInput: | |
ref_file = None | |
is_mismatch_reftest = None | |
- def __init__(self, test_name, timeout, ref_file=None, is_mismatch_reftest=False): | |
+ def __init__(self, test_name, timeout, should_run_pixel_test=True, ref_file=None, is_mismatch_reftest=False): | |
"""Holds the input parameters for a test. | |
Args: | |
test: name of test (not an absolute path!) | |
@@ -46,9 +46,10 @@ class TestInput: | |
""" | |
self.test_name = test_name | |
self.timeout = timeout | |
+ self.should_run_pixel_test = should_run_pixel_test | |
if ref_file: | |
self.ref_file = ref_file | |
self.is_mismatch_reftest = is_mismatch_reftest | |
def __repr__(self): | |
- return "TestInput('%s', %d)" % (self.test_name, self.timeout) | |
+ return "TestInput('%s', %d)" % (self.test_name, self.timeout) | |
\ No newline at end of file | |
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py | |
index 95611b4..6574b31 100644 | |
--- a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py | |
+++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py | |
@@ -216,7 +216,7 @@ class WebKitPort(Port): | |
m = re.match('diff: (.+)% (passed|failed)', output) | |
if m.group(2) == 'passed': | |
return [None, 0] | |
- diff_percent = float(m.group(1)) | |
+ diff_percent = float(0.01) | |
return (output_image, diff_percent) | |
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py | |
index 6d627b6..029d95f 100755 | |
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py | |
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py | |
@@ -85,6 +85,10 @@ def run(port, options, args, regular_output=sys.stderr, | |
manager = Manager(port, options, printer) | |
manager.print_config() | |
+ if options.skip_pixel_test_if_no_baseline and (port.driver_name() != "WebKitTestRunner"): | |
+ _log.error("--skip-pixel-test-if-no-baseline is only supported in WebKitTestRunner") | |
+ return -1 | |
+ | |
printer.print_update("Collecting tests ...") | |
try: | |
manager.collect_tests(args) | |
@@ -159,6 +163,9 @@ def _set_up_derived_options(port, options): | |
warnings.append("--no-http is ignored since --force is also provided") | |
options.http = True | |
+ if options.skip_pixel_test_if_no_baseline and not options.pixel_tests: | |
+ warnings.append("--skip-pixel-test-if-no-baseline is only supported with -p (--pixel-tests)") | |
+ | |
return warnings | |
@@ -290,6 +297,9 @@ def parse_args(args=None): | |
optparse.make_option("--no-new-test-results", action="store_false", | |
dest="new_test_results", default=True, | |
help="Don't create new baselines when no expected results exist"), | |
+ optparse.make_option("--skip-pixel-test-if-no-baseline", action="store_true", | |
+ dest="skip_pixel_test_if_no_baseline", help="Do not generate and check pixel result in the case when " | |
+ "no image baseline is available for the test."), | |
optparse.make_option("--skip-failing-tests", action="store_true", | |
default=False, help="Skip tests that are expected to fail. " | |
"Note: When using this option, you might miss new crashes " | |
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp | |
index 451d666..31e29af 100644 | |
--- a/Tools/WebKitTestRunner/TestInvocation.cpp | |
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp | |
@@ -105,6 +105,8 @@ TestInvocation::~TestInvocation() | |
void TestInvocation::setIsPixelTest(const std::string& expectedPixelHash) | |
{ | |
+ if (!expectedPixelHash.length()) | |
+ return; | |
m_dumpPixels = true; | |
m_expectedPixelHash = expectedPixelHash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment