WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-91754-20120725205726.patch (text/plain), 25.10 KB, created by
Balazs Kelemen
on 2012-07-25 11:57:46 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Balazs Kelemen
Created:
2012-07-25 11:57:46 PDT
Size:
25.10 KB
patch
obsolete
>Subversion Revision: 123613 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1e4d175108aab6440a5ecf0f88cab39ecc60e9a5..b7f9db19f1c617a779bfd8c289169c0c194976e4 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,82 @@ >+2012-07-25 Balazs Kelemen <kbalazs@webkit.org> >+ >+ [NRWT] should have a way to restrict pixel tests for individual directories >+ https://bugs.webkit.org/show_bug.cgi?id=91754 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added --pixel-test-directories option to nrwt. If specified together >+ with --pixel-tests, and if the platform supports this option, only tests >+ from these directories will be executed as pixel tests. Furthermore, platforms >+ can have a default set of pixel test directories. To support the feature >+ the test harness have to be able to inform the driver whether to dump pixels >+ for each tests. For this purpose I changed WTR and the Qt DRT to handle a >+ --pixel-test argument from the standard output and made NRWT use this argument >+ with these drivers. >+ >+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp: >+ (WebCore::DumpRenderTree::DumpRenderTree): >+ (WebCore::DumpRenderTree::open): >+ (WebCore::DumpRenderTree::processLine): >+ (WebCore::DumpRenderTree::setDumpPixelsForAllTests): >+ (WebCore::DumpRenderTree::dump): >+ * DumpRenderTree/qt/DumpRenderTreeQt.h: >+ (DumpRenderTree): >+ * DumpRenderTree/qt/main.cpp: >+ (main): >+ Handle the --pixel-test argument. >+ >+ * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py: >+ (SingleTestRunner._should_fetch_expected_checksum): >+ (SingleTestRunner._overwrite_baselines): >+ (SingleTestRunner._compare_output): >+ * Scripts/webkitpy/layout_tests/controllers/worker.py: >+ (Worker._update_test_input): >+ * Scripts/webkitpy/layout_tests/port/base.py: >+ (Port.supports_switching_pixel_tests_per_test): Ports can override this to inform >+ the harness that --pixel-test argument is supported. True for WTR, otherwise calls >+ private version that can be overridden by the actual platform. Only true with WTR >+ and Qt DRT currently. This supposed to exist only temporary until there are ports >+ that doesn't support the feature in their DRT's. >+ (Port): >+ (Port._supports_switching_pixel_tests_per_test): >+ (Port.should_run_as_pixel_test): >+ (Port._allowed_to_run_as_pixel_test): Ports can override this to define their >+ default set of pixel tests directories. >+ * Scripts/webkitpy/layout_tests/port/driver.py: >+ (Driver.cmd_line): >+ (Driver._command_from_driver_input): Pass --pixel-test if it is supported and pixel >+ tests are enabled. >+ * Scripts/webkitpy/layout_tests/port/qt.py: >+ (QtPort.check_sys_deps): >+ (QtPort): >+ (QtPort._supports_switching_pixel_tests_per_test): >+ (QtPort._allowed_to_run_as_pixel_test): >+ (QtPort._default_pixel_test_directories): Only compositing will be our default pixel >+ test directory for the time being. >+ * Scripts/webkitpy/layout_tests/port/test.py: >+ (TestPort.supports_switching_pixel_tests_per_test): >+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: >+ (_set_up_derived_options): >+ (_listarg_callback): >+ (parse_args): >+ Handle the --pixel-test-directory option. It expect a directory below LayoutTests >+ and can be specified multiple times. Added fixme's that we should improve how we >+ handle these arguments. >+ >+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: >+ (MainTest.test_run_singly_actually_runs_tests): >+ (MainTest.test_pixel_test_directories): >+ Added an integration test for the feature. >+ >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::TestController): >+ (WTR::TestController::initialize): >+ (WTR::TestController::runTest): >+ * WebKitTestRunner/TestController.h: >+ (TestController): >+ Handle the --pixel-test argument. >+ > 2012-07-25 Gyuyoung Kim <gyuyoung.kim@samsung.com> > > [EFL] Use eina_stringshare_add instead of strdup. >diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp >index 12d659a5193e39709c194e5716e47866de0f0bb8..8212bf1e7c43512832394b561fe465594c881c80 100755 >--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp >+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp >@@ -388,7 +388,7 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent) > } > > DumpRenderTree::DumpRenderTree() >- : m_dumpPixels(false) >+ : m_dumpPixelsForAllTests(false) > , m_stdin(0) > , m_enableTextOutput(false) > , m_standAloneMode(false) >@@ -606,7 +606,7 @@ void DumpRenderTree::open(const QUrl& url) > > if (isDumpAsTextTest(url)) { > layoutTestController()->dumpAsText(); >- setDumpPixels(false); >+ setDumpPixelsForAllTests(false); > } > > if (isGlobalHistoryTest(url)) >@@ -692,14 +692,24 @@ void DumpRenderTree::processLine(const QString &input) > { > QString line = input; > >+ m_dumpPixelsForCurrentTest = false; > m_expectedHash = QString(); >- if (m_dumpPixels) { >- // single quote marks the pixel dump hash >- int i = line.indexOf('\''); >- if (i > -1) { >- m_expectedHash = line.mid(i + 1, line.length()); >- line.remove(i, line.length()); >+ // single quote marks the pixel dump hash >+ int indexOfFirstSeparator = line.indexOf('\''); >+ int indexOfSecondSeparator = line.indexOf('\'', indexOfFirstSeparator); >+ if (indexOfFirstSeparator > -1) { >+ int indexOfPixelHash = indexOfFirstSeparator + 1; >+ >+ // NRWT passes --pixel-test if we should dump pixels for the test. >+ const QString expectedArg(QLatin1String("--pixel-test")); >+ QString argTest = line.mid(indexOfFirstSeparator + 1, expectedArg.length()); >+ if (argTest == expectedArg) { >+ m_dumpPixelsForCurrentTest = true; >+ indexOfPixelHash = indexOfSecondSeparator == -1 ? -1 : indexOfSecondSeparator + 1; > } >+ if (indexOfPixelHash != -1 && indexOfPixelHash < line.size()) >+ m_expectedHash = line.mid(indexOfPixelHash); >+ line.remove(indexOfFirstSeparator, line.length()); > } > > if (line.startsWith(QLatin1String("http:")) >@@ -731,9 +741,9 @@ void DumpRenderTree::processLine(const QString &input) > fflush(stdout); > } > >-void DumpRenderTree::setDumpPixels(bool dump) >+void DumpRenderTree::setDumpPixelsForAllTests(bool dump) > { >- m_dumpPixels = dump; >+ m_dumpPixelsForAllTests = dump; > } > > void DumpRenderTree::closeRemainingWindows() >@@ -951,7 +961,7 @@ void DumpRenderTree::dump() > fputs("#EOF\n", stdout); > fputs("#EOF\n", stderr); > >- if (m_dumpPixels && !m_controller->shouldDumpAsText()) { >+ if ((m_dumpPixelsForAllTests || m_dumpPixelsForCurrentTest) && !m_controller->shouldDumpAsText()) { > QImage image; > if (!m_controller->isPrinting()) { > image = QImage(m_page->viewportSize(), QImage::Format_ARGB32); >diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h >index d3928bc99faf153d97872aea1e5fe1e1a37d8d39..c4f92983f915cca6a8898adefb562c8d2dd91da0 100644 >--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h >+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h >@@ -82,7 +82,7 @@ public: > void setGraphicsBased(bool flag) { m_graphicsBased = flag; } > bool isGraphicsBased() { return m_graphicsBased; } > >- void setDumpPixels(bool); >+ void setDumpPixelsForAllTests(bool); > > void closeRemainingWindows(); > void resetToConsistentStateBeforeTesting(const QUrl&); >@@ -142,7 +142,8 @@ private: > QString dumpFrameScrollPosition(QWebFrame* frame); > LayoutTestController *m_controller; > >- bool m_dumpPixels; >+ bool m_dumpPixelsForAllTests; >+ bool m_dumpPixelsForCurrentTest; > QString m_expectedHash; > QStringList m_standAloneModeTestList; > >diff --git a/Tools/DumpRenderTree/qt/main.cpp b/Tools/DumpRenderTree/qt/main.cpp >index 8188f1816ffaba050ffa94022263b4d971f21a1a..22fbc75c395a10f4024e1755005b2d3be3d67f92 100644 >--- a/Tools/DumpRenderTree/qt/main.cpp >+++ b/Tools/DumpRenderTree/qt/main.cpp >@@ -192,7 +192,7 @@ int main(int argc, char* argv[]) > > int index = args.indexOf(QLatin1String("--pixel-tests")); > if (index != -1) { >- dumper.setDumpPixels(true); >+ dumper.setDumpPixelsForAllTests(true); > args.removeAt(index); > } > >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 fa07e88ff559b427ac99148a748c6d31db467f9f..acd5677e9866302e4efe417ca1209ee36192d847 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py >+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py >@@ -78,10 +78,7 @@ class SingleTestRunner(object): > 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)) >+ return self._should_run_pixel_test and not (self._options.new_baseline or self._options.reset_results) > > def _driver_input(self): > # The image hash is used to avoid doing an image dump if the >@@ -153,7 +150,7 @@ class SingleTestRunner(object): > location = self.VERSION_DIR if self._options.add_platform_exceptions else self.UPDATE > self._save_baseline_data(driver_output.text, '.txt', location) > self._save_baseline_data(driver_output.audio, '.wav', location) >- if self._options.pixel_tests: >+ if self._should_run_pixel_test: > self._save_baseline_data(driver_output.image, '.png', location) > > def _save_baseline_data(self, data, extension, location): >@@ -222,7 +219,7 @@ class SingleTestRunner(object): > > failures.extend(self._compare_text(driver_output.text, expected_driver_output.text)) > failures.extend(self._compare_audio(driver_output.audio, expected_driver_output.audio)) >- if self._options.pixel_tests: >+ if self._should_run_pixel_test: > failures.extend(self._compare_image(driver_output, expected_driver_output)) > return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr()) > >diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py b/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py >index 378826c51f8e09df65a2800d75fc65e2ba1ae58b..b1583fff337f0677ac230bb8164213c63d047349 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py >+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py >@@ -88,13 +88,8 @@ class Worker(object): > test_input.reference_files = self._port.reference_files(test_input.test_name) > if test_input.reference_files: > test_input.should_run_pixel_test = True >- elif self._options.pixel_tests: >- if self._options.skip_pixel_test_if_no_baseline: >- test_input.should_run_pixel_test = bool(self._port.expected_image(test_input.test_name)) >- else: >- test_input.should_run_pixel_test = True > else: >- test_input.should_run_pixel_test = False >+ test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input) > > def _run_test(self, test_input): > self._update_test_input(test_input) >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py >index e01e2b5aa0be0411d71fc957330c615ce8d496d8..e886e06a2cef395b460a088c29eabf3d637593b8 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py >@@ -1252,6 +1252,33 @@ class Port(object): > return suite.args > return [] > >+ def supports_switching_pixel_tests_per_test(self): >+ if self.get_option('webkit_test_runner'): >+ return True >+ return self._supports_switching_pixel_tests_per_test() >+ >+ def _supports_switching_pixel_tests_per_test(self): >+ # FIXME: all ports should support it. >+ return False >+ >+ def should_run_as_pixel_test(self, test_input): >+ if not self._options.pixel_tests: >+ return False >+ if not self.supports_switching_pixel_tests_per_test(): >+ # Cannot do more filtering without this. >+ return True >+ if self._options.skip_pixel_test_if_no_baseline and not self.expected_image(test_input.test_name): >+ return False >+ if self._options.pixel_test_directories: >+ return any(test_input.test_name.startswith(directory) for directory in self._options.pixel_test_directories) >+ return self._allowed_to_run_as_pixel_test(test_input) >+ >+ def _allowed_to_run_as_pixel_test(self, test_input): >+ # Default behavior is to allow all test to run as pixel tests if --pixel-tests is on and >+ # --pixel-test-directoy is not specified. Ports can override this according to their default >+ # set of pixel tests. >+ return True >+ > > class VirtualTestSuite(object): > def __init__(self, name, base, args, tests=None): >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver.py b/Tools/Scripts/webkitpy/layout_tests/port/driver.py >index 5e7061bab976ca5df88d527d4a6b8d622e231558..ffc1c1945d689ccdb20b49efe78c01c09120d338 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/driver.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/driver.py >@@ -298,7 +298,7 @@ class Driver(object): > > cmd.extend(self._port.get_option('additional_drt_flag', [])) > >- if pixel_tests: >+ if pixel_tests and not self._port.supports_switching_pixel_tests_per_test(): > cmd.append('--pixel-tests') > cmd.extend(per_test_args) > >@@ -338,8 +338,14 @@ class Driver(object): > if sys.platform == 'cygwin': > command = path.cygpath(command) > >+ assert not driver_input.image_hash or driver_input.should_run_pixel_test >+ >+ if driver_input.should_run_pixel_test: >+ if self._port.supports_switching_pixel_tests_per_test(): >+ # We did not start the driver with --pixel-tests, instead we specify it per test. >+ # "'" is the separator of command fields. >+ command += "'" + '--pixel-test' > if driver_input.image_hash: >- # "'" is the separator of command fields. > command += "'" + driver_input.image_hash > return command + "\n" > >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt.py b/Tools/Scripts/webkitpy/layout_tests/port/qt.py >index aaaafac5d364ccae47e9113e3855ad61f1a5c38d..0cb84bec84db9ef62e9a24ff9f9b77abf242a991 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/qt.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/qt.py >@@ -185,3 +185,14 @@ class QtPort(WebKitPort): > _log.error('Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts') > return False > return result >+ >+ def _supports_switching_pixel_tests_per_test(self): >+ return True >+ >+ def _allowed_to_run_as_pixel_test(self, test_input): >+ return any(test_input.test_name.startswith(directory) >+ for directory in QtPort._default_pixel_test_directories()) >+ >+ @staticmethod >+ def _default_pixel_test_directories(): >+ return ['compositing'] >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py >index 9cf98de74885986ef1184365cc0ebfdf27861b1d..3932452dae2579adafdadf3148aa33f22c4e49c8 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py >@@ -227,6 +227,14 @@ layer at (0,0) size 800x34 > tests.add('perf/foo/test.html') > tests.add('perf/foo/test-ref.html') > >+ # For testing --pixel-test-directories. >+ tests.add('failures/unexpected/pixeldir/image_in_pixeldir.html', >+ actual_image='image_in_pixeldir-pngtEXtchecksum\x00checksum_fail', >+ expected_image='image_in_pixeldir-pngtEXtchecksum\x00checksum-png') >+ tests.add('failures/unexpected/image_not_in_pixeldir.html', >+ actual_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum_fail', >+ expected_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum-png') >+ > return tests > > >@@ -505,6 +513,12 @@ class TestPort(Port): > VirtualTestSuite('virtual/skipped', 'failures/expected', ['--virtual-arg2']), > ] > >+ def supports_switching_pixel_tests_per_test(self): >+ # Let it true so we can test the --pixel-test-directory option. >+ # It should be supported by all platform in the near future anyway. >+ return True >+ >+ > class TestDriver(Driver): > """Test/Dummy implementation of the DumpRenderTree interface.""" > >diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py >index d4d0edb2b04c792bcca4ea9f62c5e9d929137349..503b6a1f758cd511e3f9ff90ed0878cd7dfcd3b5 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py >+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py >@@ -185,6 +185,25 @@ def _set_up_derived_options(port, options): > options.reset_results = True > options.add_platform_exceptions = True > >+ if options.pixel_test_directories: >+ if not options.pixel_tests: >+ warnings.append("--pixel-test-directories has no effect without --pixel-tests") >+ options.pixel_test_directories = [] >+ else: >+ sanitized = set() >+ pixel_test_directories = options.pixel_test_directories >+ for directory in pixel_test_directories: >+ # FIXME: we should support specifying the directories all the ways we support it for additional >+ # arguments specifying which tests and directories to run. We should also move the logic for that >+ # to Port. >+ filesystem = port.host.filesystem >+ if not filesystem.isdir(filesystem.join(port.layout_tests_dir(), directory)): >+ warnings.append("--pixel-test-directories a directory but got: %s" % str(directory)) >+ else: >+ sanitized.add(directory) >+ >+ options.pixel_test_directories = list(sanitized) >+ > return warnings > > >@@ -312,6 +331,17 @@ def parse_args(args=None): > 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."), >+ >+ #FIXME: we should support a comma separated list with --pixel-test-directory as well. >+ optparse.make_option("--pixel-test-directory", action="append", default=[], dest="pixel_test_directories", >+ help="A directory where it is allowed to execute tests as pixel tests. " >+ "Specify multiple times to add multiple directories. " >+ "This option is supposed to be used togather with --pixel-tests. " >+ "If specified, only those tests will be executed as pixel tests " >+ "that are located in one of the directories enumerated with the option. " >+ "Some ports may ignore this option while others can have a default " >+ "value that can be overridden here."), >+ > 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/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py >index ad14bf4efec47ba952c9913843fc3b90aa666402..33bcd5c26566463e9a5c7648c41d91dd4ecdd81d 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py >+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py >@@ -179,7 +179,7 @@ def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False, > > # Update this magic number if you add an unexpected test to webkitpy.layout_tests.port.test > # FIXME: It's nice to have a routine in port/test.py that returns this number. >-unexpected_tests_count = 12 >+unexpected_tests_count = 14 > > > class StreamTestingMixin(object): >@@ -501,7 +501,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin): > > def test_run_singly_actually_runs_tests(self): > res, _, _, _ = logging_run(['--run-singly', 'failures/unexpected']) >- self.assertEquals(res, 8) >+ self.assertEquals(res, 10) > > def test_single_file(self): > # FIXME: We should consider replacing more of the get_tests_run()-style tests >@@ -573,6 +573,20 @@ class MainTest(unittest.TestCase, StreamTestingMixin): > self.assertTrue(json_string.find('"num_flaky":0') != -1) > self.assertTrue(json_string.find('"num_missing":1') != -1) > >+ def test_pixel_test_directories(self): >+ host = MockHost() >+ >+ """Both tests have faling checksum. We include only the first in pixel tests so only that should fail.""" >+ args = ['--pixel-tests', '--pixel-test-directory', 'failures/unexpected/pixeldir', >+ 'failures/unexpected/pixeldir/image_in_pixeldir.html', >+ 'failures/unexpected/image_not_in_pixeldir.html'] >+ res, out, err, _ = logging_run(extra_args=args, host=host, record_results=True, tests_included=True) >+ >+ self.assertEquals(res, 1) >+ expected_token = '"unexpected":{"pixeldir":{"image_in_pixeldir.html":{"expected":"PASS","actual":"IMAGE"' >+ json_string = host.filesystem.read_text_file('/tmp/layout-test-results/full_results.json') >+ self.assertTrue(json_string.find(expected_token) != -1) >+ > def test_missing_and_unexpected_results_with_custom_exit_code(self): > # Test that we update expectations in place. If the expectation > # is missing, update the expected generic location. >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 8c2250831ad9a20c4476ed3c95177ca1b58b1cc4..9200d2c0345ca3a330b5fb23913b71d43b43b534 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -67,7 +67,7 @@ TestController& TestController::shared() > } > > TestController::TestController(int argc, const char* argv[]) >- : m_dumpPixels(false) >+ : m_dumpPixelsForAllTests(false) > , m_verbose(false) > , m_printSeparators(false) > , m_usingServerMode(false) >@@ -268,7 +268,7 @@ void TestController::initialize(int argc, const char* argv[]) > } > > if (argument == "--pixel-tests") { >- m_dumpPixels = true; >+ m_dumpPixelsForAllTests = true; > continue; > } > if (argument == "--verbose") { >@@ -517,18 +517,31 @@ bool TestController::runTest(const char* test) > return false; > } > >- std::string pathOrURL(test); >+ bool dumpPixelsTest = m_dumpPixelsForAllTests; >+ std::string command(test); >+ std::string pathOrURL = command; > std::string expectedPixelHash; >- size_t separatorPos = pathOrURL.find("'"); >- if (separatorPos != std::string::npos) { >- pathOrURL = std::string(std::string(test), 0, separatorPos); >- expectedPixelHash = std::string(std::string(test), separatorPos + 1); >+ size_t firstSeparatorPos = command.find_first_of('\''); >+ size_t secondSeparatorPos = command.find_first_of('\'', firstSeparatorPos + 1); >+ if (firstSeparatorPos != std::string::npos) { >+ pathOrURL = std::string(command, 0, firstSeparatorPos); >+ size_t pixelHashPos = firstSeparatorPos + 1; >+ >+ // NRWT passes --pixel-test if we should dump pixels for the test. >+ const std::string expectedPixelTestArg("--pixel-test"); >+ std::string argTest = std::string(command, firstSeparatorPos + 1, expectedPixelTestArg.size()); >+ if (argTest == expectedPixelTestArg) { >+ dumpPixelsTest = true; >+ pixelHashPos = secondSeparatorPos == std::string::npos ? -1 : secondSeparatorPos + 1; >+ } >+ if (pixelHashPos != -1 && pixelHashPos < command.size()) >+ expectedPixelHash = std::string(command, pixelHashPos); > } > > m_state = RunningTest; > > m_currentInvocation = adoptPtr(new TestInvocation(pathOrURL)); >- if (m_dumpPixels) >+ if (dumpPixelsTest) > m_currentInvocation->setIsPixelTest(expectedPixelHash); > > m_currentInvocation->invoke(); >diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h >index 20188ad555d4b7e91f94d833fffd53b7f1096227..a99e16ea87027c34f07b8962b098c2334d9421bd 100644 >--- a/Tools/WebKitTestRunner/TestController.h >+++ b/Tools/WebKitTestRunner/TestController.h >@@ -104,7 +104,7 @@ private: > > OwnPtr<TestInvocation> m_currentInvocation; > >- bool m_dumpPixels; >+ bool m_dumpPixelsForAllTests; > bool m_verbose; > bool m_printSeparators; > bool m_usingServerMode;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 91754
:
153526
|
153534
|
154015
|
154101
|
154412
|
154915