Skip to content

Instantly share code, notes, and snippets.

@Smith1123
Created November 9, 2011 10:35
Show Gist options
  • Save Smith1123/1351072 to your computer and use it in GitHub Desktop.
Save Smith1123/1351072 to your computer and use it in GitHub Desktop.
Patch
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 1767373..f932a2a 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
@@ -96,6 +97,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 4cfb7e7..3ecd4f6 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py
@@ -108,6 +108,10 @@ class Worker(manager_worker_broker.AbstractWorker):
start_time = time.time()
num_tests = 0
for test_input in 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'):
+ image = self._port.expected_image(test_input.test_name)
+ if image == None:
+ test_input.shoul_run_pixel_tests = 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 d5602d61..f17a201 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_input.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_input.py
@@ -32,7 +32,7 @@
class TestInput:
"""Groups information about a test for easy passing of data."""
- def __init__(self, test_name, timeout):
+ def __init__(self, test_name, timeout, should_run_pixel_test=True):
"""Holds the input parameters for a test.
Args:
test: name of test (not an absolute path!)
@@ -40,6 +40,7 @@ class TestInput:
"""
self.test_name = test_name
self.timeout = timeout
+ self.should_run_pixel_test = should_run_pixel_test
def __repr__(self):
return "TestInput('%s', %d)" % (self.test_name, self.timeout)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
index 3024881..c00f233 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