diff options
Diffstat (limited to 'Tools')
211 files changed, 7557 insertions, 2195 deletions
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg index 72e7deaeb..ae4df92f1 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg @@ -174,6 +174,12 @@ class CleanupChromiumCrashLogs(shell.ShellCommand): command = ["python", "./Tools/BuildSlaveSupport/chromium/remove-crash-logs"] haltOnFailure = False +class OutputAndroidDeviceStatus(shell.ShellCommand): + name = "android device status" + description = ["outputting android device status"] + descriptionDone = ["outputted android device status"] + command = ["python", "./Tools/BuildSlaveSupport/chromium/output-android-device-status"] + haltOnFailure = False def appendCustomBuildFlags(step, platform, fullPlatform=""): if fullPlatform == "chromium-android": @@ -753,6 +759,8 @@ class TestFactory(Factory): Factory.__init__(self, platform, configuration, architectures, False, SVNMirror) if platform.startswith("chromium"): self.addStep(CleanupChromiumCrashLogs()) + if platform == "chromium-android": + self.addStep(OutputAndroidDeviceStatus()) self.addStep(DownloadBuiltProduct()) self.addStep(ExtractBuiltProduct()) if not platform.startswith("chromium"): diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html index 904e5edd0..19e156bda 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html @@ -32,9 +32,9 @@ James, a web developer from Birmingham, UK. script-src 'self' file: https://ajax.googleapis.com; style-src 'self' 'unsafe-inline' file: https://ajax.googleapis.com http://fonts.googleapis.com; font-src http://themes.googleusercontent.com; - img-src 'self' https://ajax.googleapis.com http://build.chromium.org http://build.webkit.org file:; - media-src http://build.chromium.org http://build.webkit.org; - frame-src http://build.chromium.org http://build.webkit.org http://test-results.appspot.com; + img-src 'self' https://ajax.googleapis.com http://build.chromium.org http://build.webkit.org file: http://127.0.0.1:8127; + media-src http://build.chromium.org http://build.webkit.org http://127.0.0.1:8127; + frame-src http://build.chromium.org http://build.webkit.org http://test-results.appspot.com http://127.0.0.1:8127; connect-src http://trac.webkit.org http://build.chromium.org http://build.webkit.org http://127.0.0.1:8127"> <title>Garden-O-Matic</title> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700"> @@ -50,8 +50,8 @@ James, a web developer from Birmingham, UK. <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script> -<script src="scripts/config.js"></script> <script src="scripts/base.js"></script> +<script src="scripts/config.js"></script> <script src="scripts/net.js"></script> <script src="scripts/Trac.js"></script> <script src="scripts/Bugzilla.js"></script> diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html index ce2e6cd9d..2ce6e71d3 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html @@ -39,8 +39,8 @@ THE POSSIBILITY OF SUCH DAMAGE. <link rel="stylesheet" href="styles/results.css"> -<script src="scripts/config.js"></script> <script src="scripts/base.js"></script> +<script src="scripts/config.js"></script> <script src="scripts/base_unittests.js"></script> <script src="scripts/net.js"></script> <script src="scripts/net_unittests.js"></script> diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js index b65895afa..7f5b36c21 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/builders.js @@ -97,7 +97,7 @@ function fetchMostRecentBuildInfoByBuilder(platform, callback) var builderNames = Object.keys(builderStatus); var requestTracker = new base.RequestTracker(builderNames.length, callback, [buildInfoByBuilder]); builderNames.forEach(function(builderName) { - if (!config.kPlatforms[config.currentPlatform].builderApplies(builderName)) { + if (!config.builderApplies(builderName)) { requestTracker.requestComplete(); return; } diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js index 92fa03a00..8daa4255e 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js @@ -52,7 +52,7 @@ config.kPlatforms = { resultsDirectoryForBuildNumber: function(buildNumber, revision) { return encodeURIComponent('r' + revision + ' (' + buildNumber + ')'); }, - builderApplies: function(builderName) { + _builderApplies: function(builderName) { return builderName.indexOf('Apple') != -1; }, }, @@ -84,7 +84,7 @@ config.kPlatforms = { resultsDirectoryForBuildNumber: function(buildNumber, revision) { return buildNumber; }, - builderApplies: function(builderName) { + _builderApplies: function(builderName) { // FIXME: Should garden-o-matic show these? I can imagine showing the deps bots being useful at least so // that the gardener only need to look at garden-o-matic and never at the waterfall. Not really sure who // watches the GPU bots. @@ -115,7 +115,7 @@ config.kPlatforms = { resultsDirectoryForBuildNumber: function(buildNumber, revision) { return encodeURIComponent('r' + revision + ' (' + buildNumber + ')'); }, - builderApplies: function(builderName) { + _builderApplies: function(builderName) { return builderName.indexOf('GTK') != -1; }, }, @@ -136,7 +136,7 @@ config.kPlatforms = { resultsDirectoryForBuildNumber: function(buildNumber, revision) { return encodeURIComponent('r' + revision + ' (' + buildNumber + ')'); }, - builderApplies: function(builderName) { + _builderApplies: function(builderName) { return builderName.indexOf('Qt') != -1; }, }, @@ -159,10 +159,29 @@ config.kRelativeTimeUpdateFrequency = 1000 * 60; config.kExperimentalFeatures = window.location.search.search('enableExperiments=1') != -1; -config.currentPlatform = 'chromium'; +config.currentPlatform = base.getURLParameter('platform') || 'chromium'; -config.setPlatform = function(platform) -{ +// FIXME: We should add a way to restrict the results to a subset of the builders +// (or maybe just a single builder) in the UI as well as via an URL parameter. +config.currentBuilder = base.getURLParameter('builder'); + +config.currentBuilders = function() { + var current_builders = {}; + if (config.currentBuilder) { + current_builders[config.currentBuilder] = config.kPlatforms[config.currentPlatform].builders[config.currentBuilder]; + return current_builders; + } else { + return config.kPlatforms[config.currentPlatform].builders; + } +}; + +config.builderApplies = function(builderName) { + if (config.currentBuilder) + return builderName == config.currentBuilder; + return config.kPlatforms[config.currentPlatform]._builderApplies(builderName); +}; + +config.setPlatform = function(platform) { if (!this.kPlatforms[platform]) { window.console.log(platform + ' is not a recognized platform'); return; @@ -170,4 +189,6 @@ config.setPlatform = function(platform) config.currentPlatform = platform; }; +config.useLocalResults = Boolean(base.getURLParameter('useLocalResults')) || false; + })(); diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js index ac2d9d1a6..ebd4d5d32 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js @@ -77,6 +77,11 @@ function update() updatePartyTime(); g_unexpectedFailuresController.purge(); + Object.keys(config.currentBuilders()).forEach(function(builderName) { + if (!model.state.resultsByBuilder[builderName]) + g_info.add(new ui.notifications.Info('Could not find test results for ' + builderName + ' in the last ' + config.kBuildNumberLimit + ' runs.')); + }); + updating.dismiss(); g_revisionHint = new ui.notifications.Info(''); diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js index 476e94e1d..3c3f85243 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/model.js @@ -158,7 +158,7 @@ model.latestRevisionWithNoBuildersInFlight = function() model.updateResultsByBuilder = function(callback) { - var platformBuilders = config.kPlatforms[config.currentPlatform].builders; + var platformBuilders = config.currentBuilders(); results.fetchResultsByBuilder(Object.keys(platformBuilders), function(resultsByBuilder) { model.state.resultsByBuilder = resultsByBuilder; callback(); diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js index a7af2e084..012df032a 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js @@ -27,7 +27,6 @@ var results = results || {}; (function() { -var kLayoutTestResultsPath = '/results/layout-test-results/'; var kResultsName = 'full_results.json'; var kBuildLinkRegexp = /a href="\d+\/"/g; @@ -188,7 +187,9 @@ results.directoryForBuilder = function(builderName) function resultsDirectoryURL(platform, builderName) { - return layoutTestResultsURL(platform) + '/' + results.directoryForBuilder(builderName) + kLayoutTestResultsPath; + if (config.useLocalResults) + return config.kLocalServerURL + '/localresult?path='; + return resultsDirectoryListingURL(platform, builderName) + 'results/layout-test-results/'; } function resultsDirectoryListingURL(platform, builderName) @@ -626,6 +627,11 @@ results.fetchResultsForMostRecentCompletedBuildOnBuilder = function(builderName, var resultsCallback = function(buildResults) { if ($.isEmptyObject(buildResults)) { ++currentIndex; + if (currentIndex >= buildLocations.length) { + callback(null); + return; + } + net.jsonp(buildLocations[currentIndex].url, resultsCallback); return; } @@ -658,7 +664,8 @@ results.fetchResultsByBuilder = function(builderNameList, callback) // FIXME: use RequestTracker ++requestsInFlight; results.fetchResultsForMostRecentCompletedBuildOnBuilder(builderName, function(resultsTree) { - resultsByBuilder[builderName] = resultsTree; + if (resultsTree) + resultsByBuilder[builderName] = resultsTree; --requestsInFlight; if (!requestsInFlight) callback(resultsByBuilder); diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results_unittests.js index 3f23bc349..e15e73982 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results_unittests.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results_unittests.js @@ -533,4 +533,76 @@ test("fetchResultsURLs", 5, function() { ]); }); +test("fetchResultsByBuilder", 5, function() { + var simulator = new NetworkSimulator(); + + var probedURLs = []; + simulator.jsonp = function(url, callback) + { + simulator.scheduleCallback(function() { + probedURLs.push(url); + if (base.endsWith(url, 'MockBuilder2/r1%20(1)/full_results.json')) + callback({'MockBuildResults': true}); + else + callback({}); + }); + }; + + config.currentPlatform = 'gtk'; + + var oldCachedBuildInfos = builders.cachedBuildInfos; + builders.cachedBuildInfos = function(platform, builderName, callback) { + callback( + { + 1: { + sourceStamp: { + revision: 1 + } + }, + 2: { + sourceStamp: { + revision: 2 + } + } + + }); + }; + + var oldRecentBuildInfos = builders.recentBuildInfos; + builders.recentBuildInfos = function(callback) { + callback({ + 'MockBuilder1': true, + 'MockBuilder2': true + }); + }; + + simulator.runTest(function() { + results.fetchResultsByBuilder(['MockBuilder1', 'MockBuilder2'], function(resultsByBuilder) { + deepEqual(resultsByBuilder, { + "MockBuilder2": { + "MockBuildResults": true, + "_buildLocation": { + "buildNumber": "1", + "revision": 1, + "url": "http://build.webkit.org/results/MockBuilder2/r1%20(1)/full_results.json" + } + } + }); + }); + }); + + deepEqual(probedURLs, [ + "http://build.webkit.org/results/MockBuilder1/r2%20(2)/full_results.json", + "http://build.webkit.org/results/MockBuilder2/r2%20(2)/full_results.json", + "http://build.webkit.org/results/MockBuilder1/r1%20(1)/full_results.json", + "http://build.webkit.org/results/MockBuilder2/r1%20(1)/full_results.json" + ]); + + builders.cachedBuildInfos = oldCachedBuildInfos; + equal(builders.cachedBuildInfos, oldCachedBuildInfos, "Failed to restore real base!"); + + builders.recentBuildInfos = oldRecentBuildInfos; + equal(builders.recentBuildInfos, oldRecentBuildInfos, "Failed to restore real base!"); +}); + })(); diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/summary-mock.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/summary-mock.js index 5e732cf25..eb3c2a2a1 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/summary-mock.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/summary-mock.js @@ -96,7 +96,7 @@ var testNames = new Cycler([ 'tables/mozilla/bugs/bug52505.html' ]); -var builders = new Cycler(Object.keys(config.kPlatforms[config.currentPlatform].builders), 3); +var builders = new Cycler(Object.keys(config.currentBuilders()), 3); var expectations = new Cycler([ 'TEXT', diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js index 77ecda3c2..b4948b28c 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/failures.js @@ -33,7 +33,7 @@ var kBuildingResult = 'BUILDING'; ui.failures.Builder = base.extends('a', { init: function(builderName, failures) { - var platformBuilders = config.kPlatforms[config.currentPlatform].builders; + var platformBuilders = config.currentBuilders(); var configuration = platformBuilders[builderName]; if (configuration) { if (configuration.version) diff --git a/Tools/BuildSlaveSupport/chromium/output-android-device-status b/Tools/BuildSlaveSupport/chromium/output-android-device-status new file mode 100755 index 000000000..d716c026b --- /dev/null +++ b/Tools/BuildSlaveSupport/chromium/output-android-device-status @@ -0,0 +1,81 @@ +#!/usr/bin/env python +# Copyright (C) 2012 Google Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import re +import subprocess +import sys + +def GetAttachedDevices(): + re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE) + process = subprocess.Popen(['adb', 'devices'], stdout=subprocess.PIPE) + return re_device.findall(process.communicate()[0]) + + +class AndroidDeviceStatus(object): + def __init__(self, device_serial): + self._device_serial = device_serial + + def _run_adb_command(self, command): + full_command = ['adb', '-s', self._device_serial] + command + stdout, _ = subprocess.Popen(full_command, stdout=subprocess.PIPE).communicate() + return stdout.strip() + + def device_type(self): + return self._run_adb_command(['shell', 'getprop', 'ro.build.product']) + + def device_build(self): + return self._run_adb_command(['shell', 'getprop', 'ro.build.id']) + + def device_fingerprint(self): + return self._run_adb_command(['shell', 'getprop', 'ro.build.fingerprint']) + + def battery_level(self): + return self._run_adb_command(['shell', 'cat', '/sys/class/power_supply/battery/capacity']) + + def battery_temperature(self): + temperature = self._run_adb_command(['shell', 'dumpsys', 'battery']) + re_temperature = re.compile('temperature:\s+(\d+)') + return re_temperature.findall(temperature)[0] + + def username(self): + username = self._run_adb_command(['shell', 'id']) + re_username = re.compile('uid=\d+\((.+?)\)') + return re_username.findall(username)[0] + + +def main(): + devices = GetAttachedDevices() + for device_serial in devices: + device_status = AndroidDeviceStatus(device_serial) + + print 'Device %s (%s)' % (device_serial, device_status.device_type()) + print ' Build: %s (%s)' % (device_status.device_build(), device_status.device_fingerprint()) + print ' Battery: %s%%' % device_status.battery_level() + print ' Battery temp: %s' % device_status.battery_temperature() + print ' Username: %s' % device_status.username() + print '' + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index ac5353b60..f77335d83 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,20 @@ +2012-11-07 Christophe Dumez <christophe.dumez@intel.com> + + Add replaceWithLiteral() method to WTF::String + https://bugs.webkit.org/show_bug.cgi?id=101257 + + Reviewed by Benjamin Poulain. + + Add API tests for String::replaceWithLiteral() and corresponding + StringImpl methods. + + * TestWebKitAPI/CMakeLists.txt: Add WTFString API tests to CMake. + * TestWebKitAPI/Tests/WTF/StringImpl.cpp: + (TestWebKitAPI::TEST): + (TestWebKitAPI): + * TestWebKitAPI/Tests/WTF/WTFString.cpp: + (TestWebKitAPI::TEST): + 2012-11-07 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> [Qt] Fix build of modules depending on QtWebKit when using prefix @@ -9,18 +26,3280 @@ * qmake/mkspecs/features/default_pre.prf: -2012-10-25 Simon Hausmann <simon.hausmann@digia.com> +2012-11-06 Dan Beam <dbeam@chromium.org> + + Enable REQUEST_AUTOCOMPLETE for chromium port + https://bugs.webkit.org/show_bug.cgi?id=101376 + + Reviewed by Adam Barth. + + This patch enables the feature flag REQUEST_AUTOCOMPLETE in WebKit/chromium only to allow web authors to start to use + HTMLFormElement#requestAutocomplete as the chrome-side work progresses further. + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::TestShell): + + Enables the requestAutocomplete runtime feature flag during tests. + +2012-11-06 KyungTae Kim <ktf.kim@samsung.com> + + [WK2][EFL] Add shortcut for setting a pagination mode on Minibrowser + https://bugs.webkit.org/show_bug.cgi?id=100301 + + Reviewed by Gyuyoung Kim. + + Setting pagination modes is for a paginated view - left to right / right to left / top to bottom / bottom to top. + Assign a shortcut "F7" to set pagination modes for tests. + + * MiniBrowser/efl/main.c: + (on_key_down): + +2012-11-06 KyungTae Kim <ktf.kim@samsung.com> + + [EFL][EWebLauncher] Use Ctrl +/- to zoom in EWebLauncher + https://bugs.webkit.org/show_bug.cgi?id=100207 + + Reviewed by Gyuyoung Kim. + + Use "Ctrl -" instead of "F7" to zoom out, and use "Ctrl +" instead of "F8" to zoom in, + and use "Ctrl 0" to set to default zoom level. + They are more common shortcuts on usual browsers. + + * EWebLauncher/main.c: + (on_key_down): + +2012-11-06 Oliver Hunt <oliver@apple.com> + + Don't warn about RefPtr* parameters + https://bugs.webkit.org/show_bug.cgi?id=101403 + + Reviewed by Gavin Barraclough. + + RefPtr<>* is a valid parameter type. + + * Scripts/webkitpy/style/checkers/cpp.py: + (check_function_definition_and_pass_ptr): + * Scripts/webkitpy/style/checkers/cpp_unittest.py: + (PassPtrTest.test_ref_ptr_parameter_value): + +2012-11-06 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> + + [WTR] Reset EventSender before running each test. + https://bugs.webkit.org/show_bug.cgi?id=101353 + + Reviewed by Simon Fraser. + + Contrary to what was done to at least some ports in DumpRenderTree, + EventSender did not currently reset its values in WTR. This caused + flakiness if a test such as editing/selection/fake-doubleclick.html was + run twice in a row, since the click count was not reset across each + run. + + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::TestController): Do not create m_eventSenderProxy + in the constructor anymore, it is created in + resetStateToConsistentValues now. + (WTR::TestController::resetStateToConsistentValues): Recreate + m_eventSenderProxy every time this method is run. + * WebKitTestRunner/TestController.h: Make m_eventSenderProxy an OwnPtr + and guard it with a platform #ifdef. + * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: + (WTR::EventSenderProxy::~EventSenderProxy): Add an empty + implementation. + * WebKitTestRunner/mac/EventSenderProxy.mm: + (WTR::EventSenderProxy::~EventSenderProxy): Ditto. + * WebKitTestRunner/qt/EventSenderProxyQt.cpp: + (WTR::EventSenderProxy::~EventSenderProxy): Ditto. + +2012-11-06 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [EFL][WK2] Refactor Ewk_Auth_Request, Ewk_Url_Scheme_Request and Ewk_Download_Job to be Ewk_Objects + https://bugs.webkit.org/show_bug.cgi?id=101383 + + Reviewed by Kenneth Rohde Christiansen. + + Ewk_Auth_Request, Ewk_Url_Scheme_Request and Ewk_Download_Job are Ewk_Objects now. + + * MiniBrowser/efl/main.c: + (auth_popup_close): + (on_authentication_request): + +2012-11-06 Tommy Widenflycht <tommyw@google.com> + + [chromium] MediaStream API: Remove the valgrind issue with MockWebRTCPeerConnectionHandler + https://bugs.webkit.org/show_bug.cgi?id=101336 + + Reviewed by Andreas Kling. + + This patch changes the delete to delete [] to match the new[]. + + * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp: + +2012-11-06 Mihai Balan <mibalan@adobe.com> + + Add Adobe's bug tracker to committers.py + https://bugs.webkit.org/show_bug.cgi?id=101338 + + Reviewed by Kentaro Hara. + + Adding Adobe's bug tracker mailing list to committers.py + to enable its inclusion in the autocomplete list. + + * Scripts/webkitpy/common/config/committers.py: + +2012-11-06 Sami Kyostila <skyostil@chromium.org> + + [chromium] Enable fixed position compositing on Android DRT + https://bugs.webkit.org/show_bug.cgi?id=100263 + + Reviewed by James Robinson. + + Chrome on Android forces composited mode for every page and creates + stacking contexts and graphics layers for fixed positioned elements. + Change the DumpRenderTree settings to match this. + + * DumpRenderTree/chromium/DumpRenderTree.cpp: + (main): + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::TestShell): + (TestShell::resetWebSettings): + * DumpRenderTree/chromium/TestShell.h: + (TestShell::setAcceleratedCompositingForFixedPositionEnabled): + (TestShell): + * DumpRenderTree/chromium/WebPreferences.cpp: + (WebPreferences::reset): + (WebPreferences::applyTo): + * DumpRenderTree/chromium/WebPreferences.h: + (WebPreferences): + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidPort.additional_drt_flag): + +2012-11-06 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> + + [EFL][WTR] EventSender: Get rid of the WTRMouseButton enum. + https://bugs.webkit.org/show_bug.cgi?id=101340 + + Reviewed by Kenneth Rohde Christiansen. + + Get rid of an enum which was basically a duplicate of the + WKEventMouseButton one in the shared API. + + The only difference is that it also had a case for a 4th mouse + button that we treat in a special way in evasMouseButton() now. + + * WebKitTestRunner/EventSenderProxy.h: + (EventSenderProxy): + * WebKitTestRunner/efl/EventSenderProxyEfl.cpp: + (WTR::evasMouseButton): + (WTR::EventSenderProxy::EventSenderProxy): + (WTR::EventSenderProxy::mouseUp): + (WTR::EventSenderProxy::mouseMoveTo): + (WTR::EventSenderProxy::mouseScrollBy): + (WTR::EventSenderProxy::leapForward): + +2012-11-06 Jussi Kukkonen <jussi.kukkonen@intel.com> + + [EFL][WK2] Minibrowser forgets http variables when url includes ampersand + https://bugs.webkit.org/show_bug.cgi?id=101061 + + Reviewed by Kenneth Rohde Christiansen. + + Elementary entry only returns 'markup' text, meaning ampersands + in a url will become "&". Use elm_entry_markup_to_utf8() and + elm_entry_utf8_to_markup() when interacting with the entry. + + * MiniBrowser/efl/main.c: + (on_url_changed): + (on_url_bar_activated): + +2012-11-06 Balazs Kelemen <kbalazs@webkit.org> + + DumpRenderTree should have --pixel-tests option again + https://bugs.webkit.org/show_bug.cgi?id=98648 + + Reviewed by Dirk Pranke. + + Add back the --pixel-tests command line option to DumpRenderTree. + It was removed r124581 because tools don't use it after that patch. + However, it turned out that it is useful for debugging and working + with pixel tests. + + * DumpRenderTree/efl/DumpRenderTree.cpp: + (parseCommandLineOptions): + (runTest): + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (initializeGlobalsFromCommandLineOptions): + (runTest): + * DumpRenderTree/mac/DumpRenderTree.mm: + (initializeGlobalsFromCommandLineOptions): + (runTest): + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (isOption): + (printUsage): + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::processLine): + * DumpRenderTree/qt/DumpRenderTreeQt.h: + (WebCore::DumpRenderTree::setShouldDumpPixelsForAllTests): + (DumpRenderTree): + * DumpRenderTree/win/DumpRenderTree.cpp: + (runTest): + (dllLauncherEntryPoint): + * DumpRenderTree/wx/DumpRenderTreeWx.cpp: + (runTest): + (MyApp::OnInit): + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::TestController): + (WTR::TestController::initialize): + (WTR::TestController::runTest): + * WebKitTestRunner/TestController.h: + (TestController): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkit-patch rebaseline*: fix typo for --results-directory + https://bugs.webkit.org/show_bug.cgi?id=101295 + + Reviewed by Ojan Vafai. + + Had --results_directory instead of --results-directory in both the + code and the unit test. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractParallelRebaselineCommand._rebaseline_commands): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestRebaselineJson.test_results_directory): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkit-patch rebaseline*: fix handling of local file urls + https://bugs.webkit.org/show_bug.cgi?id=101296 + + Reviewed by Ojan Vafai. + + When using --results-directory, we need to make sure we're converting + paths to file:/// urls for urllib to work correctly. Also, this + patch reworks the unit tests to get better coverage (of the execute() + command) and reduce copy/pasting of mock options. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (RebaselineTest._rebaseline_test_and_update_expectations): + (RebaselineTest.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestRebaselineTest.setUp): + (test_rebaseline_updates_expectations_file): + (test_rebaseline_does_not_include_overrides): + (test_rebaseline_test_with_results_directory): + (test_rebaseline_test_internal_with_move_overwritten_baselines_to): + +2012-11-05 Kenneth Russell <kbr@google.com> + + Added secondary email address and IRC nick. + https://bugs.webkit.org/show_bug.cgi?id=101290 + + Unreviewed change to committers.py. + + * Scripts/webkitpy/common/config/committers.py: + +2012-11-05 Glenn Adams <glenn@skynav.com> + + Add IRC alias for Glenn Adams + https://bugs.webkit.org/show_bug.cgi?id=101262 + + Reviewed by Eric Seidel. + + Add IRC alias for Glenn Adams. + + * Scripts/webkitpy/common/config/committers.py: + +2012-11-05 Dima Gorbik <dgorbik@apple.com> + + Back out controversial changes from Bug 98665. + https://bugs.webkit.org/show_bug.cgi?id=101244 + + Reviewed by David Kilzer. + + Backing out changes from Bug 98665 until further discussions take place on rules for including Platform.h in Assertions.h. + + * DumpRenderTree/mac/MockGeolocationProvider.mm: + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkitpy: lint, clean up rebaseline.py + https://bugs.webkit.org/show_bug.cgi?id=101240 + + Reviewed by Ojan Vafai. + + Miscellaneous cleanup of lint errors and warnings. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractRebaseliningCommand): + (RebaselineTest._test_root): + (OptimizeBaselines._optimize_baseline): + (OptimizeBaselines.execute): + (AnalyzeBaselines.__init__): + (AbstractParallelRebaselineCommand): + (AbstractParallelRebaselineCommand._builders_to_fetch_from): + (AbstractParallelRebaselineCommand._files_to_add): + (AbstractParallelRebaselineCommand._rebaseline): + (RebaselineExpectations.__init__): + (Rebaseline.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (_BaseTestCase.setUp): + (TestAnalyzeBaselines.setUp): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkit-patch optimize-baselines should take a --platform arg + https://bugs.webkit.org/show_bug.cgi?id=97623 + + Reviewed by Ojan Vafai. + + So that we can optionally limit/control which platforms' results + are affected. + + This patch adds --platform to analyze-baselines as well. + + * Scripts/webkitpy/common/checkout/baselineoptimizer.py: + (_baseline_search_hypergraph): + (BaselineOptimizer.__init__): + * Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py: + (TestBaselineOptimizer.__init__): + (BaselineOptimizerTest.test_move_baselines): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (OptimizeBaselines.__init__): + (OptimizeBaselines.execute): + (AnalyzeBaselines.__init__): + (AnalyzeBaselines.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestAnalyzeBaselines.test_default): + (TestAnalyzeBaselines.test_missing_baselines): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkit-patch rebaseline-expectations should take a --platform arg + https://bugs.webkit.org/show_bug.cgi?id=97621 + + Reviewed by Ojan Vafai. + + So that we can limit which platforms we attempt to rebaseline; + this can reduce the noise the command produces if some ports + have errors or warnings in their TestExpectations files and/or + help produce more predictable results. + + In testing this patch, I realized that the rebaseline-in-parallel + commands (rebaseline-json, rebaseline-expectations, etc.) can + cause multiple rebaseline-test-internal commands to attempt to + modify the TestExpectations files concurrently, and that we needed + to lock the files to prevent corruption; it would be nice if + we can split the updating-the-expectations-files out separately + from updating the filesystem (much like we do with the scm updates) + to avoid this concurrency. + + * Scripts/webkitpy/common/system/file_lock_mock.py: Added. + (MockFileLock): + (MockFileLock.__init__): + (MockFileLock.acquire_lock): + (MockFileLock.release_lock): + * Scripts/webkitpy/common/system/systemhost.py: + (SystemHost.copy_current_environment): + (SystemHost): + (SystemHost.make_file_lock): + * Scripts/webkitpy/common/system/systemhost_mock.py: + (MockSystemHost.copy_current_environment): + (MockSystemHost): + (MockSystemHost.make_file_lock): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (RebaselineTest._update_expectations_file): + (RebaselineExpectations.__init__): + (RebaselineExpectations._add_tests_to_rebaseline_for_port): + (RebaselineExpectations.execute): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkitpy: clean up options for specifying multiple platforms at once + https://bugs.webkit.org/show_bug.cgi?id=101140 + + Reviewed by Ojan Vafai. + + This patch reworks how we display the help strings for --platform + options and how we filter out platforms matching a glob. This will + be useful as I add patches to ensure that all the webkit-patch + commands are using --platform consistently to filter ports. + + There should be no functional changes resulting from this patch. + + * Scripts/webkitpy/layout_tests/port/factory.py: + (platform_options): + (PortFactory.all_port_names): + (PortFactory.get_from_builder_name): + * Scripts/webkitpy/tool/commands/queries.py: + (PrintExpectations.__init__): + (PrintBaselines.__init__): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractRebaseliningCommand): + (RebaselineJson.__init__): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestRebaselineExpectations.setUp): + (TestRebaselineExpectations.test_rebaseline_expectations): + +2012-11-05 Peter Beverloo <peter@chromium.org> + + The layout test runner shouldn't wait for data if stdout/stderr have been closed + https://bugs.webkit.org/show_bug.cgi?id=101233 + + Reviewed by Dirk Pranke. + + Trying to read the file descriptor for the stdout or stderr pipes when DumpRenderTree + has crashed during a Chromium Android layout test-run, which uses FIFOs for + communication, causes the File.fileno() method to raise a ValueError. Return early + if either of the pipes has already been closed. + + * Scripts/webkitpy/layout_tests/port/server_process.py: + (ServerProcess._wait_for_data_and_update_buffers_using_select): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + webkit-patch rebaseline is broken + https://bugs.webkit.org/show_bug.cgi?id=101235 + + Reviewed by Ojan Vafai. + + It didn't get updated to handle the change in parsing --suffixes + properly, and the unit test didn't get updated either, masking the + problem. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (Rebaseline._tests_to_update): + (Rebaseline.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestRebaseline.test_rebaseline): + +2012-11-05 Dirk Pranke <dpranke@chromium.org> + + lint-webkitpy doesn't autoinstall pylint properly. + https://bugs.webkit.org/show_bug.cgi?id=101106 + + Reviewed by Ojan Vafai. + + Re-land r133381 with fix; ironically, lint-webkitpy would've + complained about the problem. Also modify pylintrc and clean up + any other lint errors in the modified files. + + * Scripts/webkitpy/common/system/autoinstall.py: + (AutoInstaller._set_up_target_dir): + (AutoInstaller): + (AutoInstaller._make_package): + (AutoInstaller._create_scratch_directory): + (AutoInstaller._install): + (AutoInstaller.install): + * Scripts/webkitpy/pylintrc: + * Scripts/webkitpy/thirdparty/__init__.py: + (AutoinstallImportHook._ensure_autoinstalled_dir_is_in_sys_path): + (AutoinstallImportHook): + (AutoinstallImportHook.find_module): + (AutoinstallImportHook._install_pylint): + (AutoinstallImportHook._install_coverage): + (AutoinstallImportHook._install_eliza): + (AutoinstallImportHook._install_webpagereplay): + (AutoinstallImportHook._install): + * Scripts/webkitpy/thirdparty/__init___unittest.py: + (ThirdpartyTest.test_import_hook.MockImportHook.__init__): + (ThirdpartyTest.test_import_hook): + (ThirdpartyTest.test_imports): + +2012-11-05 KyungTae Kim <ktf.kim@samsung.com> + + [EFL] Fix build warning in EWebLauncher/main.c + https://bugs.webkit.org/show_bug.cgi?id=101197 + + Reviewed by Kentaro Hara. + + Because the strp of _Ecore_Getopt_Value is char** (Ecore_Getopt.h), + The parameter of ECORE_GETOPT_VALUE_STR should be char* + + * EWebLauncher/main.c: + (_User_Arguments): + +2012-11-05 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [EFL][WK2] Add --window-size command line option to EFL MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=100942 + + Reviewed by Kenneth Rohde Christiansen. + + Added window-size (-s) command line option to EFL MiniBrowser. + + * MiniBrowser/efl/main.c: + (window_create): + (parse_window_size): + (elm_main): + +2012-11-05 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] The icon database path should be set by the client + https://bugs.webkit.org/show_bug.cgi?id=101182 + + Reviewed by Kenneth Rohde Christiansen. + + Enable favicon database functionality in MiniBrowser since + it is used and it is no longer enabled by default. + + * MiniBrowser/efl/main.c: + (elm_main): + +2012-11-03 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WK2] setPlatformStrategies always asserts after r132744 + https://bugs.webkit.org/show_bug.cgi?id=100838 + + Reviewed by Simon Hausmann. + + Reland with build fixes. + + Turned test runners to use the new QtTestSupport. + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * DumpRenderTree/qt/QtInitializeTestFonts.h: Removed. + * MiniBrowser/qt/MiniBrowser.pro: + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed. + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): Removed the comment from here + because it was just lying, apparently two times. First, it is not incorrect + to reinitialize our font set and clear font caches, it is what the tests + expect. Second, the use of QRawFont has nothing to do with the font cache. + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-04 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r133381. + http://trac.webkit.org/changeset/133381 + https://bugs.webkit.org/show_bug.cgi?id=101161 + + It made webkit-patch useless (Requested by Ossy_weekend on + #webkit). + + * Scripts/webkitpy/common/system/autoinstall.py: + (AutoInstaller._create_scratch_directory): + (AutoInstaller._install): + (AutoInstaller.install): + * Scripts/webkitpy/thirdparty/__init__.py: + (AutoinstallImportHook.__init__): + (AutoinstallImportHook._install_pylint): + (AutoinstallImportHook._install_coverage): + (AutoinstallImportHook._install_eliza): + (AutoinstallImportHook._install): + * Scripts/webkitpy/thirdparty/__init___unittest.py: + (ThirdpartyTest.test_import_hook.MockImportHook.__init__): + (ThirdpartyTest.test_import_hook): + +2012-11-03 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r133403, r133404, and r133409. + http://trac.webkit.org/changeset/133403 + http://trac.webkit.org/changeset/133404 + http://trac.webkit.org/changeset/133409 + https://bugs.webkit.org/show_bug.cgi?id=101158 + + "Broke tests" (Requested by kbalazs on #webkit). + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * DumpRenderTree/qt/QtInitializeTestFonts.cpp: Renamed from Source/WebCore/platform/qt/QtTestSupport.cpp. + (WebKit): + (WebKit::initializeTestFonts): + * DumpRenderTree/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + (WebKit): + * MiniBrowser/qt/MiniBrowser.pro: + * MiniBrowser/qt/MiniBrowserApplication.cpp: + (MiniBrowserApplication::handleUserOptions): + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-03 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WK2] setPlatformStrategies always asserts after r132744 + https://bugs.webkit.org/show_bug.cgi?id=100838 + + 2nd unreviewed buildfix. + + * MiniBrowser/qt/MiniBrowserApplication.cpp: + +2012-11-03 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WK2] setPlatformStrategies always asserts after r132744 + https://bugs.webkit.org/show_bug.cgi?id=100838 + + Unreviewed buildfix. + + * WebKitTestRunner/Target.pri: + +2012-11-03 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WK2] setPlatformStrategies always asserts after r132744 + https://bugs.webkit.org/show_bug.cgi?id=100838 + + Reviewed by Simon Hausmann. + + Reland with build fix. + + Turned test runners to use the new QtTestSupport. + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * DumpRenderTree/qt/QtInitializeTestFonts.h: Removed. + * MiniBrowser/qt/MiniBrowser.pro: + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed. + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): Removed the comment from here + because it was just lying, apparently two times. First, it is not incorrect + to reinitialize our font set and clear font caches, it is what the tests + expect. Second, the use of QRawFont has nothing to do with the font cache. + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-03 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r133397. + http://trac.webkit.org/changeset/133397 + https://bugs.webkit.org/show_bug.cgi?id=101155 + + "Broke Qt. No way to force the damn bots to do a clean build. + I'm giving up." (Requested by kbalazs on #webkit). + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * DumpRenderTree/qt/QtInitializeTestFonts.cpp: Renamed from Source/WebCore/platform/qt/QtTestSupport.cpp. + (WebKit): + (WebKit::initializeTestFonts): + * DumpRenderTree/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + (WebKit): + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-03 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WK2] setPlatformStrategies always asserts after r132744 + https://bugs.webkit.org/show_bug.cgi?id=100838 + + Reviewed by Simon Hausmann. + + Turned test runners to use the new QtTestSupport. + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed. + * WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp: + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): Removed the comment from here + because it was just lying, apparently two times. First, it is not incorrect + to reinitialize our font set and clear font caches, it is what the tests + expect. Second, the use of QRawFont has nothing to do with the font cache. + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-02 Dirk Pranke <dpranke@chromium.org> + + webkit-patch rebaseline is broken + https://bugs.webkit.org/show_bug.cgi?id=101081 + + Reviewed by Ojan Vafai. + + I broke this in r133061 and the unit tests weren't covering this + code path. Fixed the issue and the tests. --results-directory + doesn't make sense for either 'webkit-patch rebaseline' or + 'webkit-patch rebaseline-expectations', so we don't want to expose + that as a command line option, but they all call a common + _rebaseline() routine that references options.results_directory, + so we need to set a default value. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (RebaselineExpectations.execute): + (Rebaseline.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestRebaseline): + (TestRebaseline.test_rebaseline): + +2012-11-02 Dirk Pranke <dpranke@chromium.org> + + lint-webkitpy doesn't autoinstall pylint properly + https://bugs.webkit.org/show_bug.cgi?id=101106 + + Reviewed by Ojan Vafai. + + Turns out the autoinstalling code for pylint didn't install + pylint's dependencies, and the autoinstaller code didn't work + using nested directories (e.g., "logilab/astng"). Fix those issues, + clean up the autoinstaller code, and add tests to make sure everything + imports successfully. + + * Scripts/webkitpy/common/system/autoinstall.py: + (AutoInstaller._create_scratch_directory): + (AutoInstaller._install): + (AutoInstaller.install): + * Scripts/webkitpy/thirdparty/__init__.py: + (AutoinstallImportHook._ensure_autoinstalled_dir_is_in_sys_path): + (AutoinstallImportHook._install_pylint): + (AutoinstallImportHook._install_coverage): + (AutoinstallImportHook._install_eliza): + (AutoinstallImportHook._install): + * Scripts/webkitpy/thirdparty/__init___unittest.py: + (ThirdpartyTest.test_import_hook.MockImportHook.__init__): + (ThirdpartyTest.test_import_hook): + (ThirdpartyTest.test_imports): + +2012-11-02 Dirk Pranke <dpranke@chromium.org> + + nrwt prints an awkward result message for missing results + https://bugs.webkit.org/show_bug.cgi?id=100915 + + Reviewed by Ojan Vafai. + + Completely rework how we print out the description of + each tests's result - we now will print either "passed" or "failed", + followed by " unexpectedly" if we weren't expecting the result, + followed by a short description of each type of failure that happened + (in parentheses). Also reworked the description of each type of + failure slightly to be clearer. + + Also rework the tests to make sure we have coverage of all of the + messages. Examples of the new output are posted as an attachment to + the bug. + + * Scripts/webkitpy/layout_tests/models/test_expectations.py: + (TestExpectations): + * Scripts/webkitpy/layout_tests/models/test_failures.py: + (FailureTimeout.message): + (FailureMissingResult.message): + (FailureTextMismatch.message): + (FailureMissingImageHash.message): + (FailureMissingImage.message): + (FailureImageHashMismatch.message): + (FailureImageHashIncorrect.message): + (FailureReftestMismatch.message): + (FailureReftestMismatchDidNotOccur.message): + (FailureReftestNoImagesGenerated.message): + (FailureMissingAudio.message): + (FailureAudioMismatch.message): + (FailureEarlyExit.message): + * Scripts/webkitpy/layout_tests/port/test.py: + * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: + (MainTest.test_run_singly_actually_runs_tests): + (MainTest.test_missing_and_unexpected_results): + * Scripts/webkitpy/layout_tests/views/printing.py: + (Printer._print_result_summary_entry): + (Printer.print_finished_test): + (Printer._result_message): + (Printer._print_unexpected_results): + * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py: + * Scripts/webkitpy/tool/commands/queues_unittest.py: + +2012-11-02 Dirk Pranke <dpranke@chromium.org> + + webkitpy: clean up logging in common.system.autoinstall + https://bugs.webkit.org/show_bug.cgi?id=101090 + + Reviewed by Ojan Vafai. + + This module logged way too much, much of which was logging that + was either really redundant or useful only during initial development. + This patch deletes a lot of code and tweaks the remaining log messages + to be more useful now. + + Also, clean up a bunch of lint errors and warnings. + + * Scripts/webkitpy/common/system/autoinstall.py: + (AutoInstaller.__init__): + (AutoInstaller._write_file): + (AutoInstaller._set_up_target_dir): + (AutoInstaller._create_scratch_directory): + (AutoInstaller._url_downloaded_path): + (AutoInstaller._is_downloaded): + (AutoInstaller._record_url_downloaded): + (AutoInstaller._extract_targz): + (AutoInstaller._extract_all): + (AutoInstaller._unzip): + (AutoInstaller._download_to_stream): + (AutoInstaller._download): + (AutoInstaller._install): + (AutoInstaller.install): + +2012-11-02 Dirk Pranke <dpranke@chromium.org> + + webkit-patch analyze-baselines output is weak + https://bugs.webkit.org/show_bug.cgi?id=100998 + + Reviewed by Ojan Vafai. + + Currently analyze-baselines prints a list of baselines that have + the same checksum per line, but the format is hard to read; + this patch cleans up the output to print by directory instead + and use the same format I recently added for debugging optimize-baselines, + then refactors the code so that we share and adds tests for + analyze-baselines (which was untested). + + Also, I got rid of a couple of unnecessarily-hardcoded port names, + and modified the baseline optimizer to log the current world when + optimize fails. + + * Scripts/webkitpy/common/checkout/baselineoptimizer.py: + (BaselineOptimizer.read_results_by_directory): + (BaselineOptimizer.write_by_directory): + (BaselineOptimizer.optimize): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (OptimizeBaselines.execute): + (AnalyzeBaselines.__init__): + (AnalyzeBaselines._write): + (AnalyzeBaselines._analyze_baseline): + (AnalyzeBaselines.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (_FakeOptimizer): + (_FakeOptimizer.read_results_by_directory): + (TestAnalyzeBaselines): + (TestAnalyzeBaselines.setUp): + (TestAnalyzeBaselines.test_default): + (TestAnalyzeBaselines.test_missing_baselines): + +2012-11-02 Adam Barth <abarth@webkit.org> + + ENABLE(UNDO_MANAGER) is disabled everywhere and is not under active development + https://bugs.webkit.org/show_bug.cgi?id=100711 + + Reviewed by Eric Seidel. + + * Scripts/webkitperl/FeatureList.pm: + * qmake/mkspecs/features/features.pri: + +2012-11-02 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r133303. + http://trac.webkit.org/changeset/133303 + https://bugs.webkit.org/show_bug.cgi?id=101068 + + "Broke qt wk2 build (seems like bots fails to rerun qmake if + needed)" (Requested by kbalazs on #webkit). + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * DumpRenderTree/qt/QtInitializeTestFonts.cpp: Renamed from Source/WebCore/platform/qt/QtTestSupport.cpp. + (WebKit): + (WebKit::initializeTestFonts): + * DumpRenderTree/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + (WebKit): + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp. + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-02 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WK2] setPlatformStrategies always asserts after r132744 + https://bugs.webkit.org/show_bug.cgi?id=100838 + + Reviewed by Simon Hausmann. + + Turned test runners to use the new QtTestSupport. + + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeMain.cpp: + (main): + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::open): + * QtTestBrowser/QtTestBrowser.pro: + * QtTestBrowser/qttestbrowser.cpp: + (LauncherApplication::handleUserOptions): + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: + (WTR::activateFonts): + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed. + * WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed. + * WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp: + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: + (WTR::TestRunner::platformInitialize): Removed the comment from here + because it was just lying, apparently two times. First, it is not incorrect + to reinitialize our font set and clear font caches, it is what the tests + expect. Second, the use of QRawFont has nothing to do with the font cache. + * WebKitTestRunner/Target.pri: + * WebKitTestRunner/qt/main.cpp: + (main): + +2012-11-02 Peter Beverloo <peter@chromium.org> + + Output Android's device status before running tests on the bots + https://bugs.webkit.org/show_bug.cgi?id=100944 + + Reviewed by Dirk Pranke. + + This adds a new step to the build master which will be run prior to the + actual tests-suites on the Chromium Android tester, and soon the Chromium + Android Perf bot. For each attached device, it outputs the build + information, battery level, battery temperature and username. + + The Android tester currently is very flaky, and this will help tremendously + in being able to figure out what's wrong with the bot. + + * BuildSlaveSupport/build.webkit.org-config/master.cfg: + (OutputAndroidDeviceStatus): + (TestFactory.__init__): + * BuildSlaveSupport/chromium/output-android-device-status: Added. + (GetAttachedDevices): + (AndroidDeviceStatus): + (AndroidDeviceStatus.__init__): + (AndroidDeviceStatus._run_adb_command): + (AndroidDeviceStatus.device_type): + (AndroidDeviceStatus.device_build): + (AndroidDeviceStatus.device_fingerprint): + (AndroidDeviceStatus.battery_level): + (AndroidDeviceStatus.battery_temperature): + (AndroidDeviceStatus.username): + (main): + +2012-11-02 Jocelyn Turcotte <jocelyn.turcotte@digia.com> + + [Qt] WTR: Make sure that eventSender.mouseDown sends a press event for the second press + https://bugs.webkit.org/show_bug.cgi?id=101033 + + Reviewed by Simon Hausmann. + + eventSender.mouseDown doesn't work properly since r133153 where + MouseButtonDblClick events aren't interpreted as Press events anymore. + The problem is that mouseDown sends a DblClick event instead of a Press, + while the correct way is to send both events. + + Since QQuickWebView isn't doing anything with DblClick events anymore, + simply send Press events all the time and let WebCore figure out + where the double clicks are. + + * WebKitTestRunner/qt/EventSenderProxyQt.cpp: + (WTR::EventSenderProxy::updateClickCountForButton): + (WTR::EventSenderProxy::mouseDown): + +2012-11-02 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Add HTTP authentication support to MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=100953 + + Reviewed by Kenneth Rohde Christiansen. + + Add HTTP authentication support to MiniBrowser. An authentication + dialog now pops up to ask the user for credentials whenever + a Web site requires authentication. + + * MiniBrowser/efl/main.c: + (auth_popup_close): + (on_auth_cancel): + (on_auth_ok): + (on_authentication_request): + (window_create): + +2012-11-01 Yury Semikhatsky <yurys@chromium.org> + + Memory instrumentation: do not call checkCountedObject with wrong pointers + https://bugs.webkit.org/show_bug.cgi?id=100958 + + Reviewed by Alexander Pavlov. + + * TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp: test that if there + if there is class A derived from classes B and C and we have pointer B* to an + object of class A then MemoryInstrumentationClient::checkoutCountedObject won't + be called for B* but only for A* + + Also MemoryInstrumentation implementation used in the test was refactored to + allow passing client as a parameter. The client implementation was extracted into + a top-level class MemoryInstrumentationTestClient. + +2012-11-01 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Make File Chooser dialog modal in MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=100962 + + Reviewed by Gyuyoung Kim. + + Make File Chooser dialog modal in MiniBrowser and make + sure it is closed and freed when its parent window is + closed. + + * MiniBrowser/efl/main.c: + (close_file_picker): + (on_filepicker_parent_deletion): + (on_file_chooser_request): + +2012-11-01 Seonae Kim <sunaeluv.kim@samsung.com> + + [EFL][DRT] Support Geolocation + https://bugs.webkit.org/show_bug.cgi?id=97427 + + Reviewed by Gyuyoung Kim. + + Implement methods to use GeolocationClientMock in DumpRenderTree. + This client attaches to the page whenever a view is created. + + * DumpRenderTree/efl/DumpRenderTreeChrome.cpp: + (DumpRenderTreeChrome::createView): + (DumpRenderTreeChrome::resetDefaultsToConsistentValues): + * DumpRenderTree/efl/TestRunnerEfl.cpp: + (TestRunner::setMockGeolocationPosition): + (TestRunner::setMockGeolocationPositionUnavailableError): + (TestRunner::setGeolocationPermission): + (TestRunner::numberOfPendingGeolocationPermissionRequests): + +2012-11-01 Ryosuke Niwa <rniwa@webkit.org> + + Remove tests no longer needed after r133229. + + * Scripts/webkitpy/performance_tests/perftest_unittest.py: + (TestPerfTestFactory.test_inspector_test): + * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py: + (test_collect_tests_with_skipped_list): + +2012-11-01 Nico Weber <thakis@chromium.org> + + [chromium] Try to find ninja if it's not in the path already + https://bugs.webkit.org/show_bug.cgi?id=100988 + + Reviewed by Ryosuke Niwa. + + Similar to the gclient detection logic in update-webkit-chromium + + * Scripts/webkitdirs.pm: + (buildChromiumNinja): + +2012-11-01 Eric Seidel <eric@webkit.org> + + Add Glenn Adams to the Contributor list + https://bugs.webkit.org/show_bug.cgi?id=100982 + + Reviewed by Adam Barth. + + I CC him enough on bugs it would help me to have him listed here. + + * Scripts/webkitpy/common/config/committers.py: + +2012-11-01 Jer Noble <jer.noble@apple.com> + + Add Python-LLDB support for WTF::Vector types. + https://bugs.webkit.org/show_bug.cgi?id=100980 + + Reviewed by Anders Carlsson. + + Add a synthetic child provider for WTF::Vector types. + + * lldb/lldb_webkit.py: + (__lldb_init_module): Add both the summary and synthetic providers for WTF::Vector + (WTFVector_SummaryProvider): Wrapper around WTFVectorProvider + (WTFVectorProvider): + (WTFVectorProvider.__init__): + (WTFVectorProvider.num_children): Return m_size+2 children to account for synthesized children. + (WTFVectorProvider.get_child_index): Synthesize child indexes for each entry in the Vector. + (WTFVectorProvider.get_child_at_index): Synthesize children for each entry in the Vector. + (WTFVectorProvider.update): Retrieve state from the underlying Vector. + (WTFVectorProvider.has_children): Vectors always have children. + +2012-11-01 Zoltan Horvath <zoltan@webkit.org> + + Remove PageLoad directory entry from PerformanceTests pattern_map + https://bugs.webkit.org/show_bug.cgi?id=100989 + + Reviewed by Ryosuke Niwa. + + Since we removed PageLoad directory from PerformanceTests we don't need this entry in pattern_map. + + * Scripts/webkitpy/performance_tests/perftest.py: + (PerfTestFactory): + +2012-11-01 Jer Noble <jer.noble@apple.com> + + Add LLDB-Python scripts to support WebKit data types. + https://bugs.webkit.org/show_bug.cgi?id=100898 + + Reviewed by Anders Carlsson. + + Add Summary providers for common WebKit string types. + + * lldb/lldb_webkit.py: Added. + (__lldb_init_module): Register these providers with the debugger. + (WTFString_SummaryProvider): Wrapper around WTFStringProvider. + (WTFStringImpl_SummaryProvider): Wrapper around WTFStringImplProvider. + (WTFAtomicString_SummaryProvider): Ditto. + (guess_string_length): Walk through the string looking for a null-byte(s). + (ustring_to_string): Walk through the string, extracting two-byte values, and concatenate them. + (lstring_to_string): Walk through the string, extracting byte values, and concatenate them. + (WTFStringImplProvider): + (WTFStringImplProvider.__init__): + (WTFStringImplProvider.get_length): Extract the m_length variable. + (WTFStringImplProvider.get_data8): Extract the m_data8 variable. + (WTFStringImplProvider.get_data16): Extract the m_data16 variable. + (WTFStringImplProvider.to_string): Pass the appropriate data variable to {u,l}string_to_string. + (WTFStringImplProvider.is_8bit): Check the m_hashAndFlags variable. + (WTFStringProvider): + (WTFStringProvider.__init__): + (WTFStringProvider.stringimpl): Extract the m_impl variable. + (WTFStringProvider.get_length): Pass through to WTFStringImplProvider. + (WTFStringProvider.to_string): Ditto. + +2012-11-01 Peter Beverloo <peter@chromium.org> + + [Chromium-Android] Apache doesn't properly clean up ipc semaphores after a layout test run + https://bugs.webkit.org/show_bug.cgi?id=100950 + + Reviewed by Dirk Pranke. + + When a test run would fail to complete due to an exception in one of + the workers, the HTTP server wouldn't get a chance to gracefully shut + down. This caused too much IPC semaphores to be left on the server, + causing Apache to fail to start in subsequent runs. + + By unifying the Android-specific code with other ports, we no longer + fail to call the ChromiumPort/Base setup_test_run() and clean_up_test_run() + methods either. Furthermore, the number_of_servers argument for starting + the HTTP server is now available as well. + + Because not all tests require an HTTP server, it's not guaranteed that + it will be started. Android depends on this, so add a new method to Port + and override it for Android: requires_http_server(). + + * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py: + (LayoutTestRunner.run_tests): + * Scripts/webkitpy/layout_tests/controllers/manager.py: + (Manager._run_tests): + * Scripts/webkitpy/layout_tests/port/base.py: + (Port.to.requires_http_server): + * Scripts/webkitpy/layout_tests/port/base_unittest.py: + (PortTest.test_dont_require_http_server): + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidPort.requires_http_server): + (ChromiumAndroidPort.start_http_server): + * Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py: + (ChromiumAndroidPortTest.test_must_require_http_server): + +2012-11-01 Adam Roben <aroben@webkit.org> + + Crash beneath WKRelease after failed load in MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=100954 + + Reviewed by Sam Weinig. + + There were just some simple retain/release bugs. + + * MiniBrowser/mac/WK2BrowserWindowController.m: + (-[WK2BrowserWindowController updateTextFieldFromURL:]): + (-[WK2BrowserWindowController updateProvisionalURLForFrame:]): + Don't try to release null URLs. + + (-[WK2BrowserWindowController updateCommittedURLForFrame:]): Don't + release a URL for which we don't have ownership. + +2012-10-31 Rob Buis <rbuis@rim.com> + + [BlackBerry] Fix editing/text-iterator/findString-expected.html fail + https://bugs.webkit.org/show_bug.cgi?id=100902 + + Reviewed by Yong Li. + + PR 210039 + + Fix the test my using the Page::findString method instead of our own in-page searcher. + This also syncs some of the changes we did regarding String usage. + + * DumpRenderTree/blackberry/DumpRenderTree.cpp: + (BlackBerry::WebKit::DumpRenderTree::dumpFramesAsText): + (BlackBerry::WebKit::dumpHistoryItem): + (BlackBerry::WebKit::dumpBackForwardListForWebView): + (BlackBerry::WebKit::DumpRenderTree::dump): + (BlackBerry::WebKit::DumpRenderTree::didFinishDocumentLoadForFrame): + (BlackBerry::WebKit::DumpRenderTree::didReceiveTitleForFrame): + (BlackBerry::WebKit::DumpRenderTree::runJavaScriptAlert): + * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h: + (DumpRenderTree): + * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: + (TestRunner::setMockGeolocationError): + (TestRunner::layerTreeAsText): + (TestRunner::findString): + (TestRunner::setStorageDatabaseIdleInterval): + +2012-11-01 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Add File Chooser dialog support to MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=100822 + + Reviewed by Kenneth Rohde Christiansen. + + Add very basic file picker dialog to MiniBrowser so that + the user can select a file from the file system when + clicking an input element of type "file". + + * MiniBrowser/efl/main.c: + (close_file_picker): + (on_filepicker_deletion): + (on_fileselector_done): + (on_file_chooser_request): + (window_create): + +2012-11-01 Yael Aharon <yael.aharon@intel.com> + + Unreviewed. Change my email address. + + * Scripts/webkitpy/common/config/committers.py: + +2012-11-01 Jocelyn Turcotte <jocelyn.turcotte@digia.com> + + [Qt] Double clicks/taps aren't passed down to the page + https://bugs.webkit.org/show_bug.cgi?id=100949 + + Reviewed by Kenneth Rohde Christiansen. + + Touch mocking shouldn't transform double click events as well, + this adds an extra touch update between clicks which prevents + double-tap detection from triggering on web pages. + + Tested on the mobile version of Google maps. + + * MiniBrowser/qt/MiniBrowserApplication.cpp: + (MiniBrowserApplication::notify): + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + NRWT: lint warnings don't show up by default + https://bugs.webkit.org/show_bug.cgi?id=100914 + + Reviewed by Ryosuke Niwa. + + NRWT wasn't printing any warnings if you had errors in your + TestExpectations files; this means you would only notice this + with --lint-test-files, which is probably bad. I'm not sure + when this requested, but perhaps when we changed the + warnings to not be fatal if you weren't linting the files. + + Now they're still not fatal, but at least we print them. + + Also fix one warning message where we were printing the test name twice. + + * Scripts/webkitpy/layout_tests/models/test_expectations.py: + (TestExpectationsModel._already_seen_better_match): + (TestExpectations._report_warnings): + * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: + (MiscTests.test_parse_warnings_are_logged_if_not_in_lint_mode(self): Added. + +2012-10-31 Terry Anderson <tdanderson@chromium.org> + + Missing stderr output when using run-webkit-tests + https://bugs.webkit.org/show_bug.cgi?id=100709 + + Reviewed by Dirk Pranke. + + Appends #EOF to the end of the stderr output only at the end of a test, + not possibly part-way through. This will allow all of the stderr output + to appear on the results page after running run-webkit-tests. + + * DumpRenderTree/chromium/TestEventPrinter.cpp: + (TestEventPrinter::handleTextFooter): + (TestEventPrinter::handleTestFooter): + +2012-10-30 Mark Lam <mark.lam@apple.com> + + A JSC printf (support for %J+s and %b). + https://bugs.webkit.org/show_bug.cgi?id=100566. + + Reviewed by Michael Saboff. + + Added regression tests for VMInspector::fprintf() sprintf() and snprintf(). + + * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: + * TestWebKitAPI/Tests/JavaScriptCore: Added. + * TestWebKitAPI/Tests/JavaScriptCore/VMInspector.cpp: Added. + +2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> + + Added viewport at-rule to the CSS parser and tokenizer + https://bugs.webkit.org/show_bug.cgi?id=95961 + + Reviewed by Kenneth Rohde Christiansen. + + Enable CSS Device Adaptation by default on EFL. + + * Scripts/webkitperl/FeatureList.pm: + +2012-10-31 Terry Anderson <tdanderson@chromium.org> + + [touchadjustment] touch-links-two-finger-tap test pass incorrectly + https://bugs.webkit.org/show_bug.cgi?id=100619 + + Reviewed by Antonio Gomes. + + Store the touch area when sending a GestureTwoFingerTap event. + + * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: + (WebTestRunner): + (WebTestRunner::EventSender::gestureEvent): + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + nrwt is not killing stuck DRTs on chromium win + https://bugs.webkit.org/show_bug.cgi?id=100886 + + Unreviewed, build fix. + + In the original implementation of NRWT for Chromium, we used + to assume that DRT would always manage to exit on its own and + so NRWT wouldn't attempt to kill DRT if it was stuck (this was the + "hung worker" problem, and meant that if DRT hung, NRWT would hang). + + Eventually, we merged the chromium code with the other ports and + now will always try to shut down DRTs if a test times out, but as + part of that merge we left in a code path where we wouldn't + shut the driver down on windows. This was resulting in stray + DRTs being left around, and NRWT sometimes not exiting cleanly as + a result. + + No unit tests added because this was a windows-only code path (hence + hard to test) and that is now gone. + + * Scripts/webkitpy/layout_tests/port/server_process.py: + (ServerProcess.stop): + +2012-10-31 Ami Fischman <fischman@chromium.org> + + [chromium] DRT and WTR should clear the cache between tests + https://bugs.webkit.org/show_bug.cgi?id=93195 + + Reviewed by Tony Chang. + + This change makes chromium DRT match the GTK+, Qt, and EFL ports. + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::resetTestController): added a WebCache::clear() call to achieve the goal of the bug. + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + Fix typos introduced in r133061. + Unreviewed, build fix. + + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js: + * Scripts/webkitpy/tool/servers/reflectionhandler.py: + (ReflectionHandler._serve_file): + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + garden-o-matic should work for local results + https://bugs.webkit.org/show_bug.cgi?id=100805 + + Reviewed by Adam Barth. + + This is the next step in making garden-o-matic replace + 'webkit-patch rebaseline-server' and be able to deal with local + results. garden-o-matic now accepts a '--results-directory' option + that will point to a layout-test-results directory. At the moment + this will only work if you are also filtering to a single bot/ + platform at a time (we can't handle multiple bots' worth of local + results, but that is a logical next step). + + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html: + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js: + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js: + * Scripts/webkitpy/tool/commands/gardenomatic.py: + (GardenOMatic.__init__): + (GardenOMatic.execute): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractRebaseliningCommand): + (RebaselineTest.__init__): + (RebaselineTest._rebaseline_test): + (RebaselineTest._rebaseline_test_and_update_expectations): + (RebaselineTest.execute): + (AbstractParallelRebaselineCommand._rebaseline_commands): + (AbstractParallelRebaselineCommand._rebaseline): + (RebaselineJson.__init__): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (_BaseTestCase): + (test_rebaseline_updates_expectations_file): + (test_rebaseline_does_not_include_overrides): + (test_rebaseline_test): + (test_rebaseline_test_and_print_scm_changes): + (test_rebaseline_and_copy_test): + (test_rebaseline_and_copy_test_no_existing_result): + (test_rebaseline_and_copy_test_with_lion_result): + (test_rebaseline_and_copy_no_overwrite_test): + (test_rebaseline_test_internal_with_move_overwritten_baselines_to): + (TestRebaselineJson.test_rebaseline_all): + (TestRebaselineJson.test_rebaseline_debug): + (TestRebaselineJson.test_move_overwritten): + (TestRebaselineJson.test_no_optimize): + (TestRebaselineExpectations.test_rebaseline_expectations): + * Scripts/webkitpy/tool/servers/gardeningserver.py: + (GardeningHTTPRequestHandler.rebaselineall): + (GardeningHTTPRequestHandler): + (GardeningHTTPRequestHandler.localresult): + * Scripts/webkitpy/tool/servers/reflectionhandler.py: + (ReflectionHandler.do_POST): + (ReflectionHandler): + (ReflectionHandler.do_HEAD): + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + garden-o-matic should support gardening a single port and specifying how to deal with overwritten baselines + https://bugs.webkit.org/show_bug.cgi?id=100563 + + Reviewed by Ojan Vafai. + + This patch starts the process of making garden-o-matic more useful for + bringing up a single new port in two ways. The goal is to fully + obsolete webkit-patch rebaseline-server. + + First, it adds support for the --platform arguments to garden-o-matic + (so that the UI will default to the right cluster of bots), and if the platform arg + specifies a single bot, filters the results down to just that bot. + + Second, it adds support for --move-overwritten-baselines and changes + the implementation of the move_overwritten_baselines setting in builders.py + so that it is only used if this flag is provided. + + Future patches will make it possible to use local copies of the build + results (rather than going to the bots) and other optimizations to make + it faster to review lots of changes on a single bot. + + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html: + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js: + (.): + * Scripts/webkitpy/layout_tests/port/builders.py: + * Scripts/webkitpy/tool/commands/gardenomatic.py: + (GardenOMatic): + (GardenOMatic.execute): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractRebaseliningCommand): + (AbstractRebaseliningCommand.__init__): + (RebaselineTest): + (OptimizeBaselines): + (AnalyzeBaselines): + (AbstractParallelRebaselineCommand): + (AbstractParallelRebaselineCommand._rebaseline_commands): + (AbstractParallelRebaselineCommand._rebaseline): + (Rebaseline.__init__): + * Scripts/webkitpy/tool/servers/gardeningserver.py: + (GardeningHTTPServer.url): + (GardeningHTTPRequestHandler.rebaselineall): + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + test-webkitpy: fix running modules and classes on the command line + https://bugs.webkit.org/show_bug.cgi?id=100787 + + Reviewed by Eric Seidel. + + Handling modules and classes are arguments on the command line + was broken due to the way we were parsing test names looking for + parallel and serial tests. + + * Scripts/webkitpy/test/main.py: + (Tester._test_names): + (_Loader): + * Scripts/webkitpy/test/main_unittest.py: + (TestStubs.integration_test_empty): + (TestStubs): + (TestStubs.serial_test_empty): + (TestStubs.serial_integration_test_empty): + (TesterTest._find_test_names): + (TesterTest): + (TesterTest.test_individual_names_are_not_run_twice): + (TesterTest.test_integration_tests_are_not_found_by_default): + (TesterTest.test_integration_tests_are_found): + +2012-10-31 Dirk Pranke <dpranke@chromium.org> + + webkitpy: refactor common command line arguments for --platform, rebaseline commands + https://bugs.webkit.org/show_bug.cgi?id=100800 + + Reviewed by Ojan Vafai. + + This change shuffles around how we share command-line options + between NRWT and the various webkit-patch rebaselining commands. + + There are no functional changes in this patch but it should make + things clearer and will be useful in a couple of upcoming patches. + + * Scripts/webkitpy/layout_tests/port/__init__.py: + * Scripts/webkitpy/layout_tests/port/factory.py: + (platform_options): + (configuration_options): + * Scripts/webkitpy/layout_tests/run_webkit_tests.py: + (parse_args): + * Scripts/webkitpy/tool/commands/queries.py: + (PrintExpectations.__init__): + (PrintBaselines.__init__): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractRebaseliningCommand): + (AbstractRebaseliningCommand.__init__): + (RebaselineTest.__init__): + (OptimizeBaselines.__init__): + (AnalyzeBaselines.__init__): + (AbstractParallelRebaselineCommand): + (RebaselineJson.__init__): + (RebaselineExpectations.__init__): + (Rebaseline.__init__): + +2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [NRWT] Xvfb driver is leaking application cache files + https://bugs.webkit.org/show_bug.cgi?id=100864 + + Reviewed by Kenneth Rohde Christiansen. + + Application Cache looks for XDG_CACHE_HOME which is now + prepended with DUMPRENDERTREE_TEMP and cleaned up when + the test worker finishes his job. + + * Scripts/webkitpy/layout_tests/port/xvfbdriver.py: + (XvfbDriver._start): + +2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [EFL] DRT doesn't clean up after itself + https://bugs.webkit.org/show_bug.cgi?id=100346 + + Reviewed by Kenneth Rohde Christiansen. + + The test driver exports an environment variable DUMPRENDERTREE_TEMP + which is used by both DRT and WTR as the folder for storing icons, + databases, application cache, etc, overriding the default XDG_* path. + + We don't need to create these folders because in fact, they are never + used and also never cleaned. Things created inside DUMPRENDERTREE_TEMP + are automatically removed after the test run. + + * Scripts/webkitpy/layout_tests/port/efl.py: + (EflPort.setup_environ_for_server): + +2012-10-31 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [WTR] WebKitTestRunner is not cleaning up the icon database + https://bugs.webkit.org/show_bug.cgi?id=100678 + + Reviewed by Kenneth Rohde Christiansen. + + The icon database was not being set to the temporary folder created for + the test runner by the test driver, which is removed automatically + after the run. + + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::initialize): + +2012-10-31 Mike West <mkwst@chromium.org> + + Script run from an isolated world should bypass a page's CSP. + https://bugs.webkit.org/show_bug.cgi?id=97398 + + Reviewed by Adam Barth. + + * DumpRenderTree/chromium/DRTTestRunner.cpp: + (DRTTestRunner::DRTTestRunner): + (DRTTestRunner::setIsolatedWorldContentSecurityPolicy): + * DumpRenderTree/chromium/DRTTestRunner.h: + (DRTTestRunner): + Adding a mechanism to set the Content Security Policy for an + isolated world to Chromium's testRunner. + +2012-10-31 Michał Pakuła vel Rutka <m.pakula@samsung.com> + + [EFL][DRT] EventSender requires contextClick implementation + https://bugs.webkit.org/show_bug.cgi?id=86091 + + Reviewed by Gyuyoung Kim. + + Add contextClick for DumpRenderTreeEventSender basing on WebKit GTK + implementation. + + * DumpRenderTree/efl/EventSender.cpp: + (getMenuItemTitleCallback): + (setMenuItemTitleCallback): + (menuItemClickCallback): + (contextClickCallback): + +2012-10-30 Sudarsana Nagineni <sudarsana.nagineni@intel.com> + + [WTR] Memory leaks in TestWebKitAPI::didReceiveMessageFromInjectedBundle() + https://bugs.webkit.org/show_bug.cgi?id=100770 + + Reviewed by Sam Weinig. + + Adopt strings returned by WKStringCreateWithUTF8CString() in + didReceiveMessageFromInjectedBundle() to avoid memory leaks. + + * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp: + (TestWebKitAPI::didReceiveMessageFromInjectedBundle): + +2012-10-30 Kangil Han <kangil.han@samsung.com> + + Fix broken python unit test + https://bugs.webkit.org/show_bug.cgi?id=100810 + + Reviewed by Dirk Pranke. + + BUG 100755 has broken python unit test, e.g. assertion fail, since it modified baseline path. + Therefore, this patch fixes it. + + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (TestRebaselineTest.test_baseline_directory): + +2012-10-30 Dirk Pranke <dpranke@chromium.org> + + webkit-patch rebaseline*: add more helpful logging + https://bugs.webkit.org/show_bug.cgi?id=100562 + + Reviewed by Ojan Vafai. + + This change rewires the garden-o-matic and rebaseline* commands + in webkit-patch so that --verbose propagates through all the + subcommand invocations properly, and cleans up the logging so + that you can actually tell what is happening. For now, we + leave all of the logging at the logging.DEBUG level, which + means that it gets mixed in will all the other debug logging noise + and is harder to read, but we'll fix that in subsequent patches. + + * Scripts/webkitpy/common/checkout/baselineoptimizer.py: + (BaselineOptimizer._platform): + (BaselineOptimizer._move_baselines): + (BaselineOptimizer.optimize): + * Scripts/webkitpy/tool/commands/gardenomatic.py: + (GardenOMatic.execute): + * Scripts/webkitpy/tool/commands/rebaseline.py: + (RebaselineTest._copy_existing_baseline): + (RebaselineTest._rebaseline_test): + (OptimizeBaselines._optimize_baseline): + (OptimizeBaselines.execute): + (AbstractParallelRebaselineCommand._run_webkit_patch): + (AbstractParallelRebaselineCommand._rebaseline_commands): + (AbstractParallelRebaselineCommand._files_to_add): + (AbstractParallelRebaselineCommand._optimize_baselines): + (AbstractParallelRebaselineCommand._rebaseline): + (RebaselineExpectations._add_tests_to_rebaseline_for_port): + (Rebaseline.execute): + * Scripts/webkitpy/tool/servers/gardeningserver.py: + (GardeningHTTPServer.__init__): + (GardeningHTTPRequestHandler): + (GardeningHTTPRequestHandler._run_webkit_patch): + (GardeningHTTPRequestHandler.rebaselineall): + +2012-10-30 Dirk Pranke <dpranke@chromium.org> + + clean up tests for webkit-patch rebaseline* commands + https://bugs.webkit.org/show_bug.cgi?id=100793 + + Reviewed by Ojan Vafai. + + The tests in rebaseline_unittest.py had a lot of code cloning, + and many of the tests tested whether things passed or failed by + looking at what was logged instead of what was actually done; + as a result the tests were kinda hard to understand and harder to + maintain. + + This patch adds hooks to MockWeb() and MockExecutive() so we can + directly see which URLs were fetched and calls invoked, and + then reworks all of the unit tests to be easier to follow and + maintain and not sensitive to the logging. Also there were a + couple of tests that were redundant. + + There are no functional changes in this patch, and I verified that + the coverage remains the same. + + * Scripts/webkitpy/common/net/web_mock.py: + (MockWeb.__init__): + (MockWeb.get_binary): + * Scripts/webkitpy/common/system/executive_mock.py: + (MockExecutive.__init__): + (MockExecutive.run_command): + (MockExecutive.kill_all): + (MockExecutive): + (MockExecutive.kill_process): + (MockExecutive.popen): + (MockExecutive.run_in_parallel): + (MockExecutive2): + (MockExecutive2.__init__): + (MockExecutive2.run_command): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (_BaseTestCase): + (_BaseTestCase.setUp): + (_BaseTestCase._expand): + (_BaseTestCase._read): + (_BaseTestCase._write): + (_BaseTestCase._zero_out_test_expectations): + (TestRebaselineTest): + (TestRebaselineTest.test_baseline_directory): + (TestRebaselineTest.test_rebaseline_updates_expectations_file_noop): + (test_rebaseline_updates_expectations_file): + (test_rebaseline_does_not_include_overrides): + (test_rebaseline_test): + (test_rebaseline_test_and_print_scm_changes): + (test_rebaseline_and_copy_test): + (test_rebaseline_and_copy_test_no_existing_result): + (test_rebaseline_and_copy_test_with_lion_result): + (test_rebaseline_and_copy_no_overwrite_test): + (test_rebaseline_test_internal_with_move_overwritten_baselines_to): + (TestRebaselineJson): + (TestRebaselineJson.setUp): + (TestRebaselineJson.tearDown): + (TestRebaselineJson.test_rebaseline_all): + (TestRebaselineJson.test_rebaseline_debug): + (TestRebaseline): + (TestRebaseline.test_tests_to_update): + (TestRebaseline.test_rebaseline): + (TestRebaseline.test_rebaseline.rebaseline_stub): + (TestRebaselineExpectations): + (TestRebaselineExpectations.setUp): + (TestRebaselineExpectations.test_rebaseline_expectations): + (TestRebaselineExpectations.test_rebaseline_expectations_noop): + (TestRebaselineExpectations.disabled_test_overrides_are_included_correctly): + +2012-10-30 Dirk Pranke <dpranke@chromium.org> + + test-webkitpy: fix import of coverage so that it works in a clean install + https://bugs.webkit.org/show_bug.cgi?id=100780 + + Reviewed by Tony Chang. + + The coverage module is written so that the parent directory needs + to be in PYTHONPATH; work around that ... + + * Scripts/webkitpy/test/main_unittest.py: + (TestStubs.test_empty): + (TesterTest.test_individual_names_are_not_run_twice): + (TesterTest): + (TesterTest.integration_test_coverage_works): + * Scripts/webkitpy/thirdparty/__init__.py: + (AutoinstallImportHook._install_coverage): + +2012-10-30 Anders Carlsson <andersca@apple.com> + + Another build fix. + + * TestWebKitAPI/Tests/WebKit2/WebArchive.cpp: + (TestWebKitAPI::didReceiveMessageFromInjectedBundle): + +2012-10-30 Anders Carlsson <andersca@apple.com> + + Build fix. + + * WebKitTestRunner/mac/EventSenderProxy.mm: + (WTR::EventSenderProxy::mouseScrollBy): + +2012-10-30 Rick Byers <rbyers@chromium.org> + + [touchadjustment] touch-links-longpress tests passes incorrectly + https://bugs.webkit.org/show_bug.cgi?id=96810 + + Reviewed by Antonio Gomes. + + Add support for suppling width/height information for longpress + gesture (as for other gestures like tapDown) for the purposes + of touch adjustment. + + * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: + (WebTestRunner): + (WebTestRunner::EventSender::gestureEvent): + +2012-10-29 Anders Carlsson <andersca@apple.com> + + Build WebKit as C++11 on Mac + https://bugs.webkit.org/show_bug.cgi?id=100720 + + Reviewed by Daniel Bates. + + * DumpRenderTree/mac/Configurations/Base.xcconfig: + * MiniBrowser/Configurations/Base.xcconfig: + * TestWebKitAPI/Configurations/Base.xcconfig: + * WebKitTestRunner/Configurations/Base.xcconfig: + Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x. + +2012-10-30 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][JHBUILD] Update EFL libraries to v1.7.1 stable release + https://bugs.webkit.org/show_bug.cgi?id=100759 + + Reviewed by Kenneth Rohde Christiansen. + + Update Bump EFL libraries to the new stable release (v1.7.1) + in JHBuild to pull the latest bug fixes. + + * efl/jhbuild.modules: + +2012-10-29 Anders Carlsson <andersca@apple.com> + + String::createCFString should return a RetainPtr + https://bugs.webkit.org/show_bug.cgi?id=100419 + + Reviewed by Andreas Kling. + + Update callers of String::createCFString. + + * WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm: + (WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): + +2012-10-30 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [WK2][WTR] WebKitTestRunner needs testRunner.queueLoadHTMLString + https://bugs.webkit.org/show_bug.cgi?id=100747 + + Reviewed by Kenneth Rohde Christiansen. + + Added testRunner.queueLoadHTMLString implementation. + + * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: + * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: + (WTR::InjectedBundle::queueLoadHTMLString): + (WTR): + * WebKitTestRunner/InjectedBundle/InjectedBundle.h: + (InjectedBundle): + * WebKitTestRunner/InjectedBundle/TestRunner.cpp: + (WTR::TestRunner::queueLoadHTMLString): + (WTR): + * WebKitTestRunner/InjectedBundle/TestRunner.h: + (TestRunner): + * WebKitTestRunner/TestInvocation.cpp: + (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): + * WebKitTestRunner/WorkQueueManager.cpp: + (WTR::WorkQueueManager::queueLoadHTMLString): + (WTR): + * WebKitTestRunner/WorkQueueManager.h: + (WorkQueueManager): + +2012-10-30 Kangil Han <kangil.han@samsung.com> + + [EFL] Baseline search path should consider both WK1 and WK2 on layout test. + https://bugs.webkit.org/show_bug.cgi?id=100755 + + Reviewed by Gyuyoung Kim. + + Current implementation doesn't consider WK1 case in baseline search path. + Therefore, this patch fixes it. + + * Scripts/webkitpy/layout_tests/port/efl.py: + (EflPort.default_baseline_search_path): + +2012-10-30 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [QT][DRT] Remove unneeded testRunner.setMediaType() implementation + https://bugs.webkit.org/show_bug.cgi?id=100740 + + Reviewed by Kenneth Rohde Christiansen. + + Removed unneeded testRunner.setMediaType() implementation, as tests use + cross-platform window.internals.settings.setMediaTypeOverride instead. + + * DumpRenderTree/qt/TestRunnerQt.cpp: + * DumpRenderTree/qt/TestRunnerQt.h: + (TestRunner): + +2012-10-30 Kangil Han <kangil.han@samsung.com> + + [EFL][DRT] Bitmap should show whole view area. + https://bugs.webkit.org/show_bug.cgi?id=100642 + + Reviewed by Gyuyoung Kim. + + css sticky position test cases haven't been passed even though implementation has been landed by BUG 95182. + This is because current create bitmap implementation refers to geometry position that considers scroll movement even though + paint does it. Therefore, this patch always reflects current view size and remove duplicated graphic operation to dump correct bitmap image. + + * DumpRenderTree/efl/PixelDumpSupportEfl.cpp: + (createBitmapContextFromWebView): + +2012-10-30 Jinwoo Song <jinwoo7.song@samsung.com> + + [EFL] Refactor tooltip callback signal in WebKit1 + https://bugs.webkit.org/show_bug.cgi?id=100571 + + Reviewed by Gyuyoung Kim. + + Separate tooltip callback signal into 'tooltip,text,set' + and 'tooltip,text,unset' to be consistent with WebKit2. + + * EWebLauncher/main.c: + (on_tooltip_text_set): + (on_tooltip_text_unset): + (browserCreate): + +2012-10-29 Csaba Osztrogonác <ossy@webkit.org> + + Unreviewed, rolling out r132819. + http://trac.webkit.org/changeset/132819 + https://bugs.webkit.org/show_bug.cgi?id=100388 + + It made layout testing 40% slower and storage tests assert + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::DumpRenderTree): + (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): + (WebCore::DumpRenderTree::dump): + * DumpRenderTree/qt/DumpRenderTreeQt.h: + (DumpRenderTree): + * DumpRenderTree/qt/TestRunnerQt.cpp: + (TestRunner::reset): + * DumpRenderTree/qt/TestRunnerQt.h: + (TestRunner): + +2012-10-29 Jochen Eisinger <jochen@chromium.org> + + [chromium] TestRunner needs to compile ChromiumCurrentTime and ChromiumThreading in components build + https://bugs.webkit.org/show_bug.cgi?id=100658 + + Reviewed by Tony Chang. + + Before, this was compiled into DumpRenderTree. I also dropped the + include_dirs and dependencies block as TestRunner already has them. + + * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: + +2012-10-29 Takashi Sakamoto <tasak@google.com> + + Unreviewed. Adding myself as a committer. + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-28 Mark Rowe <mrowe@apple.com> + + Simplify Xcode configuration settings that used to vary between OS versions. + + Reviewed by Dan Bernstein. + + * DumpRenderTree/mac/Configurations/Base.xcconfig: + * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: + * MiniBrowser/Configurations/Base.xcconfig: + * MiniBrowser/Configurations/DebugRelease.xcconfig: + * TestWebKitAPI/Configurations/Base.xcconfig: + * TestWebKitAPI/Configurations/DebugRelease.xcconfig: + * WebKitTestRunner/Configurations/Base.xcconfig: + * WebKitTestRunner/Configurations/DebugRelease.xcconfig: + +2012-10-28 Mark Rowe <mrowe@apple.com> + + Remove references to unsupported OS and Xcode versions. + + Reviewed by Anders Carlsson. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/mac/Configurations/Base.xcconfig: + * DumpRenderTree/mac/Configurations/CompilerVersion.xcconfig: Removed. + * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: + * MiniBrowser/Configurations/Base.xcconfig: + * MiniBrowser/Configurations/CompilerVersion.xcconfig: Removed. + * MiniBrowser/Configurations/DebugRelease.xcconfig: + * TestWebKitAPI/Configurations/Base.xcconfig: + * TestWebKitAPI/Configurations/CompilerVersion.xcconfig: Removed. + * TestWebKitAPI/Configurations/DebugRelease.xcconfig: + * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: + * WebKitTestRunner/Configurations/Base.xcconfig: + * WebKitTestRunner/Configurations/CompilerVersion.xcconfig: Removed. + * WebKitTestRunner/Configurations/DebugRelease.xcconfig: + * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: + +2012-10-26 Dirk Pranke <dpranke@chromium.org> + + webkitpy: change non-verbose log format for webkit-patch + https://bugs.webkit.org/show_bug.cgi?id=100561 + + Reviewed by Ojan Vafai. + + Logging the module name and the log level is annoying and nearly useless. + For starters, this change removes that unless you are doing verbose/ + debug logging. In the future we should split out the concepts of + verbose and debug logging (like we did in test-webkitpy and + run-webkit-tests) so that you could get this in debug logging. + + * Scripts/webkitpy/common/system/logutils.py: + (_default_handlers): + (configure_logging): + * Scripts/webkitpy/common/system/logutils_unittest.py: + (ConfigureLoggingTest.test_info_message): + (ConfigureLoggingTest): + (ConfigureLoggingTest.test_debug_message): + (ConfigureLoggingTest.test_two_messages): + (ConfigureLoggingVerboseTest): + (ConfigureLoggingVerboseTest._logging_level): + (ConfigureLoggingVerboseTest.test_info_message): + (ConfigureLoggingVerboseTest.test_debug_message): + (ConfigureLoggingCustomLevelTest.test_logged_message): + +2012-10-29 Christophe Dumez <christophe.dumez@intel.com> + + [CMAKE] Add TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp to CMakeLists.txt + https://bugs.webkit.org/show_bug.cgi?id=100681 + + Reviewed by Anders Carlsson. + + Add TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp to CMake since + it is needed by plugins/npruntime/npruntime-calls-with-null-npp.html + layout test. + + * DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt: + +2012-10-29 Allan Sandfeld Jensen <allan.jensen@digia.com> + + [Qt] Flaky security tests + https://bugs.webkit.org/show_bug.cgi?id=100388 + + Reviewed by Jocelyn Turcotte. + + Disable text dumping and load a blank URL to ensure the documentLoader is cleared + before we start dumping text for the new page. Otherwise messages from the old page + may end up in the text output of the new test. + + This matches what WebKitTestRunner does, and reuses the Qt code for waiting for flag. + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::DumpRenderTree): + (WebCore::runUntil): + (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): + (WebCore::DumpRenderTree::finishedResetting): + (WebCore::DumpRenderTree::dump): + * DumpRenderTree/qt/DumpRenderTreeQt.h: + (DumpRenderTree): + * DumpRenderTree/qt/TestRunnerQt.cpp: + (TestRunner::resetDumping): + (TestRunner::reset): + * DumpRenderTree/qt/TestRunnerQt.h: + (TestRunner): + +2012-10-29 Christophe Dumez <christophe.dumez@intel.com> + + [WK2][WKTR] Enable Shadow DOM at runtime if compiled with SHADOW_DOM support + https://bugs.webkit.org/show_bug.cgi?id=100668 + + Reviewed by Kenneth Rohde Christiansen. + + Enable Shadow DOM functionality at run time in WebKitTestRunner + if compiled with SHADOW_DOM flag set. This is needed to run + the Shadow DOM layout tests. + + * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: + (WTR::InjectedBundle::beginTesting): + +2012-10-29 Yael Aharon <yael.aharon@intel.com> + + [EFL][AC] Fix bugs preventing us from running layout tests with AC turned on + https://bugs.webkit.org/show_bug.cgi?id=100598 + + Reviewed by Kenneth Rohde Christiansen. + + Make sure to use opengl_x11 engine when AC is turned on and X11 is in use. + We cannot create a gl context otherwise. + + * MiniBrowser/efl/main.c: + (elm_main): + * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: + (WTR::initEcoreEvas): + * DumpRenderTree/efl/DumpRenderTree.cpp: + (initEcoreEvas): + * EWebLauncher/efl/main.c: + (windowCreate): + +2012-10-29 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> + + [EFL][WK2] REGRESSION(r132342): fast/events/frame-tab-focus.html fails + https://bugs.webkit.org/show_bug.cgi?id=100646 + + Reviewed by Kenneth Rohde Christiansen. + + * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: + (WTR::PlatformWebView::focus): Improve the check we perform to + decide whether the focus should be taken out of the view before + focusing it again so that we do not unnecessarily unfocus it and + cause blur/focus events to be triggered. Instead of just verifying + if the Evas_Object representing the view has focus, use the WK C + API to check that the currently focused frame is not the main + frame. + +2012-10-29 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r132782. + http://trac.webkit.org/changeset/132782 + https://bugs.webkit.org/show_bug.cgi?id=100653 + + It made 400+ tests fail and 180 tests flakey on Qt (Requested + by Ossy on #webkit). + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): + +2012-10-29 Allan Sandfeld Jensen <allan.jensen@digia.com> + + [Qt] Flaky security tests + https://bugs.webkit.org/show_bug.cgi?id=100388 + + Reviewed by Jocelyn Turcotte. + + Disable text output and load a blank URL to ensure the documentLoader is cleared + before we start dumping text for the new page. Otherwise messages from the old page + may end up in the text output of the new test. + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): + +2012-10-29 Jochen Eisinger <jochen@chromium.org> + + [chromium] remove remaining usages of webkit_support from the TestRunner library + https://bugs.webkit.org/show_bug.cgi?id=100344 + + Reviewed by Adam Barth. + + The most important part is to not rely on calling out to gdk/X11 to + translate keycodes to hardware keycodes, as this is not possible inside + the sandbox. + + * DumpRenderTree/DumpRenderTree.gypi: + * DumpRenderTree/chromium/DRTTestRunner.h: + (WebKit): + (webkit_support): + * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: + (WebTestDelegate): + * DumpRenderTree/chromium/TestRunner/src/CppVariant.h: + * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: + (WebTestRunner): + (WebTestRunner::EventSender::doDragDrop): + (WebTestRunner::EventSender::updateClickCountForButton): + (WebTestRunner::EventSender::mouseDown): + (WebTestRunner::EventSender::mouseUp): + (WebTestRunner::EventSender::mouseMoveTo): + (WebTestRunner::EventSender::keyDown): + (WebTestRunner::EventSender::replaySavedEvents): + (WebTestRunner::EventSender::contextClick): + (WebTestRunner::EventSender::beginDragWithFiles): + (WebTestRunner::EventSender::sendCurrentTouchEvent): + (WebTestRunner::EventSender::handleMouseWheel): + (WebTestRunner::EventSender::gestureEvent): + (WebTestRunner::EventSender::gestureFlingCancel): + (WebTestRunner::EventSender::gestureFlingStart): + * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp: Added. + (WebTestRunner): + (WebTestRunner::NativeKeyCodeForWindowsKeyCode): + * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h. + (WebTestRunner): + * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h: + (TestDelegate): + * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: + * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: + * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: + (WebTestInterfaces::Internal): + (WebTestRunner::WebTestInterfaces::Internal::getCurrentTimeInMillisecond): + (WebTestRunner): + (WebTestRunner::WebTestInterfaces::Internal::getAbsoluteWebStringFromUTF8Path): + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::getCurrentTimeInMillisecond): + (WebViewHost::getAbsoluteWebStringFromUTF8Path): + * DumpRenderTree/chromium/WebViewHost.h: + (WebViewHost): + +2012-10-29 Jonathan Dong <jonathan.dong@torchmobile.com.cn> + + Unreviewed. Add jonathan.dong@torchmobile.com.cn as a committer. + https://bugs.webkit.org/show_bug.cgi?id=100629 + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-27 Dan Bernstein <mitz@apple.com> + + REAL_PLATFORM_NAME build setting is no longer needed + https://bugs.webkit.org/show_bug.cgi?id=100587 + + Reviewed by Mark Rowe. + + Removed the definition of REAL_PLATFORM_NAME and replaced references to it with references + to PLATFORM_NAME. + + * DumpRenderTree/mac/Configurations/Base.xcconfig: + * DumpRenderTree/mac/Configurations/CompilerVersion.xcconfig: + * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: + * MiniBrowser/Configurations/Base.xcconfig: + * MiniBrowser/Configurations/CompilerVersion.xcconfig: + * TestWebKitAPI/Configurations/Base.xcconfig: + * TestWebKitAPI/Configurations/CompilerVersion.xcconfig: + * WebKitTestRunner/Configurations/Base.xcconfig: + * WebKitTestRunner/Configurations/CompilerVersion.xcconfig: + * WebKitTestRunner/Configurations/DebugRelease.xcconfig: + +2012-10-26 Anders Carlsson <andersca@apple.com> + + Crash when making NPRuntime calls with a null NPP pointer + https://bugs.webkit.org/show_bug.cgi?id=100569 + + Reviewed by Darin Adler. + + Add new NPRuntimeCallsWithNullNPP plug-in test. + + * DumpRenderTree/DumpRenderTree.gypi: + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp: + (PluginTest::NPN_ReleaseVariantValue): + (PluginTest::netscapeFuncs): + * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: + (PluginTest): + * DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp: Added. + (NPRuntimeCallsWithNullNPP): + (NPRuntimeCallsWithNullNPP::NPRuntimeCallsWithNullNPP): + (NPRuntimeCallsWithNullNPP::NPP_New): + * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: + * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: + * GNUmakefile.am: + +2012-10-26 Dominic Mazzoni <dmazzoni@google.com> + + AX: Notification should be sent when accessibilityIsIgnored changes + https://bugs.webkit.org/show_bug.cgi?id=99547 + + Reviewed by Chris Fleizach. + + Add additional accessibility notifications. + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::postAccessibilityNotification): + +2012-10-25 Roger Fong <roger_fong@apple.com> + + Get rid of (<X%) failing output for old-run-webkit-tests. + https://bugs.webkit.org/show_bug.cgi?id=100447 + + Reviewed by Jessie Berlin. + + Not a particularly useful piece of information. It's pretty much never above 1%. + new-run-webkit-tests does not output this either. + + * Scripts/old-run-webkit-tests: + (printResults): + +2012-10-26 Xianzhu Wang <wangxianzhu@chromium.org> + + Build bot gives incorrect link to EWS build failure + https://bugs.webkit.org/show_bug.cgi?id=100436 + + Reviewed by Adam Barth. + + * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py: + (MockCommitQueue.__init__): + (MockCommitQueue.command_failed): Return incremental failure_status_id + (CommitQueueTaskTest.test_red_tree_patch_rejection): Check failure_status_id + * Scripts/webkitpy/tool/bot/patchanalysistask.py: + (PatchAnalysisTask._test_patch): Use the failure_status_id of test with patch when test without patch fails and test with patch has unexpected failures. + +2012-10-26 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> + + webkitpy: Pass the `Listen' Apache directive from webkitpy, not the httpd.conf files. + https://bugs.webkit.org/show_bug.cgi?id=98602 + + Reviewed by Dirk Pranke. + + Unify all the different `Listen' directives present in the several + httpd.conf files we have in LayoutTests/http/conf. For one, we + were already passing `Listen 127.0.0.1:8000' via webkitpy before, + and opening the other ports from the conf files. + + The configuration files differed mostly in the way they handled + IPV6 ports. Some of them did not listen to IPV6 ports because the + systems which used them sometimes did not have IPV6 support. The + `http_server_supports_ipv6' method has been added to Port to + address that. cygwin, on its turn, still seems to use Apache 1.3, + which does not support IPV6 at all; the newly-added method has a + special case for that. Plus, perform a socket.getaddrinfo() call + the same way Apache itself does so we are sure we only enable IPV6 + when setting that up in the httpd server is not going to fail. + + * Scripts/webkitpy/common/system/platforminfo_mock.py: + (MockPlatformInfo.is_cygwin): + * Scripts/webkitpy/layout_tests/port/base.py: + (Port.baseline_version_dir): + (Port.to.start_websocket_server): + (Port.to): + (Port.to.http_server_supports_ipv6): + * Scripts/webkitpy/layout_tests/port/base_unittest.py: + (PortTest.test_http_server_supports_ipv6): + (PortTest.test_build_path): + * Scripts/webkitpy/layout_tests/servers/apache_http_server.py: + (LayoutTestApacheHttpd): + (LayoutTestApacheHttpd.__init__): + +2012-10-26 David Barton <dbarton@mathscribe.com> + + Unreviewed. Update my IRC nickname to a registered one. + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-26 Simon Hausmann <simon.hausmann@digia.com> [Qt] Fix the LLInt build on Windows https://bugs.webkit.org/show_bug.cgi?id=97648 - Reviewed by NOBODY (OOPS!). + Reviewed by Tor Arne Vestbø. - Added EXEEXT variable - similar to automake - that expands to .exe as suffix for - executable programs on Windows. Empty otherwise. + Added BIN_EXTENSION variable - similar to automake - that expands to .exe as suffix for + executable programs on Windows. Empty otherwise. Also added support for force_build_all + to allow overriding us disabling build_all for TEMPLATE = app. * qmake/mkspecs/features/default_pre.prf: +2012-10-26 Xiaobo Wang <xbwang@torchmobile.com.cn> + + [BlackBerry] Support pixel tests for BlackBerry DRT + https://bugs.webkit.org/show_bug.cgi?id=100210 + + Reviewed by Rob Buis. + + (The following 2 files are missed in previous patch(r132582), adding them + again.) + + * DumpRenderTree/blackberry/build: Added. + * DumpRenderTree/blackberry/src.pro: Added. + Adds 2 files for building ImageDiff, by Christopher Wells. + +2012-10-26 Thiago Marcos P. Santos <thiago.santos@intel.com> + + Add feature flags for CSS Device Adaptation + https://bugs.webkit.org/show_bug.cgi?id=95960 + + Reviewed by Kenneth Rohde Christiansen. + + * Scripts/webkitperl/FeatureList.pm: + +2012-10-26 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r132552. + http://trac.webkit.org/changeset/132552 + https://bugs.webkit.org/show_bug.cgi?id=100486 + + Makes typeahead tests crash in debug. (Requested by pfeldman + on #webkit). + + * DumpRenderTree/DumpRenderTree.gypi: + * DumpRenderTree/chromium/DRTTestRunner.h: + * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: + (WebTestDelegate): + * DumpRenderTree/chromium/TestRunner/src/CppVariant.h: + * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: + (WebTestRunner): + (WebTestRunner::EventSender::doDragDrop): + (WebTestRunner::EventSender::updateClickCountForButton): + (WebTestRunner::EventSender::mouseDown): + (WebTestRunner::EventSender::mouseUp): + (WebTestRunner::EventSender::mouseMoveTo): + (WebTestRunner::EventSender::keyDown): + (WebTestRunner::EventSender::replaySavedEvents): + (WebTestRunner::EventSender::contextClick): + (WebTestRunner::EventSender::beginDragWithFiles): + (WebTestRunner::EventSender::sendCurrentTouchEvent): + (WebTestRunner::EventSender::handleMouseWheel): + (WebTestRunner::EventSender::gestureEvent): + (WebTestRunner::EventSender::gestureFlingCancel): + (WebTestRunner::EventSender::gestureFlingStart): + * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp: Removed. + * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h: Removed. + * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h: + (TestDelegate): + * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: + * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: + (WebKit): + (webkit_support): + * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: + (WebTestInterfaces::Internal): + * DumpRenderTree/chromium/WebViewHost.cpp: + * DumpRenderTree/chromium/WebViewHost.h: + (WebViewHost): + +2012-10-26 Xiaobo Wang <xbwang@torchmobile.com.cn> + + [BlackBerry] Support pixel tests for BlackBerry DRT + https://bugs.webkit.org/show_bug.cgi?id=100210 + + Reviewed by Rob Buis. + + The implementation is based on the patch from Christopher Wells. + + * DumpRenderTree/blackberry/DumpRenderTree.cpp: + (BlackBerry::WebKit::DumpRenderTree::DumpRenderTree): + (BlackBerry::WebKit::DumpRenderTree::runTest): + (BlackBerry::WebKit::DumpRenderTree::runCurrentTest): + (BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting): + (BlackBerry::WebKit::DumpRenderTree::runTests): + (BlackBerry::WebKit::DumpRenderTree::dump): + * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h: + (DumpRenderTree): + + * DumpRenderTree/blackberry/PNGImageEncoder.cpp: + (BGRAtoRGBA): + (encodeBitmapToPNG): + * DumpRenderTree/blackberry/PNGImageEncoder.h: + The changes to PNGImageEncoder files are from master_40, patched by Tyler + Abbott and Rob Buis. + + * DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp: + (createBitmapContextFromWebView): + (computeMD5HashStringForBitmapContext): + (printPNG): + (dumpBitmap): + * DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.h: + (BitmapContext::createByAdoptingData): + (BitmapContext::~BitmapContext): + (BitmapContext): + (BitmapContext::BitmapContext): + + * DumpRenderTree/blackberry/build: Added. + * DumpRenderTree/blackberry/src.pro: Added. + Adds 2 files for building ImageDiff, by Christopher Wells. + +2012-10-25 Min Qin <qinmin@chromium.org> + + Fix a layout test crash if a TestWebkitPlugin is put inside an iframe + https://bugs.webkit.org/show_bug.cgi?id=100406 + + Reviewed by Adam Barth. + + Resize the context with an empty rect will cause a gl_error in gles2_cmd_decoder.cc. + Don't paint the plugin if m_rect is empty. + + * DumpRenderTree/chromium/TestWebPlugin.cpp: + (TestWebPlugin::updateGeometry): + +2012-10-25 Jinwoo Song <jinwoo7.song@samsung.com> + + [EFL][WK2] Display tooltip in MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=99322 + + Reviewed by Kenneth Rohde Christiansen. + + Display tooltip in MiniBrowser using elm_object_tooltip_text_set(). + + * MiniBrowser/efl/main.c: + (on_tooltip_text_set): + (on_tooltip_text_unset): + (window_create): + +2012-10-25 Jochen Eisinger <jochen@chromium.org> + + [chromium] remove remaining usages of webkit_support from the TestRunner library + https://bugs.webkit.org/show_bug.cgi?id=100344 + + Reviewed by Adam Barth. + + The most important part is to not rely on calling out to gdk/X11 to + translate keycodes to hardware keycodes, as this is not possible inside + the sandbox. + + * DumpRenderTree/DumpRenderTree.gypi: + * DumpRenderTree/chromium/DRTTestRunner.h: + (WebKit): + (webkit_support): + * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: + (WebTestDelegate): + * DumpRenderTree/chromium/TestRunner/src/CppVariant.h: + * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: + (WebTestRunner): + (WebTestRunner::EventSender::doDragDrop): + (WebTestRunner::EventSender::updateClickCountForButton): + (WebTestRunner::EventSender::mouseDown): + (WebTestRunner::EventSender::mouseUp): + (WebTestRunner::EventSender::mouseMoveTo): + (WebTestRunner::EventSender::keyDown): + (WebTestRunner::EventSender::replaySavedEvents): + (WebTestRunner::EventSender::contextClick): + (WebTestRunner::EventSender::beginDragWithFiles): + (WebTestRunner::EventSender::sendCurrentTouchEvent): + (WebTestRunner::EventSender::handleMouseWheel): + (WebTestRunner::EventSender::gestureEvent): + (WebTestRunner::EventSender::gestureFlingCancel): + (WebTestRunner::EventSender::gestureFlingStart): + * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp: Added. + (WebTestRunner): + (WebTestRunner::NativeKeyCodeForWindowsKeyCode): + * DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h: Copied from Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h. + (WebTestRunner): + * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h: + (TestDelegate): + * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: + * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: + * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: + (WebTestInterfaces::Internal): + (WebTestRunner::WebTestInterfaces::Internal::getCurrentTimeInMillisecond): + (WebTestRunner): + (WebTestRunner::WebTestInterfaces::Internal::getAbsoluteWebStringFromUTF8Path): + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::getCurrentTimeInMillisecond): + (WebViewHost::getAbsoluteWebStringFromUTF8Path): + * DumpRenderTree/chromium/WebViewHost.h: + (WebViewHost): + +2012-10-25 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r132514. + http://trac.webkit.org/changeset/132514 + https://bugs.webkit.org/show_bug.cgi?id=100440 + + "Broke chromium content_browsertests AccessibilityAriaMenu + AccessibilityInputRange AccessibilityListMarkers" (Requested + by scheib on #webkit). + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::postAccessibilityNotification): + +2012-10-25 Dirk Pranke <dpranke@chromium.org> + + rwt --lint-test-files doesn't handle the cascade properly + https://bugs.webkit.org/show_bug.cgi?id=100315 + + Reviewed by Ojan Vafai. + + We were only linting the first file in each port's list of + expectations. + + This change pushes more of the logic for linting files into + the TestExpectations classes themselves, but it's still a bit of + a hack. A better solution will require splitting out the actual + parsing of the files from the TestExpectations constructor. + + * Scripts/webkitpy/layout_tests/models/test_expectations.py: + (TestExpectations): + (TestExpectations.__init__): + * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: + (parse_exp): + (SkippedTests.check): + * Scripts/webkitpy/layout_tests/run_webkit_tests.py: + (lint): + * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: + (LintTest.test_all_configurations.FakePort.__init__): + (LintTest.test_all_configurations): + (LintTest.test_lint_test_files__errors): + * Scripts/webkitpy/style/checkers/test_expectations.py: + (TestExpectationsChecker.check_test_expectations): + +2012-10-25 Zan Dobersek <zandobersek@gmail.com> + + Unreviewed GTK gardening. + + Skipping the atspi-basic-hierarchy test case in the TestWebKitAccessibility + WebKit2 API test since the test is currently failing. + + * Scripts/run-gtk-tests: + (TestRunner): + +2012-10-25 Dominic Mazzoni <dmazzoni@google.com> + + AX: Notification should be sent when accessibilityIsIgnored changes + https://bugs.webkit.org/show_bug.cgi?id=99547 + + Reviewed by Chris Fleizach. + + Add additional accessibility notifications. + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::postAccessibilityNotification): + +2012-10-25 Dominik Röttsches <dominik.rottsches@intel.com> + + Conditionalize XHR timeout support + https://bugs.webkit.org/show_bug.cgi?id=100356 + + Reviewed by Adam Barth. + + Adding XHR_TIMEOUT feature in perl and qmake files. + + * Scripts/webkitperl/FeatureList.pm: + * qmake/mkspecs/features/features.pri: + +2012-10-25 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Unreviewed. Update my contact info. + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-25 Terry Anderson <tdanderson@chromium.org> + + Unreviewed. Adding myself as a committer. + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-25 Zeno Albisser <zeno@webkit.org> + + [Qt] Adjust library name in webkitdirs.pm after r131300. + https://bugs.webkit.org/show_bug.cgi?id=100376 + + The library was renamed from QtWebKit to QtWebKitWidgets. + run-launcher was still looking for QtWebKit. + + Reviewed by Simon Hausmann. + + * Scripts/webkitdirs.pm: + (builtDylibPathForName): + +2012-10-22 Mikhail Naganov <mnaganov@chromium.org> + + [Chromium] Add supportMultipleWindows setting, needed for Android + https://bugs.webkit.org/show_bug.cgi?id=99716 + + Reviewed by Adam Barth. + + Add supportMultipleWindows settings for reusing the same view when + opening popups. This is required for emulating the behavior of + Android WebView. Adding into WebCore, as other ports might want to + use this setting in the future. + + * DumpRenderTree/chromium/DRTTestRunner.cpp: + (DRTTestRunner::overridePreference): + * DumpRenderTree/chromium/WebPreferences.cpp: + (WebPreferences::reset): + (WebPreferences::applyTo): + * DumpRenderTree/chromium/WebPreferences.h: + (WebPreferences): + +2012-10-25 Sudarsana Nagineni <sudarsana.nagineni@intel.com> + + [EFL][WK2] JavaScript popups are not focused when opened + https://bugs.webkit.org/show_bug.cgi?id=100354 + + Reviewed by Kenneth Rohde Christiansen. + + Move focus to the JavaScript popups when opened so that the key events + are forwarded to the popups instead of web view. + + * MiniBrowser/efl/main.c: + (on_javascript_alert): + (on_javascript_confirm): + (on_javascript_prompt): + +2012-10-25 Eugene Klyuchnikov <eustas.bug@gmail.com> + + Web Inspector: Fix "check-inspector-strings" script and fix localized strings. + https://bugs.webkit.org/show_bug.cgi?id=100090 + + Reviewed by Vsevolod Vlasov. + + Script "check-inspector-strings" seems to be broken. + Fixed it, refined search algorithm. + + * Scripts/check-inspector-strings: Fixed and refined. + +2012-10-24 Dirk Pranke <dpranke@chromium.org> + + nrwt: fix a couple of minor crashing issues under cygwin + https://bugs.webkit.org/show_bug.cgi?id=100309 + + Reviewed by Ojan Vafai. + + Cygwin was crashing on a null object reference and then + an oserror in kill(). + + * Scripts/webkitpy/common/system/executive.py: + (Executive.kill_process): + * Scripts/webkitpy/layout_tests/port/server_process.py: + (ServerProcess.stop): + +2012-10-24 Dirk Pranke <dpranke@chromium.org> + + nrwt: truncate meter lines properly on windows + https://bugs.webkit.org/show_bug.cgi?id=100062 + + Reviewed by Tony Chang. + + This change adds the code to figure out the terminal width + on windows (it was already there for Unixen) and moves it + to a platform-specific object. + + * Scripts/webkitpy/common/system/platforminfo.py: + (PlatformInfo.terminal_width): + * Scripts/webkitpy/common/system/platforminfo_mock.py: + (MockPlatformInfo.total_bytes_memory): + (MockPlatformInfo): + (MockPlatformInfo.terminal_width): + * Scripts/webkitpy/layout_tests/views/metered_stream.py: + (MeteredStream.__init__): + (MeteredStream.number_of_columns): + (MeteredStream.flush): + * Scripts/webkitpy/layout_tests/views/printing.py: + (Printer.__init__): + (Printer._test_status_line): + +2012-10-24 Dirk Pranke <dpranke@chromium.org> + + tweak debug logging in webkit-patch optimize-baselines + https://bugs.webkit.org/show_bug.cgi?id=100294 + + Reviewed by Ojan Vafai. + + This changes the logging to print out the baselines found + (and their checksums) even when we don't do anything. + + * Scripts/webkitpy/common/checkout/baselineoptimizer.py: + (BaselineOptimizer.optimize): + +2012-10-24 Sailesh Agrawal <sail@chromium.org> + + Incorrect keycodes for numpad /, -, +, . + https://bugs.webkit.org/show_bug.cgi?id=99188 + + Reviewed by Tony Chang. + + Add key mappings for all numpad keys. + + * DumpRenderTree/mac/EventSendingController.mm: + (KeyMappingEntry): + (-[EventSendingController keyDown:withModifiers:withLocation:]): Added all numpad keys. + +2012-10-24 Dirk Pranke <dpranke@chromium.org> + + webkitpy: clean up references to Skipped files + https://bugs.webkit.org/show_bug.cgi?id=100045 + + Reviewed by Ojan Vafai. + + Since they are no longer used or needed ... + + * Scripts/webkitpy/layout_tests/port/apple.py: + (ApplePort._generate_all_test_configurations): + * Scripts/webkitpy/layout_tests/port/base.py: + (Port.skipped_layout_tests): + (Port.expectations_files): + (Port._wk2_port_name): + * Scripts/webkitpy/layout_tests/port/gtk.py: + (GtkPort): + * Scripts/webkitpy/layout_tests/port/mac_unittest.py: + (MacTest.test_default_timeout_ms): + * Scripts/webkitpy/layout_tests/port/port_testcase.py: + (test_expectations_files): + (test_expectations_files.platform_dirs): + * Scripts/webkitpy/layout_tests/port/qt.py: + (QtPort.__init__): + +2012-10-24 Jochen Eisinger <jochen@chromium.org> + + [chromium] Use include paths relative to Source/ in the TestRunner's public API + https://bugs.webkit.org/show_bug.cgi?id=100079 + + Reviewed by Adam Barth. + + For a inside-chromium build, we usually don't add the WebKit API paths + as include paths, so including files by name only does not work. + + Eventually we might want to move to a model where all includes are + relative to Source/, so we're using that here already now. + + * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: + * DumpRenderTree/chromium/TestRunner/public/WebEventSender.h: + * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: + +2012-10-24 Ojan Vafai <ojan@chromium.org> + + Show an error when there are no completed builds in the past 20 runs + https://bugs.webkit.org/show_bug.cgi?id=100266 + + Reviewed by Dimitri Glazkov. + + Right now we get a cryptic JS error in the console when loading the gtk port. This at least gives an error in + the notification stream. We should probably tweak this UI to make it so we can make + errors in the notification stream stick out (e.g. make the text red). + + We should also consider making the number of runs to load dynamic (e.g. if 20 runs don't work, + try 40). + + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js: + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results.js: + * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/results_unittests.js: + +2012-10-24 Ian Vollick <vollick@chromium.org> + + [chromium] Explicitly disable accelerated animations in DRT + https://bugs.webkit.org/show_bug.cgi?id=100241 + + Reviewed by Adrienne Walker. + + Disable accelerated animations by default in DRT. + + * DumpRenderTree/chromium/DumpRenderTree.cpp: + (main): + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::setAcceleratedAnimationEnabled): + * DumpRenderTree/chromium/TestShell.h: + (TestShell): + +2012-10-24 Jocelyn Turcotte <jocelyn.turcotte@digia.com> + + [Qt] Move the QQuickWebViewExperimental pointer to QQuickWebViewPrivate + https://bugs.webkit.org/show_bug.cgi?id=100253 + + Reviewed by Kenneth Rohde Christiansen. + + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WTR::WrapperWindow::handleStatusChanged): + Use QQuickWebView::experimental rather than creating a new instance. + +2012-10-24 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [EFL] run-webkit-tests writes garbage on stderr when running on Xvfb + https://bugs.webkit.org/show_bug.cgi?id=100243 + + Reviewed by Kenneth Rohde Christiansen. + + These errors generate noise on the reports and in some cases, like when + running perf tests, makes the test fail. By using Xext, we can add a + dummy handler to ignore these errors. + + We could have added this handler on the top level EWK API, but that + would be intrusive and could override handlers defined by the user. + + * WebKitTestRunner/PlatformEfl.cmake: + * WebKitTestRunner/efl/main.cpp: + (dummyExtensionErrorHandler): + (main): + +2012-10-24 Carlos Garcia Campos <cgarcia@igalia.com> + + Unreviewed. Fix the GTK+ build. + + * TestWebKitAPI/GNUmakefile.am: Add GTK_FLAGS to + libTestWebKitAPIMain and webcore cflags to TestGtk. + +2012-10-24 Zeno Albisser <zeno@webkit.org> + + Implement GraphicsSurface for Windows. + https://bugs.webkit.org/show_bug.cgi?id=98147 + + Reviewed by Kenneth Rohde Christiansen. + + * qmake/mkspecs/features/features.prf: + Activate GraphicsSurface on windows in case opengles2 (ANGLE) + is available in QT_CONFIG. + +2012-10-24 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> + + [EFL][WK2] fast/repaint/delete-into-nested-block.html and fast/repaint/4776765.html are flaky + https://bugs.webkit.org/show_bug.cgi?id=100010 + + Reviewed by Kenneth Rohde Christiansen. + + Force the main view to receive focus even if Evas already + considers it to be focused. + + It might happen that a different frame is focused by a page and + the focus change notification does not reach Evas. When another + test is run, the main frame is then not considered to be focused + by WebCore, and things such as focus rings are not drawn as + expected. + + * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: + (WTR::PlatformWebView::focus): + +2012-10-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r132333. + http://trac.webkit.org/changeset/132333 + https://bugs.webkit.org/show_bug.cgi?id=100234 + + Crashes many tests on the EFL-WK2 bot. (Requested by rakuco on + #webkit). + + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::resetStateToConsistentValues): + * WebKitTestRunner/efl/TestControllerEfl.cpp: + (WTR::TestController::platformInitializeContext): + +2012-10-24 Dongwoo Joshua Im <dw.im@samsung.com> + + [GTK] Fix build break - undefined reference to 'gtk_init' + https://bugs.webkit.org/show_bug.cgi?id=100221 + + Unreviewed build fix. + + GTK_LIBS is needed for TestWTF. + + * TestWebKitAPI/GNUmakefile.am: + +2012-10-24 Grzegorz Czajkowski <g.czajkowski@samsung.com> + + WebKitTestRunner needs to turn on 'setContinuousSpellCheckingEnabled' + https://bugs.webkit.org/show_bug.cgi?id=93611 + + Reviewed by Hajime Morita. + + WebKitTestRunner enables spelling feature to pass the layout tests from editing/spelling. + + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::resetStateToConsistentValues): + Enables spelling by WebKit2 C API. + + * WebKitTestRunner/efl/TestControllerEfl.cpp: + (WTR::TestController::platformInitializeContext): + Attaches WKTextChecker's client and sets default language for WebKit2-EFL port. + +2012-10-24 Mario Sanchez Prada <mario@webkit.org> + + [WK2] [GTK] TestWebKitAccessibility is not being run + https://bugs.webkit.org/show_bug.cgi?id=100102 + + Reviewed by Carlos Garcia Campos. + + Removed wrong early return in _start_accessibility_daemons(). + + * Scripts/run-gtk-tests: + (TestRunner._lookup_atspi2_binary): Removed wrong line. + +2012-10-24 Noel Gordon <noel.gordon@gmail.com> + + [chromium] Plumb DRT WebkitShouldRespectImageOrientation through to page settings + https://bugs.webkit.org/show_bug.cgi?id=100197 + + Reviewed by Kent Tamura. + + fast/images/exif-orientation.html and fast/images/exif-orientation-css.html require a DRT + WebkitShouldRespectImageOrientation preference. Add the chromium implementation for this + preference and plumb it through to page settings. + + * DumpRenderTree/chromium/DRTTestRunner.cpp: + (DRTTestRunner::overridePreference): Update the tests WebkitShouldRespectImageOrientation + setting in DRT prefs. + * DumpRenderTree/chromium/WebPreferences.cpp: + (WebPreferences::reset): Disable the preference before and after each test. + (WebPreferences::applyTo): Apply the preference to the page settings of each test. + * DumpRenderTree/chromium/WebPreferences.h: + (WebPreferences): + +2012-10-23 Carlos Garcia Campos <cgarcia@igalia.com> + + [GTK] TestWebKitAPI/TestWebKit2 and TestWebKitAPI/TestGtk link to the installed libs + https://bugs.webkit.org/show_bug.cgi?id=100134 + + Reviewed by Martin Robinson. + + Do not share the LDADD variable among TestWTF, TestWebKit2 and + TestGtk. + + * TestWebKitAPI/GNUmakefile.am: + +2012-10-23 Kihong Kwon <kihong.kwon@samsung.com> + + Unreviewed. Adding myself as committer. + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-23 Dan Bernstein <mitz@apple.com> + + Tools changes for <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default + https://bugs.webkit.org/show_bug.cgi?id=100188 + + Reviewed by Sam Weinig. + + Disable kerning and ligatures by default when running the tests. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (resetDefaultsToConsistentValues): Set a value of NO for the + WebKitKerningAndLigaturesEnabledByDefault user default. + * WebKitTestRunner/mac/main.mm: + (main): Register a value of NO for the WebKitKerningAndLigaturesEnabledByDefault user + default. + +2012-10-23 Simon Fraser <simon.fraser@apple.com> + + Allow tests to run with a tile cache, and optionally dump the tile cache via layerTreeAsText() + https://bugs.webkit.org/show_bug.cgi?id=100159 + + Reviewed by Tim Horton. + + Make WebKitTestRunner use a WKView with a tile cache for tests run in a directory + whose path includes "tiled-drawing". It does this by passing around a WKDictionary + of options, and if the current PlatformWebView doesn't support those options, it will + create a new one. + + * WebKitTestRunner/PlatformWebView.h: + (PlatformWebView): Add a WKDictionaryRef options dictionary argument. + (WTR::PlatformWebView::viewSupportsOptions): Returns true if the view + supports the options in the WKDictionaryRef. + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::initialize): Call createWebViewWithOptions() with + no options in the normal case. + (WTR::TestController::createWebViewWithOptions): Moved code into this fuction + so we can call it in two places. + (WTR::TestController::ensureViewSupportsOptions): If the current view + doesn't support the given options, throw it away and makea new one that does. + * WebKitTestRunner/TestController.h: + * WebKitTestRunner/TestInvocation.cpp: + (WTR::shouldUseTiledDrawing): Return true if the directory contains "tiled-drawing". + (WTR::updateTiledDrawingForCurrentTest): Tell the TestController to check whether + the view supports the given options. No-op for non-Mac platforms. + (WTR::TestInvocation::invoke): Call updateTiledDrawingForCurrentTest(). + * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + * WebKitTestRunner/mac/PlatformWebViewMac.mm: + (-[TestRunnerWKView initWithFrame:contextRef:pageGroupRef:useTiledDrawing:]): + (-[TestRunnerWKView _shouldUseTiledDrawingArea]): Subclass the WKView so we can return + a custom value from this method. + (WTR::PlatformWebView::PlatformWebView): + (WTR::PlatformWebView::viewSupportsOptions): + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + * WebKitTestRunner/win/PlatformWebViewWin.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + +2012-10-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r132276. + http://trac.webkit.org/changeset/132276 + https://bugs.webkit.org/show_bug.cgi?id=100189 + + It broke the Qt-WK2 build intentionally (Requested by + Ossy_night on #webkit). + + * WebKitTestRunner/PlatformWebView.h: + (PlatformWebView): + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::initialize): + * WebKitTestRunner/TestController.h: + (TestController): + * WebKitTestRunner/TestInvocation.cpp: + (WTR): + (WTR::TestInvocation::invoke): + * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: + (WTR::PlatformWebView::PlatformWebView): + * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: + (WTR::PlatformWebView::PlatformWebView): + * WebKitTestRunner/mac/PlatformWebViewMac.mm: + (WTR::PlatformWebView::PlatformWebView): + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WTR::PlatformWebView::PlatformWebView): + * WebKitTestRunner/win/PlatformWebViewWin.cpp: + (WTR::PlatformWebView::PlatformWebView): + +2012-10-23 Martin Robinson <mrobinson@igalia.com> + + [GTK][Soup] Implement the default authentication dialog via WebCoreSupport + https://bugs.webkit.org/show_bug.cgi?id=99351 + + Reviewed by Carlos Garcia Campos. + + We no longer need to turn off the soup authentication dialog soup feature, + because it's not installed. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (setDefaultsToConsistentStateValuesForTesting): Don't turn off the feature any longer. + +2012-10-23 Simon Fraser <simon.fraser@apple.com> + + Allow tests to run with a tile cache, and optionally dump the tile cache via layerTreeAsText() + https://bugs.webkit.org/show_bug.cgi?id=100159 + + Reviewed by Tim Horton. + + Make WebKitTestRunner use a WKView with a tile cache for tests run in a directory + whose path includes "tiled-drawing". It does this by passing around a WKDictionary + of options, and if the current PlatformWebView doesn't support those options, it will + create a new one. + + * WebKitTestRunner/PlatformWebView.h: + (PlatformWebView): Add a WKDictionaryRef options dictionary argument. + (WTR::PlatformWebView::viewSupportsOptions): Returns true if the view + supports the options in the WKDictionaryRef. + * WebKitTestRunner/TestController.cpp: + (WTR::TestController::initialize): Call createWebViewWithOptions() with + no options in the normal case. + (WTR::TestController::createWebViewWithOptions): Moved code into this fuction + so we can call it in two places. + (WTR::TestController::ensureViewSupportsOptions): If the current view + doesn't support the given options, throw it away and makea new one that does. + * WebKitTestRunner/TestController.h: + * WebKitTestRunner/TestInvocation.cpp: + (WTR::shouldUseTiledDrawing): Return true if the directory contains "tiled-drawing". + (WTR::updateTiledDrawingForCurrentTest): Tell the TestController to check whether + the view supports the given options. No-op for non-Mac platforms. + (WTR::TestInvocation::invoke): Call updateTiledDrawingForCurrentTest(). + * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + * WebKitTestRunner/mac/PlatformWebViewMac.mm: + (-[TestRunnerWKView initWithFrame:contextRef:pageGroupRef:useTiledDrawing:]): + (-[TestRunnerWKView _shouldUseTiledDrawingArea]): Subclass the WKView so we can return + a custom value from this method. + (WTR::PlatformWebView::PlatformWebView): + (WTR::PlatformWebView::viewSupportsOptions): + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + * WebKitTestRunner/win/PlatformWebViewWin.cpp: + (WTR::PlatformWebView::PlatformWebView): New constructor parameter. + +2012-10-23 David Barton <dbarton@mathscribe.com> + + [MathML] Symbol font uses greek letters for roman ones on linux and Windows + https://bugs.webkit.org/show_bug.cgi?id=99921 + + Reviewed by Eric Seidel. + + Enable the STIXSizeOneSym font for testing. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (allowedFontFamilySet): + * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: + (WTR::allowedFontFamilySet): + +2012-10-23 Tony Chang <tony@chromium.org> + + [chromium] Chromium window build system does not rebuild correctly when enabling/disabling a feature + https://bugs.webkit.org/show_bug.cgi?id=38926 + + Reviewed by Eric Seidel. + + Remove hack for clobbering build when features.gypi changes. Now that + Chromium requires VS2010 or newer, this bug has gone away. + + * Scripts/update-webkit: + +2012-10-23 Jochen Eisinger <jochen@chromium.org> + + [chromium] remove the const qualifier from WebTestDelegate::printMessage + https://bugs.webkit.org/show_bug.cgi?id=100082 + + Reviewed by Adam Barth. + + There's no reason the method should be const, and indeed for + content_shell we want to send an IPC which is a non-const operation. + + * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: + (WebTestDelegate): + * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h: + (TestDelegate): + * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp: + (WebTestInterfaces::Internal): + (WebTestRunner::WebTestInterfaces::Internal::printMessage): + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::printMessage): + * DumpRenderTree/chromium/WebViewHost.h: + (WebViewHost): + +2012-10-23 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Add support for resolution media query + https://bugs.webkit.org/show_bug.cgi?id=99077 + + Reviewed by Antti Koivisto. + + Add support for the RESOLUTION_MEDIA_QUERY feature flag. + + * Scripts/webkitperl/FeatureList.pm: + * qmake/mkspecs/features/features.pri: + +2012-10-23 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> + + Adding myself to commiters.py + https://bugs.webkit.org/show_bug.cgi?id=100122 + + Unreviewed update to commiters.py. + + * Scripts/webkitpy/common/config/committers.py: + +2012-10-23 Timothy Hatcher <timothy@apple.com> + + Unreviewed watchlist change to monitor Inspector IDLs. + + * Scripts/webkitpy/common/config/watchlist: + +2012-10-23 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [WK2] [WTR] WebKitTestRunner needs testRunner.queueForwardNavigation + https://bugs.webkit.org/show_bug.cgi?id=99700 + + Reviewed by Kenneth Rohde Christiansen. + + Implemented testRunner.queueForwardNavigation, made little refactoring in Work Queue + to obviate code duplication. + + * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: + * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: + (WTR::InjectedBundle::queueBackNavigation): + (WTR): + (WTR::InjectedBundle::queueForwardNavigation): + * WebKitTestRunner/InjectedBundle/InjectedBundle.h: + (InjectedBundle): + * WebKitTestRunner/InjectedBundle/TestRunner.cpp: + (WTR::TestRunner::queueForwardNavigation): + (WTR): + * WebKitTestRunner/InjectedBundle/TestRunner.h: + (TestRunner): + * WebKitTestRunner/TestInvocation.cpp: + (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): + * WebKitTestRunner/WorkQueueManager.cpp: + (NavigationItem): + (WTR::NavigationItem::NavigationItem): + (WTR::NavigationItem::invoke): + (WTR): + (WTR::WorkQueueManager::queueBackNavigation): + (WTR::WorkQueueManager::queueForwardNavigation): + * WebKitTestRunner/WorkQueueManager.h: + (WorkQueueManager): + 2012-10-23 Simon Hausmann <simon.hausmann@digia.com> Unreviewed trivial Qt build fix: Fix build without USE_3D_GRAPHICS diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp index a81284b0b..56aeab732 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp +++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp @@ -93,10 +93,12 @@ '<(DEPTH)', '../chromium/TestRunner/public', '../chromium/TestRunner/src', + '../../../Source', ], 'direct_dependent_settings': { 'include_dirs': [ '../chromium/TestRunner/public', + '../../../Source', ], }, 'sources': [ @@ -114,6 +116,12 @@ '<(source_dir)/WebKit/chromium/public/gtk', ], }], + ['inside_chromium_build==1 and component=="shared_library"', { + 'sources': [ + '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp', + '<(source_dir)/WebKit/chromium/src/ChromiumThreading.cpp', + ], + }], ], }, { @@ -346,18 +354,6 @@ ['exclude', 'Android\\.cpp$'], ], }], - ['inside_chromium_build==1 and component=="shared_library"', { - 'sources': [ - '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp', - '<(source_dir)/WebKit/chromium/src/ChromiumThreading.cpp', - ], - 'include_dirs': [ - '<(source_dir)/WebKit/chromium/public', - ], - 'dependencies': [ - '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf', - ], - }], ['inside_chromium_build==0', { 'dependencies': [ '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers', diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi index 26722ece7..dd768d049 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gypi +++ b/Tools/DumpRenderTree/DumpRenderTree.gypi @@ -83,6 +83,8 @@ 'chromium/TestRunner/src/EventSender.h', 'chromium/TestRunner/src/GamepadController.cpp', 'chromium/TestRunner/src/GamepadController.h', + 'chromium/TestRunner/src/KeyCodeMapping.cpp', + 'chromium/TestRunner/src/KeyCodeMapping.h', 'chromium/TestRunner/src/TestInterfaces.cpp', 'chromium/TestRunner/src/TestInterfaces.h', 'chromium/TestRunner/src/TextInputController.cpp', @@ -110,6 +112,7 @@ 'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp', 'TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp', 'TestNetscapePlugIn/Tests/NPPNewFails.cpp', + 'TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp', 'TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp', 'TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp', 'TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp', diff --git a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj index 0c6b8049e..f35ebccdf 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj +++ b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj @@ -50,6 +50,7 @@ 1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */; }; 1ACF898D132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACF898B132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp */; }; 1AD4CB2212A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */; }; + 1AD8683F163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */; }; 1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */; }; 1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */; }; 23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23BCB88F0EA57623003C6289 /* OpenGL.framework */; }; @@ -116,7 +117,6 @@ BC0E24E00E2D9451001B6BC2 /* AccessibilityUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */; }; BC0E24E10E2D9451001B6BC2 /* AccessibilityUIElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */; }; BC0E26150E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */; }; - BC0E24E00E2D9451001B6BC3 /* AccessibilityCommonMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0E24DE0E2D9451001B6BC3 /* AccessibilityCommonMac.h */; }; BC0E26150E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */; }; BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4741290D038A4C0072B006 /* JavaScriptThreading.h */; }; BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4741400D038A570072B006 /* JavaScriptThreadingPthreads.cpp */; }; @@ -262,6 +262,7 @@ 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeRemoveProperty.cpp; sourceTree = "<group>"; }; 1ACF898B132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPDeallocateCalledBeforeNPShutdown.cpp; sourceTree = "<group>"; }; 1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetUserAgentWithNullNPPFromNPPNew.cpp; sourceTree = "<group>"; }; + 1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeCallsWithNullNPP.cpp; sourceTree = "<group>"; }; 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableNPObjectInvokeDefault.cpp; sourceTree = "<group>"; }; 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLNotifyWithURLThatFailsToLoad.cpp; sourceTree = "<group>"; }; 23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; @@ -325,13 +326,11 @@ BC0131D80C9772010087317D /* TestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TestRunner.cpp; sourceTree = "<group>"; }; BC0131D90C9772010087317D /* TestRunner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TestRunner.h; sourceTree = "<group>"; }; BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityUIElement.h; sourceTree = "<group>"; }; - BC0E24DE0E2D9451001B6BC3 /* AccessibilityCommonMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mac/AccessibilityCommonMac.h; sourceTree = "<group>"; }; BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityUIElement.cpp; sourceTree = "<group>"; }; BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementMac.mm; path = mac/AccessibilityUIElementMac.mm; sourceTree = "<group>"; }; BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityCommonMac.mm; path = mac/AccessibilityCommonMac.mm; sourceTree = "<group>"; }; BC4741290D038A4C0072B006 /* JavaScriptThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptThreading.h; sourceTree = "<group>"; }; BC4741400D038A570072B006 /* JavaScriptThreadingPthreads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaScriptThreadingPthreads.cpp; path = pthreads/JavaScriptThreadingPthreads.cpp; sourceTree = "<group>"; }; - BC646A4B136905DE00B35DED /* CompilerVersion.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CompilerVersion.xcconfig; path = mac/Configurations/CompilerVersion.xcconfig; sourceTree = "<group>"; }; BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueue.cpp; sourceTree = "<group>"; }; BC9D90220C97472E0099A4A3 /* WorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueue.h; sourceTree = "<group>"; }; BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueueItem.h; sourceTree = "<group>"; }; @@ -507,7 +506,7 @@ BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */, BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */, BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */, - BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.h */, + BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */, BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */, BCA18B360C9B021900114369 /* AppleScriptController.h */, BCA18B370C9B021900114369 /* AppleScriptController.m */, @@ -572,6 +571,7 @@ 1ACF898B132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp */, 5113DE6615F6CBE5005EC8B3 /* NPPNewFails.cpp */, C031182A134E4A2B00919757 /* NPPSetWindowCalledDuringDestruction.cpp */, + 1AD8683D163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp */, 1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */, 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */, C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */, @@ -681,7 +681,6 @@ isa = PBXGroup; children = ( BCB281EE0CFA713D007E533E /* Base.xcconfig */, - BC646A4B136905DE00B35DED /* CompilerVersion.xcconfig */, BCB282F40CFA7450007E533E /* DebugRelease.xcconfig */, BCB281F00CFA713D007E533E /* DumpRenderTree.xcconfig */, BCB283D80CFA7AFD007E533E /* ImageDiff.xcconfig */, @@ -935,6 +934,7 @@ 515C0CD015EE785700F5A613 /* LogNPPSetWindow.cpp in Sources */, 5113DE6715F6CBE5005EC8B3 /* NPPNewFails.cpp in Sources */, 51134C9916014FDC001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp in Sources */, + 1AD8683F163B2FD000A28583 /* NPRuntimeCallsWithNullNPP.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt b/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt index 65a7427cd..384b5bfb0 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt @@ -16,6 +16,7 @@ SET(WebKitTestNetscapePlugin_SOURCES ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPDeallocateCalledBeforeNPShutdown.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPPNewFails.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPPSetWindowCalledDuringDestruction.cpp + ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPRuntimeCallsWithNullNPP.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPRuntimeRemoveProperty.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NullNPPGetValuePointer.cpp diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp index b884503af..c2195c5b1 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp @@ -223,6 +223,11 @@ bool PluginTest::NPN_RemoveProperty(NPObject* npObject, NPIdentifier propertyNam return browser->removeproperty(m_npp, npObject, propertyName); } +void PluginTest::NPN_ReleaseVariantValue(NPVariant* variant) +{ + browser->releasevariantvalue(variant); +} + #ifdef XP_MACOSX bool PluginTest::NPN_ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace) { @@ -257,6 +262,11 @@ void PluginTest::log(const char* format, ...) va_end(args); } +NPNetscapeFuncs* PluginTest::netscapeFuncs() +{ + return browser; +} + void PluginTest::waitUntilDone() { executeScript("testRunner.waitUntilDone()"); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h index ab64f2521..f8a9aaee3 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h @@ -90,6 +90,7 @@ public: NPObject* NPN_RetainObject(NPObject*); void NPN_ReleaseObject(NPObject*); bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName); + void NPN_ReleaseVariantValue(NPVariant*); #ifdef XP_MACOSX bool NPN_ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace); @@ -125,6 +126,8 @@ protected: const std::string& identifier() const { return m_identifier; } + static NPNetscapeFuncs* netscapeFuncs(); + void waitUntilDone(); void notifyDone(); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp new file mode 100644 index 000000000..84e9714df --- /dev/null +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "PluginTest.h" + +class NPRuntimeCallsWithNullNPP : public PluginTest { +public: + NPRuntimeCallsWithNullNPP(NPP npp, const std::string& identifier) + : PluginTest(npp, identifier) + { + } + +private: + virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) + { + NPObject* windowObject = 0; + if (NPN_GetValue(NPNVWindowNPObject, &windowObject) != NPERR_NO_ERROR || !windowObject) + return NPERR_GENERIC_ERROR; + + NPIdentifier alertIdentifier = NPN_GetStringIdentifier("alert"); + if (!PluginTest::netscapeFuncs()->hasmethod(0, windowObject, alertIdentifier)) { + NPN_ReleaseObject(windowObject); + return NPERR_GENERIC_ERROR; + } + + NPIdentifier documentIdentifier = NPN_GetStringIdentifier("document"); + NPVariant variant; + if (!PluginTest::netscapeFuncs()->getproperty(0, windowObject, documentIdentifier, &variant)) { + NPN_ReleaseObject(windowObject); + return NPERR_GENERIC_ERROR; + } + NPN_ReleaseVariantValue(&variant); + + NPN_ReleaseObject(windowObject); + + executeScript("document.getElementById('result').innerHTML = 'SUCCESS!'"); + notifyDone(); + return NPERR_NO_ERROR; + } +}; + +static PluginTest::Register<NPRuntimeCallsWithNullNPP> npRuntimeCallsWithNullNPP("npruntime-calls-with-null-npp"); + + diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj index 43229839f..86414e21f 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj @@ -434,6 +434,10 @@ >
</File>
<File
+ RelativePath="..\Tests\NPRuntimeCallsWithNullNPP.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
>
</File>
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp index ebc5c396b..a62083fa9 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp @@ -66,7 +66,6 @@ #include <wtf/NonCopyingSort.h> #include <wtf/OwnArrayPtr.h> #include <wtf/Vector.h> -#include <wtf/text/CString.h> #define SDCARD_PATH "/developer" @@ -154,7 +153,7 @@ DumpRenderTree::DumpRenderTree(BlackBerry::WebKit::WebPage* page) : m_gcController(0) , m_accessibilityController(0) , m_page(page) - , m_dumpPixels(false) + , m_enablePixelTests(getenv("pixelTests")) , m_waitToDumpWatchdogTimer(this, &DumpRenderTree::waitToDumpWatchdogTimerFired) , m_workTimer(this, &DumpRenderTree::processWork) , m_acceptsEditing(true) @@ -175,10 +174,10 @@ DumpRenderTree::~DumpRenderTree() delete m_accessibilityController; } -void DumpRenderTree::runTest(const String& url) +void DumpRenderTree::runTest(const String& url, const String& imageHash) { mainFrame->loader()->stopForUserCancel(); - resetToConsistentStateBeforeTesting(); + resetToConsistentStateBeforeTesting(url, imageHash); if (shouldLogFrameLoadDelegates(url)) gTestRunner->setDumpFrameLoadCallbacks(true); if (!runFromCommandLine) { @@ -211,12 +210,18 @@ void DumpRenderTree::doneDrt() void DumpRenderTree::runCurrentTest() { + String imageHash = ""; + int posSplitter = m_currentTest->find('?'); + if (posSplitter > 1 && (unsigned)posSplitter < m_currentTest->length() - 1) { + imageHash = m_currentTest->substring(posSplitter + 1); + m_currentTest->truncate(posSplitter); + } if (isHTTPTest(m_currentTest->utf8().data())) { m_currentHttpTest = m_currentTest->utf8().data(); m_currentHttpTest.remove(0, strlen(httpTestSyntax)); - runTest(httpPrefixURL + m_currentHttpTest); + runTest(httpPrefixURL + m_currentHttpTest, imageHash); } else - runTest(kSDCLayoutTestsURI + *m_currentTest); + runTest(kSDCLayoutTestsURI + *m_currentTest, imageHash); } void DumpRenderTree::runRemainingTests() @@ -245,12 +250,9 @@ void DumpRenderTree::runRemainingTests() runCurrentTest(); } -void DumpRenderTree::resetToConsistentStateBeforeTesting() +void DumpRenderTree::resetToConsistentStateBeforeTesting(const String& url, const String& imageHash) { - if (isHTTPTest(m_currentTest->utf8().data())) - gTestRunner = TestRunner::create(String(httpPrefixURL + *m_currentTest).utf8().data(), ""); - else - gTestRunner = TestRunner::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), ""); + gTestRunner = TestRunner::create(url.utf8().data(), imageHash.utf8().data()); gTestRunner->setIconDatabaseEnabled(false); @@ -335,7 +337,7 @@ void DumpRenderTree::runTests() mainFrame = DumpRenderTreeSupport::corePage(m_page)->mainFrame(); - if (getenv("drtTestFile")) { + if (const char* testFile = getenv("drtTestFile")) { runFromCommandLine = true; addTest(testFile); } else { @@ -371,12 +373,12 @@ String DumpRenderTree::dumpFramesAsText(WebCore::Frame* frame) if (frame->tree()->parent()) s = String::format("\n--------\nFrame: '%s'\n--------\n", frame->tree()->uniqueName().string().utf8().data()); - s += documentElement->innerText() + "\n"; + s = s + documentElement->innerText() + "\n"; if (gTestRunner->dumpChildFramesAsText()) { WebCore::FrameTree* tree = frame->tree(); for (WebCore::Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling()) - s += dumpFramesAsText(child); + s = s + dumpFramesAsText(child); } return s; } @@ -424,11 +426,11 @@ static String dumpHistoryItem(PassRefPtr<WebCore::HistoryItem> item, int indent, int start = 0; if (current) { - result += "curr->"; + result = result + "curr->"; start = 6; } for (int i = start; i < indent; i++) - result += " "; + result = result + " "; String url = item->urlString(); if (url.contains("file://")) { @@ -439,25 +441,25 @@ static String dumpHistoryItem(PassRefPtr<WebCore::HistoryItem> item, int indent, if (res.isEmpty()) return result; - result += fileTestString; - result += res; + result = result + fileTestString; + result = result + res; } else - result += url; + result = result + url; String target = item->target(); if (!target.isEmpty()) - result += " (in frame \"" + target + "\")"; + result = result + " (in frame \"" + target + "\")"; if (item->isTargetItem()) - result += " **nav target**"; - result += "\n"; + result = result + " **nav target**"; + result = result + "\n"; WebCore::HistoryItemVector children = item->children(); // Must sort to eliminate arbitrary result ordering which defeats reproducible testing. nonCopyingSort(children.begin(), children.end(), historyItemCompare); unsigned resultSize = children.size(); for (unsigned i = 0; i < resultSize; ++i) - result += dumpHistoryItem(children[i], indent + 4, false); + result = result + dumpHistoryItem(children[i], indent + 4, false); return result; } @@ -474,16 +476,16 @@ static String dumpBackForwardListForWebView() bfList->backListWithLimit(maxItems, entries); unsigned resultSize = entries.size(); for (unsigned i = 0; i < resultSize; ++i) - result += dumpHistoryItem(entries[i], 8, false); + result = result + dumpHistoryItem(entries[i], 8, false); - result += dumpHistoryItem(bfList->currentItem(), 8, true); + result = result + dumpHistoryItem(bfList->currentItem(), 8, true); bfList->forwardListWithLimit(maxItems, entries); resultSize = entries.size(); for (unsigned i = 0; i < resultSize; ++i) - result += dumpHistoryItem(entries[i], 8, false); + result = result + dumpHistoryItem(entries[i], 8, false); - result += "===============================================\n"; + result = result + "===============================================\n"; return result; } @@ -504,15 +506,27 @@ void DumpRenderTree::dump() String data = dumpAsText ? dumpFramesAsText(mainFrame) : renderTreeDump(); if (gTestRunner->dumpBackForwardList()) - data += dumpBackForwardListForWebView(); + data = data + dumpBackForwardListForWebView(); String result = "Content-Type: " + resultMimeType + "\n" + data; dumpToFile(result); - if (m_dumpPixels && !dumpAsText && gTestRunner->generatePixelResults()) - dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); if (!runFromCommandLine) { + // signal end of text block + fputs("#EOF\n", stdout); + + // There are two scenarios for dumping pixels: + // 1. When the test case explicitly asks for it by calling dumpAsText(true) with that extra true passed as a parameter value, from JavaScript + bool explicitPixelResults = gTestRunner->dumpAsText() && gTestRunner->generatePixelResults(); + // 2. When the test case implicitly allows it by not calling dumpAsText() at all (with no parameters). + bool implicitPixelResults = !gTestRunner->dumpAsText(); + + // But only if m_enablePixelTests is set, to say that the user wants to run pixel tests at all. + bool generatePixelResults = m_enablePixelTests && (explicitPixelResults || implicitPixelResults); + if (generatePixelResults) + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); + String crashFile = dumpFile + ".crash"; unlink(crashFile.utf8().data()); @@ -617,7 +631,7 @@ void DumpRenderTree::didFinishDocumentLoadForFrame(WebCore::Frame* frame) if (gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", drtFrameDescription(frame).utf8().data()); else { - unsigned pendingFrameUnloadEvents = frame->domWindow()->pendingUnloadEventListeners(); + unsigned pendingFrameUnloadEvents = frame->document()->domWindow()->pendingUnloadEventListeners(); if (pendingFrameUnloadEvents) printf("%s - has %u onunload handler(s)\n", drtFrameDescription(frame).utf8().data(), pendingFrameUnloadEvents); } @@ -650,7 +664,7 @@ void DumpRenderTree::didReceiveTitleForFrame(const String& title, WebCore::Frame printf("%s - didReceiveTitle: %s\n", drtFrameDescription(frame).utf8().data(), title.utf8().data()); if (gTestRunner->dumpTitleChanges()) - printf("TITLE CHANGED: '%s'\n", title.utf8().data()); + printf("TITLE CHANGED: %s\n", title.utf8().data()); } // ChromeClient delegates. @@ -677,10 +691,8 @@ void DumpRenderTree::addMessageToConsole(const String& message, unsigned lineNum void DumpRenderTree::runJavaScriptAlert(const String& message) { - if (!testDone) { + if (!testDone) printf("ALERT: %s\n", message.utf8().data()); - fflush(stdout); - } } bool DumpRenderTree::runJavaScriptConfirm(const String& message) @@ -753,12 +765,6 @@ void DumpRenderTree::didChangeSelection() printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", "WebViewDidChangeSelectionNotification"); } -bool DumpRenderTree::findString(const String& string, WebCore::FindOptions options) -{ - WebCore::Page* page = mainFrame ? mainFrame->page() : 0; - return page && page->findString(string, options); -} - bool DumpRenderTree::shouldBeginEditingInDOMRange(WebCore::Range* range) { if (!testDone && gTestRunner->dumpEditingCallbacks()) diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h b/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h index dfcf7c86c..daca112c9 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h @@ -23,11 +23,11 @@ #include "DumpRenderTreeClient.h" -#include "PlatformString.h" #include "Timer.h" #include <BlackBerryPlatformLayoutTest.h> #include <FindOptions.h> #include <wtf/Vector.h> +#include <wtf/text/WTFString.h> namespace WebCore { class Credential; @@ -94,7 +94,6 @@ public: void didEndEditing(); void didChange(); void didChangeSelection(); - bool findString(const String&, WebCore::FindOptions); bool shouldBeginEditingInDOMRange(WebCore::Range*); bool shouldEndEditingInDOMRange(WebCore::Range*); bool shouldDeleteDOMRange(WebCore::Range*); @@ -109,7 +108,7 @@ public: // BlackBerry::Platform::BlackBerryPlatformLayoutTestClient method virtual void addTest(const char* testFile); private: - void runTest(const String& url); + void runTest(const String& url, const String& imageHash); void runTests(); void runCurrentTest(); @@ -124,7 +123,7 @@ private: void doneDrt(); bool isHTTPTest(const String& test); String renderTreeDump() const; - void resetToConsistentStateBeforeTesting(); + void resetToConsistentStateBeforeTesting(const String& url, const String& imageHash); void runRemainingTests(); void invalidateAnyPreviousWaitToDumpWatchdog(); void waitToDumpWatchdogTimerFired(WebCore::Timer<DumpRenderTree>*); @@ -141,7 +140,7 @@ private: GCController* m_gcController; AccessibilityController* m_accessibilityController; WebPage* m_page; - bool m_dumpPixels; + bool m_enablePixelTests; WebCore::Timer<DumpRenderTree> m_waitToDumpWatchdogTimer; WebCore::Timer<DumpRenderTree> m_workTimer; diff --git a/Tools/DumpRenderTree/blackberry/PNGImageEncoder.cpp b/Tools/DumpRenderTree/blackberry/PNGImageEncoder.cpp index 22f202c90..bc4e7ab85 100644 --- a/Tools/DumpRenderTree/blackberry/PNGImageEncoder.cpp +++ b/Tools/DumpRenderTree/blackberry/PNGImageEncoder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Research In Motion Limited. All rights reserved. + * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,8 +21,6 @@ #include "config.h" #include "PNGImageEncoder.h" -#include "SkBitmap.h" -#include "SkUnPreMultiply.h" extern "C" { #include "png.h" @@ -33,20 +31,16 @@ extern "C" { // This code is almost a mirror of the code in WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp // since we can't include this private WebCore file in a WebKit-client application. -// Converts BGRA->RGBA and RGBA->BGRA and undoes alpha premultiplication. -static void preMultipliedBGRAtoRGBA(const unsigned char* input, int numberOfPixels, unsigned char* output) +// Keep the premultipied for as it is the most faithful information +static void BGRAtoRGBA(const unsigned char* input, int numberOfPixels, unsigned char* output) { - SkBitmap inputBitmap; - inputBitmap.setConfig(SkBitmap::kARGB_8888_Config, numberOfPixels, 1); - inputBitmap.setPixels(const_cast<unsigned char*>(input)); for (int x = 0; x < numberOfPixels; x++) { - uint32_t srcPixel = *inputBitmap.getAddr32(x, 0); - SkColor unmultiplied = SkUnPreMultiply::PMColorToColor(srcPixel); - unsigned char* pixelOut = &output[x * 4]; - pixelOut[0] = SkColorGetR(unmultiplied); - pixelOut[1] = SkColorGetG(unmultiplied); - pixelOut[2] = SkColorGetB(unmultiplied); - pixelOut[3] = SkColorGetA(unmultiplied); + output[0] = input[2]; + output[1] = input[1]; + output[2] = input[0]; + output[3] = input[3]; + input += 4; + output += 4; } } @@ -130,8 +124,8 @@ static bool encodeImpl(const unsigned char* input, int imageWidth, int imageHeig png_set_write_fn(pngPtr, &state, encoderWriteCallback, 0); png_set_IHDR(pngPtr, infoPtr, imageWidth, imageHeight, 8, pngOutputColorType, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, - PNG_FILTER_TYPE_DEFAULT); + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, + PNG_FILTER_TYPE_DEFAULT); png_write_info(pngPtr, infoPtr); OwnArrayPtr<unsigned char> rowPixels = adoptArrayPtr(new unsigned char[imageWidth * outputColorComponents]); @@ -144,13 +138,8 @@ static bool encodeImpl(const unsigned char* input, int imageWidth, int imageHeig return true; } -bool encodeSkBitmapToPNG(const SkBitmap& image, Vector<unsigned char>* output) +bool encodeBitmapToPNG(unsigned char* data, int width, int height, Vector<unsigned char>* output) { - if (image.config() != SkBitmap::kARGB_8888_Config) - return false; // Only support ARGB at 8 bpp now. - - image.lockPixels(); - bool result = encodeImpl(static_cast<unsigned char*>(image.getPixels()), image.width(), image.height(), image.rowBytes(), output, preMultipliedBGRAtoRGBA); - image.unlockPixels(); + bool result = encodeImpl(data, width, height, width * 4, output, BGRAtoRGBA); return result; } diff --git a/Tools/DumpRenderTree/blackberry/PNGImageEncoder.h b/Tools/DumpRenderTree/blackberry/PNGImageEncoder.h index 779f7a0f9..7a320a757 100644 --- a/Tools/DumpRenderTree/blackberry/PNGImageEncoder.h +++ b/Tools/DumpRenderTree/blackberry/PNGImageEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Research In Motion Limited. All rights reserved. + * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,8 +21,6 @@ #include <wtf/Vector.h> -class SkBitmap; - -bool encodeSkBitmapToPNG(const SkBitmap&, WTF::Vector<unsigned char>* output); +bool encodeBitmapToPNG(unsigned char* data, int width, int height, WTF::Vector<unsigned char>* output); #endif // PNGImageEncoder_h diff --git a/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp index 0bb4a0c27..420cdfbb8 100644 --- a/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp +++ b/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Research In Motion Limited. All rights reserved. + * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,7 @@ #include "config.h" #include "PixelDumpSupportBlackBerry.h" +#include "BackingStore.h" #include "DumpRenderTreeBlackBerry.h" #include "PNGImageEncoder.h" #include "PixelDumpSupport.h" @@ -26,7 +27,9 @@ #include "WebPageClient.h" #include <BlackBerryPlatformWindow.h> -#include <skia/SkDevice.h> +#if USE(SKIA) +#include <SkDevice.h> +#endif #include <wtf/MD5.h> #include <wtf/Vector.h> @@ -39,34 +42,52 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool /*onscreen*/, bool Platform::Graphics::Window* window = DumpRenderTree::currentInstance()->page()->client()->window(); ASSERT(window); - const Platform::IntRect& windowRect = window->viewportRect(); - - SkBitmap* bitmap = new SkBitmap; - bitmap->setConfig(SkBitmap::kARGB_8888_Config, windowRect.width(), windowRect.height()); // We use 32-bit RGBA since that is the pixel format that ImageDiff expects. - bitmap->allocPixels(); + // The BackingStore has a queue of pending jobs, which are run on idle + // and which may not have been run yet. + BackingStore* backingStore = DumpRenderTree::currentInstance()->page()->backingStore(); + while (backingStore->hasBlitJobs()) + backingStore->blitOnIdle(); - SkCanvas* canvas = new SkCanvas; - canvas->setBitmapDevice(*bitmap); + const Platform::IntRect& windowRect = window->viewportRect(); + const Platform::IntSize& windowSize = window->viewportSize(); + unsigned char* data = new unsigned char[windowSize.width() * windowSize.height() * 4]; // We need to force a synchronous update to the window or we may get an empty bitmap. // For example, running DRT with one test case that finishes before the screen is updated. window->post(windowRect); - const SkBitmap* windowBitmap = static_cast<const SkBitmap*>(lockBufferBackingImage(window->buffer(), Platform::Graphics::ReadAccess)); - canvas->drawBitmap(*windowBitmap, 0, 0); // Draw the bitmap at (0, 0). +#if USE(SKIA) + SkBitmap bitmap; + bitmap.setConfig(SkBitmap::kARGB_8888_Config, windowSize.width(), windowSize.height()); + bitmap.allocPixels(); + bitmap.eraseARGB(0, 0, 0, 0); + + SkCanvas canvas(bitmap); + backingStore->drawContents(&canvas, windowRect, windowSize); + + // Read that SkBitmap rather than change it. So use false on accessBitmap. + const SkBitmap& contentsBitmap = canvas.getDevice()->accessBitmap(false/*changePixels*/); + contentsBitmap.lockPixels(); + + const unsigned char* windowPixels = 0; + if (!contentsBitmap.empty()) { + SkAutoLockPixels lock(contentsBitmap); + windowPixels = static_cast<const unsigned char*>(contentsBitmap.getPixels()); + } +#else + const unsigned char* windowPixels = lockBufferBackingImage(window->buffer(), Platform::Graphics::ReadAccess); +#endif + memcpy(data, windowPixels, windowSize.width() * windowSize.height() * 4); Platform::Graphics::releaseBufferBackingImage(window->buffer()); - return BitmapContext::createByAdoptingBitmapAndContext(bitmap, canvas); + return BitmapContext::createByAdoptingData(data, windowSize.width(), windowSize.height()); } void computeMD5HashStringForBitmapContext(BitmapContext* context, char hashString[33]) { - const SkBitmap& bitmap = context->canvas()->getDevice()->accessBitmap(false); - ASSERT(bitmap.bytesPerPixel() == 4); // 32-bit RGBA - - int pixelsWide = bitmap.width(); - int pixelsHigh = bitmap.height(); - int bytesPerRow = bitmap.rowBytes(); - unsigned char* pixelData = (unsigned char*)bitmap.getPixels(); + int pixelsWide = context->m_width; + int pixelsHigh = context->m_height; + int bytesPerRow = context->m_width * 4; + unsigned char* pixelData = context->m_data; MD5 md5; for (int i = 0; i < pixelsHigh; ++i) { @@ -82,14 +103,14 @@ void computeMD5HashStringForBitmapContext(BitmapContext* context, char hashStrin snprintf(hashString, 33, "%s%02x", hashString, hash[i]); } -static void printPNG(SkCanvas* canvas, const char* checksum) +static void printPNG(BitmapContext* context, const char* checksum) { Vector<unsigned char> pngData; - encodeSkBitmapToPNG(canvas->getDevice()->accessBitmap(false), &pngData); + encodeBitmapToPNG(context->m_data, context->m_width, context->m_height, &pngData); printPNG(pngData.data(), pngData.size(), checksum); } void dumpBitmap(BitmapContext* context, const char* checksum) { - printPNG(context->canvas(), checksum); + printPNG(context, checksum); } diff --git a/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.h b/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.h index e8ae786c7..87c6bf08a 100644 --- a/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.h +++ b/Tools/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Research In Motion Limited. All rights reserved. + * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,38 +19,34 @@ #ifndef PixelDumpSupportBlackBerry_h #define PixelDumpSupportBlackBerry_h -#include <skia/SkBitmap.h> -#include <skia/SkCanvas.h> +#include <stdio.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> class BitmapContext : public RefCounted<BitmapContext> { public: - static PassRefPtr<BitmapContext> createByAdoptingBitmapAndContext(SkBitmap* bitmap, SkCanvas* canvas) + static PassRefPtr<BitmapContext> createByAdoptingData(unsigned char* data, int width, int height) { - return adoptRef(new BitmapContext(bitmap, canvas)); + return adoptRef(new BitmapContext(data, width, height)); } ~BitmapContext() { - delete m_bitmap; - delete m_canvas; + delete m_data; } - SkCanvas* canvas() { return m_canvas; } + unsigned char* m_data; + int m_width, m_height; private: - BitmapContext(SkBitmap* bitmap, SkCanvas* canvas) - : m_bitmap(bitmap) - , m_canvas(canvas) + BitmapContext(unsigned char* data, int width, int height) + : m_data(data) + , m_width(width) + , m_height(height) { } - - SkBitmap* m_bitmap; - SkCanvas* m_canvas; - }; #endif // PixelDumpSupportBlackBerry_h diff --git a/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp index c9d013775..c80a96ddb 100644 --- a/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp +++ b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2009, 2010, 2012 Research In Motion Limited. All rights reserved. - * Copyright (C) 2012 Apple Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,7 +19,6 @@ #include "config.h" #include "TestRunner.h" -#include "CString.h" #include "DatabaseTracker.h" #include "Document.h" #include "DocumentLoader.h" @@ -36,14 +34,12 @@ #include "JSElement.h" #include "KURL.h" #include "NotImplemented.h" -#include "OwnArrayPtr.h" #include "Page.h" #include "RenderTreeAsText.h" #include "SchemeRegistry.h" #include "SecurityOrigin.h" #include "SecurityPolicy.h" #include "Settings.h" -#include "UnusedParam.h" #include "WorkQueue.h" #include "WorkQueueItem.h" #include "WorkerThread.h" @@ -53,6 +49,10 @@ #include <WebPage.h> #include <WebSettings.h> +#include <wtf/OwnArrayPtr.h> +#include <wtf/UnusedParam.h> +#include <wtf/text/CString.h> + using WebCore::toElement; using WebCore::toJS; @@ -452,10 +452,10 @@ void TestRunner::setMockGeolocationPosition(double latitude, double longitude, d DumpRenderTreeSupport::setMockGeolocationPosition(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), latitude, longitude, accuracy); } -void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { String messageStr = jsStringRefToWebCoreString(message); - DumpRenderTreeSupport::setMockGeolocationPositionUnavailableError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), messageStr); + DumpRenderTreeSupport::setMockGeolocationError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), code, messageStr); } void TestRunner::showWebInspector() @@ -587,6 +587,12 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value); } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + notImplemented(); + return 0; +} + JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { WebCore::Element* element = toElement(toJS(toJS(context), nodeObject)); @@ -746,9 +752,7 @@ bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRe options |= WebCore::StartInSelection; } - // Our layout tests assume find will wrap and highlight all matches. - return BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->findNextString(nameStr.utf8().data(), - !(options & WebCore::Backwards), !(options & WebCore::CaseInsensitive), true /* wrap */, true /* highlightAllMatches */); + return mainFrame->page()->findString(nameStr, options); } void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) @@ -839,3 +843,9 @@ void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { notImplemented(); } + +void TestRunner::setStorageDatabaseIdleInterval(double) +{ + // FIXME: Implement this. + notImplemented(); +} diff --git a/Tools/DumpRenderTree/blackberry/build b/Tools/DumpRenderTree/blackberry/build new file mode 100755 index 000000000..fb8dce473 --- /dev/null +++ b/Tools/DumpRenderTree/blackberry/build @@ -0,0 +1,12 @@ +#!/bin/sh + +# This file builds the ImageDiff executable, to run +# on the host machine. + +which qmake-qt4 > /dev/null +if [ $? -eq 0 ] ; then + qmake-qt4 +else + qmake +fi +make diff --git a/Tools/DumpRenderTree/blackberry/src.pro b/Tools/DumpRenderTree/blackberry/src.pro new file mode 100644 index 000000000..10967958e --- /dev/null +++ b/Tools/DumpRenderTree/blackberry/src.pro @@ -0,0 +1,16 @@ +lessThan(QT_VERSION, 4.5) { + error("Qt 4.5 or greater is required.") +} + +TEMPLATE = app +TARGET = ImageDiff + +SOURCES += ../qt/ImageDiff.cpp +DESTDIR = . + +unix:CONFIG += debug_and_release +mac:CONFIG -= app_bundle +win32: CONFIG += console + +QT = core gui + diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp index b31d7da70..dafafa181 100644 --- a/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp @@ -157,6 +157,7 @@ DRTTestRunner::DRTTestRunner(TestShell* shell) bindMethod("evaluateScriptInIsolatedWorld", &DRTTestRunner::evaluateScriptInIsolatedWorld); bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue); bindMethod("setIsolatedWorldSecurityOrigin", &DRTTestRunner::setIsolatedWorldSecurityOrigin); + bindMethod("setIsolatedWorldContentSecurityPolicy", &DRTTestRunner::setIsolatedWorldContentSecurityPolicy); bindMethod("execCommand", &DRTTestRunner::execCommand); bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors); #if ENABLE(NOTIFICATIONS) @@ -1403,6 +1404,16 @@ void DRTTestRunner::setIsolatedWorldSecurityOrigin(const CppArgumentList& argume m_shell->webView()->focusedFrame()->setIsolatedWorldSecurityOrigin(arguments[0].toInt32(), origin); } +void DRTTestRunner::setIsolatedWorldContentSecurityPolicy(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + + if (arguments.size() != 2 || !arguments[0].isNumber() || !arguments[1].isString()) + return; + + m_shell->webView()->focusedFrame()->setIsolatedWorldContentSecurityPolicy(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); +} + void DRTTestRunner::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { @@ -1560,6 +1571,8 @@ void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVari prefs->webSecurityEnabled = cppVariantToBool(value); else if (key == "WebKitJavaScriptCanOpenWindowsAutomatically") prefs->javaScriptCanOpenWindowsAutomatically = cppVariantToBool(value); + else if (key == "WebKitSupportsMultipleWindows") + prefs->supportsMultipleWindows = cppVariantToBool(value); else if (key == "WebKitDisplayImagesKey") prefs->loadsImagesAutomatically = cppVariantToBool(value); else if (key == "WebKitPluginsEnabled") @@ -1604,6 +1617,8 @@ void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVari prefs->allowRunningOfInsecureContent = cppVariantToBool(value); else if (key == "WebKitCSSCustomFilterEnabled") prefs->cssCustomFilterEnabled = cppVariantToBool(value); + else if (key == "WebKitShouldRespectImageOrientation") + prefs->shouldRespectImageOrientation = cppVariantToBool(value); else if (key == "WebKitWebAudioEnabled") { ASSERT(cppVariantToBool(value)); } else { diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h index ec4778fd5..c4cb7ace8 100644 --- a/Tools/DumpRenderTree/chromium/DRTTestRunner.h +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h @@ -43,7 +43,23 @@ #define DRTTestRunner_h #include "TestRunner/src/TestRunner.h" +#include "WebDeliveredIntentClient.h" #include "WebTask.h" +#include "WebTextDirection.h" +#include "platform/WebArrayBufferView.h" +#include "platform/WebString.h" +#include "platform/WebURL.h" +#include <wtf/Deque.h> +#include <wtf/OwnPtr.h> + +namespace WebKit { +class WebGeolocationClientMock; +} + +namespace webkit_support { +class ScopedTempDirectory; +} + class TestShell; @@ -281,6 +297,7 @@ public: void evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList&, CppVariant*); void evaluateScriptInIsolatedWorld(const CppArgumentList&, CppVariant*); void setIsolatedWorldSecurityOrigin(const CppArgumentList&, CppVariant*); + void setIsolatedWorldContentSecurityPolicy(const CppArgumentList&, CppVariant*); // The fallback method is called when a nonexistent method is called on // the layout test controller object. diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index 5a3210449..bbd16af32 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -62,6 +62,7 @@ static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-c static const char optionEnableDeferred2DCanvas[] = "--enable-deferred-2d-canvas"; static const char optionEnableAcceleratedPainting[] = "--enable-accelerated-painting"; static const char optionEnableAcceleratedCompositingForVideo[] = "--enable-accelerated-video"; +static const char optionEnableAcceleratedFixedPosition[] = "--enable-accelerated-fixed-position"; static const char optionUseGraphicsContext3DImplementation[] = "--use-graphics-context-3d-implementation="; static const char optionEnablePerTilePainting[] = "--enable-per-tile-painting"; static const char optionEnableDeferredImageDecoding[] = "--enable-deferred-image-decoding"; @@ -127,6 +128,7 @@ int main(int argc, char* argv[]) bool allowExternalPages = false; bool startupDialog = false; bool acceleratedCompositingForVideoEnabled = false; + bool acceleratedCompositingForFixedPositionEnabled = false; bool softwareCompositingEnabled = false; bool threadedCompositingEnabled = false; bool forceCompositingMode = false; @@ -141,6 +143,7 @@ int main(int argc, char* argv[]) string javaScriptFlags; bool encodeBinary = false; bool noTimeout = false; + bool acceleratedAnimationEnabled = false; for (int i = 1; i < argc; ++i) { string argument(argv[i]); if (argument == "-") @@ -163,6 +166,8 @@ int main(int argc, char* argv[]) hardwareAcceleratedGL = true; else if (argument == optionEnableAcceleratedCompositingForVideo) acceleratedCompositingForVideoEnabled = true; + else if (argument == optionEnableAcceleratedFixedPosition) + acceleratedCompositingForFixedPositionEnabled = true; else if (argument == optionEnableSoftwareCompositing) softwareCompositingEnabled = true; else if (argument == optionEnableThreadedCompositing) @@ -219,12 +224,14 @@ int main(int argc, char* argv[]) TestShell shell; shell.setAllowExternalPages(allowExternalPages); shell.setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); + shell.setAcceleratedCompositingForFixedPositionEnabled(acceleratedCompositingForFixedPositionEnabled); shell.setSoftwareCompositingEnabled(softwareCompositingEnabled); shell.setThreadedCompositingEnabled(threadedCompositingEnabled); shell.setForceCompositingMode(forceCompositingMode); shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled); shell.setDeferred2dCanvasEnabled(deferred2DCanvasEnabled); shell.setAcceleratedPaintingEnabled(acceleratedPaintingEnabled); + shell.setAcceleratedAnimationEnabled(acceleratedAnimationEnabled); shell.setPerTilePaintingEnabled(perTilePaintingEnabled); shell.setDeferredImageDecodingEnabled(deferredImageDecodingEnabled); shell.setJavaScriptFlags(javaScriptFlags); diff --git a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp index 6eaf9d603..ca1e6043f 100644 --- a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp +++ b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp @@ -161,7 +161,7 @@ public: virtual void runIfValid() OVERRIDE { m_dataChannel.dataArrived(m_data, m_length); - delete m_data; + delete [] m_data; } private: diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp index b8aecf100..aa2bf830f 100644 --- a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp +++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp @@ -65,7 +65,6 @@ void TestEventPrinter::handleTextHeader() const void TestEventPrinter::handleTextFooter() const { printf("#EOF\n"); - fprintf(stderr, "#EOF\n"); } void TestEventPrinter::handleAudio(const void* audioData, size_t audioSize) const @@ -95,6 +94,7 @@ void TestEventPrinter::handleImage(const char* actualHash, const char* expectedH void TestEventPrinter::handleTestFooter(bool) const { printf("#EOF\n"); + fprintf(stderr, "#EOF\n"); } void TestEventPrinter::handleBinary(const void* data, size_t size) const diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h index 0df88a77d..47c59efe6 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h @@ -31,7 +31,7 @@ #ifndef WebEventSender_h #define WebEventSender_h -#include "WebDragOperation.h" +#include "WebKit/chromium/public/WebDragOperation.h" namespace WebKit { class WebDragData; diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h index dd3303352..ab47d4f9d 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h @@ -31,8 +31,8 @@ #ifndef WebTestDelegate_h #define WebTestDelegate_h -#include "platform/WebString.h" -#include "platform/WebVector.h" +#include "Platform/chromium/public/WebString.h" +#include "Platform/chromium/public/WebVector.h" namespace WebKit { struct WebContextMenuData; @@ -51,7 +51,7 @@ public: virtual void setEditCommand(const std::string& name, const std::string& value) = 0; virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; virtual void setGamepadData(const WebKit::WebGamepads&) = 0; - virtual void printMessage(const std::string& message) const = 0; + virtual void printMessage(const std::string& message) = 0; // The delegate takes ownership of the WebTask objects and is responsible // for deleting them. @@ -59,6 +59,8 @@ public: virtual void postDelayedTask(WebTask*, long long ms) = 0; virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) = 0; + virtual long long getCurrentTimeInMillisecond() = 0; + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0; }; } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h index 60cc6271e..47fd466af 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h @@ -43,7 +43,6 @@ #define CppVariant_h #include "WebBindings.h" -#include "webkit/support/webkit_support.h" #include <string> #include <wtf/Vector.h> diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp index 2f4a0554c..77fcb76e8 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp @@ -43,16 +43,17 @@ #include "config.h" #include "EventSender.h" +#include "KeyCodeMapping.h" #include "TestDelegate.h" #include "WebContextMenuData.h" #include "WebDragOperation.h" +#include "WebEventSender.h" #include "WebTouchPoint.h" #include "WebView.h" #include "platform/WebDragData.h" #include "platform/WebPoint.h" #include "platform/WebString.h" #include "platform/WebVector.h" -#include "webkit/support/webkit_support.h" #include <wtf/Deque.h> #include <wtf/StringExtras.h> @@ -125,9 +126,9 @@ inline bool outsideMultiClickRadius(const WebPoint& a, const WebPoint& b) // dependent (e.g., dragging has a timeout vs selection). uint32 timeOffsetMs = 0; -double getCurrentEventTimeSec() +double getCurrentEventTimeSec(TestDelegate* delegate) { - return (webkit_support::GetCurrentTimeInMillisecond() + timeOffsetMs) / 1000.0; + return (delegate->getCurrentTimeInMillisecond() + timeOffsetMs) / 1000.0; } void advanceEventTime(int32_t deltaMs) @@ -135,7 +136,7 @@ void advanceEventTime(int32_t deltaMs) timeOffsetMs += deltaMs; } -void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoint& pos, WebMouseEvent* e) +void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoint& pos, WebMouseEvent* e, double ts) { e->type = t; e->button = b; @@ -144,7 +145,7 @@ void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoi e->y = pos.y; e->globalX = pos.x; e->globalY = pos.y; - e->timeStampSeconds = getCurrentEventTimeSec(); + e->timeStampSeconds = ts; e->clickCount = clickCount; } @@ -214,16 +215,16 @@ bool getEditCommand(const WebKeyboardEvent& event, string* name) return false; switch (event.windowsKeyCode) { - case webkit_support::VKEY_LEFT: + case VKEY_LEFT: *name = "MoveToBeginningOfLine"; break; - case webkit_support::VKEY_RIGHT: + case VKEY_RIGHT: *name = "MoveToEndOfLine"; break; - case webkit_support::VKEY_UP: + case VKEY_UP: *name = "MoveToBeginningOfDocument"; break; - case webkit_support::VKEY_DOWN: + case VKEY_DOWN: *name = "MoveToEndOfDocument"; break; default: @@ -349,7 +350,7 @@ void EventSender::reset() void EventSender::doDragDrop(const WebDragData& dragData, WebDragOperationsMask mask) { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseDown, pressedButton, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseDown, pressedButton, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); WebPoint clientPoint(event.x, event.y); WebPoint screenPoint(event.globalX, event.globalY); currentDragData = dragData; @@ -392,7 +393,7 @@ int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments) void EventSender::updateClickCountForButton(WebMouseEvent::Button buttonType) { - if ((getCurrentEventTimeSec() - lastClickTimeSec < multipleClickTimeSec) + if ((getCurrentEventTimeSec(m_delegate) - lastClickTimeSec < multipleClickTimeSec) && (!outsideMultiClickRadius(lastMousePos, lastClickPos)) && (buttonType == lastButtonType)) ++clickCount; @@ -422,7 +423,7 @@ void EventSender::mouseDown(const CppArgumentList& arguments, CppVariant* result WebMouseEvent event; pressedButton = buttonType; - initMouseEvent(WebInputEvent::MouseDown, buttonType, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseDown, buttonType, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString())) applyKeyModifiers(&(arguments[1]), &event); webview()->handleInputEvent(event); @@ -448,7 +449,7 @@ void EventSender::mouseUp(const CppArgumentList& arguments, CppVariant* result) replaySavedEvents(); } else { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString())) applyKeyModifiers(&(arguments[1]), &event); doMouseUp(event); @@ -497,7 +498,7 @@ void EventSender::mouseMoveTo(const CppArgumentList& arguments, CppVariant* resu mouseEventQueue.append(savedEvent); } else { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseMove, pressedButton, mousePos, &event); + initMouseEvent(WebInputEvent::MouseMove, pressedButton, mousePos, &event, getCurrentEventTimeSec(m_delegate)); doMouseMove(event); } } @@ -535,50 +536,43 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) bool needsShiftKeyModifier = false; if ("\n" == codeStr) { generateChar = true; - text = code = webkit_support::VKEY_RETURN; + text = code = VKEY_RETURN; } else if ("rightArrow" == codeStr) - code = webkit_support::VKEY_RIGHT; + code = VKEY_RIGHT; else if ("downArrow" == codeStr) - code = webkit_support::VKEY_DOWN; + code = VKEY_DOWN; else if ("leftArrow" == codeStr) - code = webkit_support::VKEY_LEFT; + code = VKEY_LEFT; else if ("upArrow" == codeStr) - code = webkit_support::VKEY_UP; + code = VKEY_UP; else if ("insert" == codeStr) - code = webkit_support::VKEY_INSERT; + code = VKEY_INSERT; else if ("delete" == codeStr) - code = webkit_support::VKEY_DELETE; + code = VKEY_DELETE; else if ("pageUp" == codeStr) - code = webkit_support::VKEY_PRIOR; + code = VKEY_PRIOR; else if ("pageDown" == codeStr) - code = webkit_support::VKEY_NEXT; + code = VKEY_NEXT; else if ("home" == codeStr) - code = webkit_support::VKEY_HOME; + code = VKEY_HOME; else if ("end" == codeStr) - code = webkit_support::VKEY_END; + code = VKEY_END; else if ("printScreen" == codeStr) - code = webkit_support::VKEY_SNAPSHOT; + code = VKEY_SNAPSHOT; else if ("menu" == codeStr) - // FIXME: Change this to webkit_support::VKEY_APPS. - code = 0x5D; + code = VKEY_APPS; else if ("leftControl" == codeStr) - // FIXME: Change this to webkit_support::VKEY_LCONTROL. - code = 0xA2; + code = VKEY_LCONTROL; else if ("rightControl" == codeStr) - // FIXME: Change this to webkit_support::VKEY_RCONTROL. - code = 0xA3; + code = VKEY_RCONTROL; else if ("leftShift" == codeStr) - // FIXME: Change this to webkit_support::VKEY_LSHIFT. - code = 0xA0; + code = VKEY_LSHIFT; else if ("rightShift" == codeStr) - // FIXME: Change this to webkit_support::VKEY_RSHIFT. - code = 0xA1; + code = VKEY_RSHIFT; else if ("leftAlt" == codeStr) - // FIXME: Change this to webkit_support::VKEY_LMENU. - code = 0xA4; + code = VKEY_LMENU; else if ("rightAlt" == codeStr) - // FIXME: Change this to webkit_support::VKEY_RMENU. - code = 0xA5; + code = VKEY_RMENU; else { // Compare the input string with the function-key names defined by the // DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key @@ -588,7 +582,7 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) snprintf(functionChars, 10, "F%d", i); string functionKeyName(functionChars); if (functionKeyName == codeStr) { - code = webkit_support::VKEY_F1 + (i - 1); + code = VKEY_F1 + (i - 1); break; } } @@ -613,7 +607,7 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) eventDown.modifiers = 0; eventDown.windowsKeyCode = code; #if OS(LINUX) && USE(GTK) - eventDown.nativeKeyCode = webkit_support::NativeKeyCodeForWindowsKeyCode(code, needsShiftKeyModifier); + eventDown.nativeKeyCode = NativeKeyCodeForWindowsKeyCode(code); #endif if (generateChar) { @@ -775,7 +769,7 @@ void EventSender::replaySavedEvents() switch (e.type) { case SavedEvent::MouseMove: { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseMove, pressedButton, e.pos, &event); + initMouseEvent(WebInputEvent::MouseMove, pressedButton, e.pos, &event, getCurrentEventTimeSec(m_delegate)); doMouseMove(event); break; } @@ -784,7 +778,7 @@ void EventSender::replaySavedEvents() break; case SavedEvent::MouseUp: { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseUp, e.buttonType, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseUp, e.buttonType, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); doMouseUp(event); break; } @@ -843,10 +837,10 @@ void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* res // Generate right mouse down and up. WebMouseEvent event; pressedButton = WebMouseEvent::ButtonRight; - initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); webview()->handleInputEvent(event); - initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); webview()->handleInputEvent(event); pressedButton = WebMouseEvent::ButtonNone; @@ -906,7 +900,7 @@ void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVarian for (size_t i = 0; i < files.size(); ++i) { WebDragData::Item item; item.storageType = WebDragData::Item::StorageTypeFilename; - item.filenameData = webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]); + item.filenameData = m_delegate->getAbsoluteWebStringFromUTF8Path(files[i]); currentDragData.addItem(item); absoluteFilenames[i] = item.filenameData; } @@ -1014,7 +1008,7 @@ void EventSender::sendCurrentTouchEvent(const WebInputEvent::Type type) WebTouchEvent touchEvent; touchEvent.type = type; touchEvent.modifiers = touchModifiers; - touchEvent.timeStampSeconds = getCurrentEventTimeSec(); + touchEvent.timeStampSeconds = getCurrentEventTimeSec(m_delegate); touchEvent.touchesLength = touchPoints.size(); for (unsigned i = 0; i < touchPoints.size(); ++i) touchEvent.touches[i] = touchPoints[i]; @@ -1054,7 +1048,7 @@ void EventSender::handleMouseWheel(const CppArgumentList& arguments, CppVariant* hasPreciseScrollingDeltas = arguments[3].toBoolean(); WebMouseWheelEvent event; - initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); event.wheelTicksX = static_cast<float>(horizontal); event.wheelTicksY = static_cast<float>(vertical); event.deltaX = event.wheelTicksX; @@ -1206,10 +1200,18 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& case WebInputEvent::GestureLongPress: event.x = point.x; event.y = point.y; + if (arguments.size() >= 4) { + event.data.tapDown.width = static_cast<float>(arguments[2].toDouble()); + event.data.tapDown.height = static_cast<float>(arguments[3].toDouble()); + } break; case WebInputEvent::GestureTwoFingerTap: event.x = point.x; event.y = point.y; + if (arguments.size() >= 4) { + event.data.twoFingerTap.firstFingerWidth = static_cast<float>(arguments[2].toDouble()); + event.data.twoFingerTap.firstFingerHeight = static_cast<float>(arguments[3].toDouble()); + } break; default: ASSERT_NOT_REACHED(); @@ -1217,7 +1219,7 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& event.globalX = event.x; event.globalY = event.y; - event.timeStampSeconds = getCurrentEventTimeSec(); + event.timeStampSeconds = getCurrentEventTimeSec(m_delegate); webview()->handleInputEvent(event); } @@ -1229,7 +1231,7 @@ void EventSender::gestureFlingCancel(const CppArgumentList& arguments, CppVarian WebGestureEvent event; event.type = WebInputEvent::GestureFlingCancel; - event.timeStampSeconds = getCurrentEventTimeSec(); + event.timeStampSeconds = getCurrentEventTimeSec(m_delegate); webview()->handleInputEvent(event); } @@ -1253,7 +1255,7 @@ void EventSender::gestureFlingStart(const CppArgumentList& arguments, CppVariant event.data.flingStart.velocityX = static_cast<float>(arguments[2].toDouble()); event.data.flingStart.velocityY = static_cast<float>(arguments[3].toDouble()); - event.timeStampSeconds = getCurrentEventTimeSec(); + event.timeStampSeconds = getCurrentEventTimeSec(m_delegate); webview()->handleInputEvent(event); } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp new file mode 100644 index 000000000..c339f2f2b --- /dev/null +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp @@ -0,0 +1,248 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "KeyCodeMapping.h" + +#include <wtf/UnusedParam.h> + +namespace WebTestRunner { + +int NativeKeyCodeForWindowsKeyCode(int keysym) +{ +#if OS(LINUX) && USE(GTK) + // See /usr/share/X11/xkb/keycodes/* + static const int asciiToKeyCode[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 22, + 23, + 0, + 0, + 0, + 36, + 0, + 0, + 50, + 37, + 64, + 127, + 66, + 0, + 0, + 0, + 0, + 131, + 0, + 9, + 100, + 102, + 0, + 0, + 65, // ' ' + 112, // '!' + 117, // '"' + 115, // '#' + 110, // '$' + 113, // '%' + 111, // '&' + 114, // ''' + 116, // '(' + 0, // ')' + 107, // '*' + 0, // '+' + 0, // ',' + 118, // '-' + 119, // '.' + 146, // '/' + 19, // '0' + 10, // '1' + 11, // '2' + 12, // '3' + 13, // '4' + 14, // '5' + 15, // '6' + 16, // '7' + 17, // '8' + 18, // '9' + 0, // ':' + 0, // ';' + 0, // '<' + 0, // '=' + 0, // '>' + 0, // '?' + 0, // '@' + 38, // 'A' + 56, // 'B' + 54, // 'C' + 40, // 'D' + 26, // 'E' + 41, // 'F' + 42, // 'G' + 43, // 'H' + 31, // 'I' + 44, // 'J' + 45, // 'K' + 46, // 'L' + 58, // 'M' + 57, // 'N' + 32, // 'O' + 33, // 'P' + 24, // 'Q' + 27, // 'R' + 39, // 'S' + 28, // 'T' + 30, // 'U' + 55, // 'V' + 25, // 'W' + 53, // 'X' + 29, // 'Y' + 52, // 'Z' + 133, // '[' + 134, // '\' + 135, // ']' + 0, // '^' + 0, // '_' + 90, // '`' + 38, // 'a' + 56, // 'b' + 54, // 'c' + 40, // 'd' + 26, // 'e' + 41, // 'f' + 42, // 'g' + 43, // 'h' + 31, // 'i' + 44, // 'j' + 45, // 'k' + 46, // 'l' + 58, // 'm' + 57, // 'n' + 32, // 'o' + 33, // 'p' + 24, // 'q' + 27, // 'r' + 39, // 's' + 28, // 't' + 30, // 'u' + 55, // 'v' + 25, // 'w' + 53, // 'x' + 29, // 'y' + 52, // 'z' + 96, // '{' + 0, // '|' + 0, // '}' + 0, // '~' + 0, // DEL + }; + + if (keysym <= 127) + return asciiToKeyCode[keysym]; + + switch (keysym) { + case VKEY_PRIOR: + return 112; + case VKEY_NEXT: + return 117; + case VKEY_END: + return 115; + case VKEY_HOME: + return 110; + case VKEY_LEFT: + return 113; + case VKEY_UP: + return 111; + case VKEY_RIGHT: + return 114; + case VKEY_DOWN: + return 116; + case VKEY_SNAPSHOT: + return 107; + case VKEY_INSERT: + return 118; + case VKEY_DELETE: + return 119; + case VKEY_APPS: + return 135; + case VKEY_F1: + case VKEY_F1 + 1: + case VKEY_F1 + 2: + case VKEY_F1 + 3: + case VKEY_F1 + 4: + case VKEY_F1 + 5: + case VKEY_F1 + 6: + case VKEY_F1 + 7: + case VKEY_F1 + 8: + case VKEY_F1 + 9: + case VKEY_F1 + 10: + case VKEY_F1 + 11: + case VKEY_F1 + 12: + case VKEY_F1 + 13: + case VKEY_F1 + 14: + case VKEY_F1 + 15: + case VKEY_F1 + 16: + case VKEY_F1 + 17: + case VKEY_F1 + 18: + case VKEY_F1 + 19: + case VKEY_F1 + 20: + case VKEY_F1 + 21: + case VKEY_F1 + 22: + case VKEY_F1 + 23: + return 67 + (keysym - VKEY_F1); + case VKEY_LSHIFT: + return 50; + case VKEY_RSHIFT: + return 62; + case VKEY_LCONTROL: + return 37; + case VKEY_RCONTROL: + return 105; + case VKEY_LMENU: + return 64; + case VKEY_RMENU: + return 108; + + default: + return 0; + } +#else + UNUSED_PARAM(keysym); + return 0; +#endif +} + +} diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h new file mode 100644 index 000000000..87469fac4 --- /dev/null +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef KeyCodeMapping_h +#define KeyCodeMapping_h + +namespace WebTestRunner { + +// The keycodes match the values of the virtual keycodes found here http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx +enum { + VKEY_RETURN = 0x0D, + VKEY_PRIOR = 0x21, + VKEY_NEXT = 0x22, + VKEY_END = 0x23, + VKEY_HOME = 0x24, + VKEY_LEFT = 0x25, + VKEY_UP = 0x26, + VKEY_RIGHT = 0x27, + VKEY_DOWN = 0x28, + VKEY_SNAPSHOT = 0x2C, + VKEY_INSERT = 0x2D, + VKEY_DELETE = 0x2E, + VKEY_APPS = 0x5D, + VKEY_F1 = 0x70, + VKEY_LSHIFT = 0xA0, + VKEY_RSHIFT = 0xA1, + VKEY_LCONTROL = 0xA2, + VKEY_RCONTROL = 0xA3, + VKEY_LMENU = 0xA4, + VKEY_RMENU = 0xA5, +}; + +// Map a windows keycode to a native keycode on OS(LINUX) && USE(GTK). +int NativeKeyCodeForWindowsKeyCode(int keysym); + +} + +#endif // KeyCodeMapping_h diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h index 218bbdf42..0498fcb3f 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h @@ -51,10 +51,12 @@ public: virtual void setEditCommand(const std::string& name, const std::string& value) = 0; virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; virtual void setGamepadData(const WebKit::WebGamepads&) = 0; - virtual void printMessage(const std::string& message) const = 0; + virtual void printMessage(const std::string& message) = 0; virtual void postTask(WebTestRunner::WebTask*) = 0; virtual void postDelayedTask(WebTestRunner::WebTask*, long long ms) = 0; virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) = 0; + virtual long long getCurrentTimeInMillisecond() = 0; + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0; }; #endif // TestDelegate_h diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp index e6ead1551..f0da79831 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp @@ -32,51 +32,6 @@ #include "config.h" #include "TestRunner.h" -#include "WebAnimationController.h" -#include "WebBindings.h" -#include "WebConsoleMessage.h" -#include "WebDeviceOrientation.h" -#include "WebDeviceOrientationClientMock.h" -#include "WebDocument.h" -#include "WebElement.h" -#include "WebFindOptions.h" -#include "WebFrame.h" -#include "WebGeolocationClientMock.h" -#include "WebIDBFactory.h" -#include "WebInputElement.h" -#include "WebIntent.h" -#include "WebIntentRequest.h" -#include "WebKit.h" -#include "WebNotificationPresenter.h" -#include "WebPrintParams.h" -#include "WebScriptSource.h" -#include "WebSecurityPolicy.h" -#include "WebSettings.h" -#include "WebSurroundingText.h" -#include "WebView.h" -#include "WebWorkerInfo.h" -#include "platform/WebData.h" -#include "platform/WebSerializedScriptValue.h" -#include "platform/WebSize.h" -#include "platform/WebURL.h" -#include "v8/include/v8.h" -#include "webkit/support/webkit_support.h" -#include <algorithm> -#include <clocale> -#include <cstdlib> -#include <limits> -#include <sstream> -#include <wtf/OwnArrayPtr.h> -#include <wtf/text/WTFString.h> - -#if OS(LINUX) || OS(ANDROID) -#include "linux/WebFontRendering.h" -#endif - -using namespace WebCore; -using namespace WebKit; -using namespace std; - TestRunner::TestRunner() { } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h index 39e19d573..503271b5d 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h @@ -33,21 +33,6 @@ #define TestRunner_h #include "CppBoundClass.h" -#include "WebDeliveredIntentClient.h" -#include "WebTextDirection.h" -#include "platform/WebArrayBufferView.h" -#include "platform/WebString.h" -#include "platform/WebURL.h" -#include <wtf/Deque.h> -#include <wtf/OwnPtr.h> - -namespace WebKit { -class WebGeolocationClientMock; -} - -namespace webkit_support { -class ScopedTempDirectory; -} class TestRunner : public CppBoundClass { public: diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp index 632d9664b..9a86953c3 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp @@ -63,10 +63,12 @@ public: virtual void setEditCommand(const std::string& name, const std::string& value); virtual WebContextMenuData* lastContextMenuData() const; virtual void setGamepadData(const WebGamepads&); - virtual void printMessage(const std::string& message) const; + virtual void printMessage(const std::string& message); virtual void postTask(WebTask*); virtual void postDelayedTask(WebTask*, long long ms); virtual WebString registerIsolatedFileSystem(const WebVector<WebString>& absoluteFilenames); + virtual long long getCurrentTimeInMillisecond(); + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path); private: TestInterfaces m_interfaces; @@ -127,7 +129,7 @@ void WebTestInterfaces::Internal::setGamepadData(const WebGamepads& pads) m_delegate->setGamepadData(pads); } -void WebTestInterfaces::Internal::printMessage(const std::string& message) const +void WebTestInterfaces::Internal::printMessage(const std::string& message) { m_delegate->printMessage(message); } @@ -147,6 +149,16 @@ WebString WebTestInterfaces::Internal::registerIsolatedFileSystem(const WebVecto return m_delegate->registerIsolatedFileSystem(absoluteFilenames); } +long long WebTestInterfaces::Internal::getCurrentTimeInMillisecond() +{ + return m_delegate->getCurrentTimeInMillisecond(); +} + +WebKit::WebString WebTestInterfaces::Internal::getAbsoluteWebStringFromUTF8Path(const std::string& path) +{ + return m_delegate->getAbsoluteWebStringFromUTF8Path(path); +} + WebTestInterfaces::WebTestInterfaces() { m_internal = new Internal; diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index 2692e7458..4c42dc0dd 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -35,6 +35,7 @@ #include "DRTDevToolsClient.h" #include "DRTTestRunner.h" #include "MockWebPrerenderingSupport.h" +#include "WebCache.h" #include "WebDataSource.h" #include "WebDocument.h" #include "WebElement.h" @@ -109,6 +110,7 @@ TestShell::TestShell() , m_dumpPixelsForCurrentTest(false) , m_allowExternalPages(false) , m_acceleratedCompositingForVideoEnabled(false) + , m_acceleratedCompositingForFixedPositionEnabled(false) , m_softwareCompositingEnabled(false) , m_threadedCompositingEnabled(false) , m_forceCompositingMode(false) @@ -144,6 +146,7 @@ TestShell::TestShell() WebRuntimeFeatures::enableShadowDOM(true); WebRuntimeFeatures::enableStyleScoped(true); WebRuntimeFeatures::enableScriptedSpeech(true); + WebRuntimeFeatures::enableRequestAutocomplete(true); // 30 second is the same as the value in Mac DRT. // If we use a value smaller than the timeout value of @@ -228,6 +231,7 @@ void TestShell::resetWebSettings(WebView& webView) m_prefs.reset(); m_prefs.acceleratedCompositingEnabled = true; m_prefs.acceleratedCompositingForVideoEnabled = m_acceleratedCompositingForVideoEnabled; + m_prefs.acceleratedCompositingForFixedPositionEnabled = m_acceleratedCompositingForFixedPositionEnabled; m_prefs.forceCompositingMode = m_forceCompositingMode; m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled; m_prefs.deferred2dCanvasEnabled = m_deferred2dCanvasEnabled; @@ -318,6 +322,7 @@ void TestShell::resetTestController() webView()->setFixedLayoutSize(WebSize(0, 0)); webView()->mainFrame()->clearOpener(); WebTestingSupport::resetInternalsObject(webView()->mainFrame()); + WebCache::clear(); } void TestShell::loadURL(const WebURL& url) @@ -387,6 +392,11 @@ void TestShell::setPerTilePaintingEnabled(bool enabled) Platform::current()->compositorSupport()->setPerTilePaintingEnabled(enabled); } +void TestShell::setAcceleratedAnimationEnabled(bool enabled) +{ + Platform::current()->compositorSupport()->setAcceleratedAnimationEnabled(enabled); +} + static string dumpDocumentText(WebFrame* frame) { // We use the document element's text instead of the body text here because diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 03315690e..12e1dbbef 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -128,6 +128,7 @@ public: void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } void setAcceleratedCompositingForVideoEnabled(bool enabled) { m_acceleratedCompositingForVideoEnabled = enabled; } + void setAcceleratedCompositingForFixedPositionEnabled(bool enabled) { m_acceleratedCompositingForFixedPositionEnabled = enabled; } bool softwareCompositingEnabled() { return m_softwareCompositingEnabled; } void setSoftwareCompositingEnabled(bool enabled) { m_softwareCompositingEnabled = enabled; } void setThreadedCompositingEnabled(bool enabled) { m_threadedCompositingEnabled = enabled; } @@ -136,6 +137,7 @@ public: void setDeferred2dCanvasEnabled(bool enabled) { m_deferred2dCanvasEnabled = enabled; } void setAcceleratedPaintingEnabled(bool enabled) { m_acceleratedPaintingEnabled = enabled; } void setPerTilePaintingEnabled(bool); + void setAcceleratedAnimationEnabled(bool); void setDeferredImageDecodingEnabled(bool enabled) { m_deferredImageDecodingEnabled = enabled; } #if defined(OS_WIN) // Access to the finished event. Used by the static WatchDog thread. @@ -227,6 +229,7 @@ private: int m_timeout; // timeout value in millisecond bool m_allowExternalPages; bool m_acceleratedCompositingForVideoEnabled; + bool m_acceleratedCompositingForFixedPositionEnabled; bool m_softwareCompositingEnabled; bool m_threadedCompositingEnabled; bool m_forceCompositingMode; diff --git a/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp b/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp index 7080bef18..414db2c1c 100644 --- a/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp +++ b/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp @@ -206,6 +206,8 @@ void TestWebPlugin::updateGeometry(const WebRect& frameRect, if (clipRect == m_rect) return; m_rect = clipRect; + if (m_rect.isEmpty()) + return; m_context->reshape(m_rect.width, m_rect.height); m_context->viewport(0, 0, m_rect.width, m_rect.height); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp index 5c8c92c99..46afbbdb2 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp @@ -85,6 +85,7 @@ void WebPreferences::reset() javaEnabled = false; javaScriptCanAccessClipboard = true; javaScriptCanOpenWindowsAutomatically = true; + supportsMultipleWindows = true; javaScriptEnabled = true; loadsImagesAutomatically = true; localStorageEnabled = true; @@ -111,6 +112,7 @@ void WebPreferences::reset() tabsToLinks = false; hyperlinkAuditingEnabled = false; acceleratedCompositingForVideoEnabled = false; + acceleratedCompositingForFixedPositionEnabled = false; acceleratedCompositingEnabled = false; accelerated2dCanvasEnabled = false; deferred2dCanvasEnabled = false; @@ -120,6 +122,7 @@ void WebPreferences::reset() mediaPlaybackRequiresUserGesture = false; mockScrollbarsEnabled = false; cssCustomFilterEnabled = false; + shouldRespectImageOrientation = false; } static void setStandardFontFamilyWrapper(WebSettings* settings, const WebKit::WebString& font, UScriptCode script) @@ -201,6 +204,7 @@ void WebPreferences::applyTo(WebView* webView) settings->setJavaEnabled(javaEnabled); settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard); settings->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically); + settings->setSupportsMultipleWindows(supportsMultipleWindows); settings->setJavaScriptEnabled(javaScriptEnabled); settings->setLoadsImagesAutomatically(loadsImagesAutomatically); settings->setLocalStorageEnabled(localStorageEnabled); @@ -221,6 +225,8 @@ void WebPreferences::applyTo(WebView* webView) settings->setCaretBrowsingEnabled(caretBrowsingEnabled); settings->setAcceleratedCompositingEnabled(acceleratedCompositingEnabled); settings->setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); + settings->setAcceleratedCompositingForFixedPositionEnabled(acceleratedCompositingForFixedPositionEnabled); + settings->setFixedPositionCreatesStackingContext(acceleratedCompositingForFixedPositionEnabled); settings->setForceCompositingMode(forceCompositingMode); settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled); settings->setDeferred2dCanvasEnabled(deferred2dCanvasEnabled); @@ -229,6 +235,7 @@ void WebPreferences::applyTo(WebView* webView) settings->setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture); settings->setMockScrollbarsEnabled(mockScrollbarsEnabled); settings->setApplyDefaultDeviceScaleFactorInCompositor(forceCompositingMode); + settings->setShouldRespectImageOrientation(shouldRespectImageOrientation); // Fixed values. settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h index e0315f2d0..36fcd196f 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.h +++ b/Tools/DumpRenderTree/chromium/WebPreferences.h @@ -87,6 +87,7 @@ struct WebPreferences { bool javaEnabled; bool javaScriptCanAccessClipboard; bool javaScriptCanOpenWindowsAutomatically; + bool supportsMultipleWindows; bool javaScriptEnabled; bool loadsImagesAutomatically; bool localStorageEnabled; @@ -104,6 +105,7 @@ struct WebPreferences { bool hyperlinkAuditingEnabled; bool caretBrowsingEnabled; bool acceleratedCompositingForVideoEnabled; + bool acceleratedCompositingForFixedPositionEnabled; bool acceleratedCompositingEnabled; bool forceCompositingMode; bool accelerated2dCanvasEnabled; @@ -113,6 +115,7 @@ struct WebPreferences { bool mediaPlaybackRequiresUserGesture; bool mockScrollbarsEnabled; bool cssCustomFilterEnabled; + bool shouldRespectImageOrientation; WebPreferences() { reset(); } void reset(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 18422db58..98b87bf8e 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -696,6 +696,12 @@ void WebViewHost::postAccessibilityNotification(const WebAccessibilityObject& ob case WebAccessibilityNotificationInvalidStatusChanged: notificationName = "InvalidStatusChanged"; break; + case WebAccessibilityNotificationTextChanged: + notificationName = "TextChanged"; + break; + case WebAccessibilityNotificationAriaAttributeChanged: + notificationName = "AriaAttributeChanged"; + break; default: notificationName = "UnknownNotification"; break; @@ -1480,7 +1486,7 @@ void WebViewHost::setGamepadData(const WebGamepads& pads) webkit_support::SetGamepadData(pads); } -void WebViewHost::printMessage(const std::string& message) const +void WebViewHost::printMessage(const std::string& message) { printf("%s", message.c_str()); } @@ -1500,6 +1506,16 @@ WebString WebViewHost::registerIsolatedFileSystem(const WebVector<WebString>& ab return webkit_support::RegisterIsolatedFileSystem(absoluteFilenames); } +long long WebViewHost::getCurrentTimeInMillisecond() +{ + return webkit_support::GetCurrentTimeInMillisecond(); +} + +WebKit::WebString WebViewHost::getAbsoluteWebStringFromUTF8Path(const std::string& path) +{ + return webkit_support::GetAbsoluteWebStringFromUTF8Path(path); +} + // Public functions ----------------------------------------------------------- WebViewHost::WebViewHost(TestShell* shell) diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 41237cba9..86007194b 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -135,10 +135,12 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual void clearEditCommand() OVERRIDE; virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) OVERRIDE; virtual void setGamepadData(const WebKit::WebGamepads&) OVERRIDE; - virtual void printMessage(const std::string& message) const OVERRIDE; + virtual void printMessage(const std::string& message) OVERRIDE; virtual void postTask(WebTestRunner::WebTask*) OVERRIDE; virtual void postDelayedTask(WebTestRunner::WebTask*, long long ms) OVERRIDE; virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) OVERRIDE; + virtual long long getCurrentTimeInMillisecond() OVERRIDE; + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) OVERRIDE; // NavigationHost virtual bool navigate(const TestNavigationEntry&, bool reload); diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp index a0dec4e7a..3d1c112e0 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp @@ -66,6 +66,7 @@ RefPtr<TestRunner> gTestRunner; volatile bool done = false; static bool dumpPixelsForCurrentTest; +static int dumpPixelsForAllTests = false; static int dumpTree = true; static int printSeparators = true; @@ -192,6 +193,7 @@ static bool parseCommandLineOptions(int argc, char** argv) { static const option options[] = { {"notree", no_argument, &dumpTree, false}, + {"pixel-tests", no_argument, &dumpPixelsForAllTests, true}, {"tree", no_argument, &dumpTree, true}, {0, 0, 0, 0} }; @@ -258,7 +260,7 @@ static void runTest(const char* inputLine) TestCommand command = parseInputLine(inputLine); const String testPathOrURL(command.pathOrURL.c_str()); ASSERT(!testPathOrURL.isEmpty()); - dumpPixelsForCurrentTest = command.shouldDumpPixels; + dumpPixelsForCurrentTest = command.shouldDumpPixels || dumpPixelsForAllTests; const String expectedPixelHash(command.expectedPixelHash.c_str()); // Convert the path into a full file URL if it does not look @@ -419,7 +421,11 @@ void dump() static Ecore_Evas* initEcoreEvas() { - Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0); + const char* engine = 0; +#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X) + engine = "opengl_x11"; +#endif + Ecore_Evas* ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0); if (!ecoreEvas) { shutdownEfl(); exit(EXIT_FAILURE); diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp index d1ba5ff8f..fb9c717e2 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp @@ -196,6 +196,8 @@ void DumpRenderTreeChrome::removeWindow(Evas_Object* view) bool DumpRenderTreeChrome::initialize() { + // Notifies that DRT is running for ewkView to create testable objects. + DumpRenderTreeSupportEfl::setDumpRenderTreeModeEnabled(true); DumpRenderTreeSupportEfl::setMockScrollbarsEnabled(true); m_mainView = createView(); @@ -308,6 +310,7 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues() DumpRenderTreeSupportEfl::clearOpener(mainFrame()); DumpRenderTreeSupportEfl::clearUserScripts(mainView()); DumpRenderTreeSupportEfl::clearUserStyleSheets(mainView()); + DumpRenderTreeSupportEfl::resetGeolocationClientMock(mainView()); DumpRenderTreeSupportEfl::setInteractiveFormValidationEnabled(mainView(), true); DumpRenderTreeSupportEfl::setValidationMessageTimerMagnification(mainView(), -1); DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(mainView(), true); diff --git a/Tools/DumpRenderTree/efl/EventSender.cpp b/Tools/DumpRenderTree/efl/EventSender.cpp index 78d2dbcf3..e2ff5e1f6 100644 --- a/Tools/DumpRenderTree/efl/EventSender.cpp +++ b/Tools/DumpRenderTree/efl/EventSender.cpp @@ -269,6 +269,102 @@ static unsigned modifiersFromJSValue(JSContextRef context, const JSValueRef modi return modifier; } +static JSValueRef getMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) +{ + Ewk_Context_Menu_Item* item = static_cast<Ewk_Context_Menu_Item*>(JSObjectGetPrivate(object)); + CString label; + if (ewk_context_menu_item_type_get(item) == EWK_SEPARATOR_TYPE) + label = "<separator>"; + else + label = ewk_context_menu_item_title_get(item); + + return JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data())); +} + +static bool setMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + return true; +} + +static JSValueRef menuItemClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + Ewk_Context_Menu_Item* item = static_cast<Ewk_Context_Menu_Item*>(JSObjectGetPrivate(thisObject)); + ewk_context_menu_item_select(ewk_context_menu_item_parent_get(item), item); + return JSValueMakeUndefined(context); +} + +static JSStaticFunction staticMenuItemFunctions[] = { + { "click", menuItemClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { 0, 0, 0 } +}; + +static JSStaticValue staticMenuItemValues[] = { + { "title", getMenuItemTitleCallback, setMenuItemTitleCallback, kJSPropertyAttributeNone }, + { 0, 0, 0, 0 } +}; + +static JSClassRef getMenuItemClass() +{ + static JSClassRef menuItemClass = 0; + + if (!menuItemClass) { + JSClassDefinition classDefinition = { + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + classDefinition.staticFunctions = staticMenuItemFunctions; + classDefinition.staticValues = staticMenuItemValues; + + menuItemClass = JSClassCreate(&classDefinition); + } + + return menuItemClass; +} + +static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + Evas_Object* view = ewk_frame_view_get(browser->mainFrame()); + if (!view) + return JSValueMakeUndefined(context); + + Evas* evas = evas_object_evas_get(view); + if (!evas) + return JSValueMakeUndefined(context); + + Evas_Event_Mouse_Down mouseDown; + mouseDown.button = 3; + mouseDown.output.x = gLastMousePositionX; + mouseDown.output.y = gLastMousePositionY; + mouseDown.canvas.x = gLastMousePositionX; + mouseDown.canvas.y = gLastMousePositionY; + mouseDown.data = 0; + mouseDown.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas)); + mouseDown.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas)); + mouseDown.flags = EVAS_BUTTON_NONE; + mouseDown.timestamp = ecore_loop_time_get(); + mouseDown.event_flags = EVAS_EVENT_FLAG_NONE; + mouseDown.dev = 0; + + ewk_view_context_menu_forward_event(view, &mouseDown); + Ewk_Context_Menu* ewkMenu = ewk_view_context_menu_get(view); + + JSValueRef valueRef = JSObjectMakeArray(context, 0, 0, 0); + if (ewkMenu) { + const Eina_List* ewkMenuItems = ewk_context_menu_item_list_get(ewkMenu); + JSValueRef arrayValues[eina_list_count(ewkMenuItems)]; + + const Eina_List* listIterator; + void* data; + int index = 0; + EINA_LIST_FOREACH(ewkMenuItems, listIterator, data) + arrayValues[index++] = JSObjectMake(context, getMenuItemClass(), data); + + if (index) + valueRef = JSObjectMakeArray(context, index - 1, arrayValues, 0); + } + + return valueRef; +} + static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { int button = 0; @@ -803,6 +899,7 @@ static JSValueRef setTouchModifierCallback(JSContextRef context, JSObjectRef fun } static JSStaticFunction staticFunctions[] = { + { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "mouseScrollBy", mouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "continuousMouseScrollBy", continuousMouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, diff --git a/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp b/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp index efc506160..446483652 100644 --- a/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp +++ b/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp @@ -47,13 +47,12 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool const Evas_Object* mainFrame = browser->mainFrame(); int x, y, width, height; - if (!ewk_frame_visible_content_geometry_get(mainFrame, EINA_TRUE, &x, &y, &width, &height)) - return 0; + evas_object_geometry_get(browser->mainFrame(), &x, &y, &width, &height); + const Eina_Rectangle rect = { x, y, width, height }; - RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height)); + RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, rect.w, rect.h)); RefPtr<cairo_t> context = adoptRef(cairo_create(surface.get())); - const Eina_Rectangle rect = { x, y, width, height }; if (!ewk_view_paint(privateData, context.get(), &rect)) return 0; diff --git a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp index 19703aee6..cd78b10aa 100644 --- a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp +++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp @@ -365,30 +365,41 @@ void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, doub notImplemented(); } -void TestRunner::setMockGeolocationPosition(double, double, double, bool, double, bool, double, bool, double, bool, double) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool canProvideAltitude, double altitude, bool canProvideAltitudeAccuracy, double altitudeAccuracy, bool canProvideHeading, double heading, bool canProvideSpeed, double speed) { - // FIXME: Implement for Geolocation layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=28264. - notImplemented(); + Evas_Object* view = browser->mainView(); + if (browser->extraViews().size() > 0) + view = browser->extraViews().last(); + + DumpRenderTreeSupportEfl::setMockGeolocationPosition(view, latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading, canProvideSpeed, speed); } -void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef) +void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message) { - // FIXME: Implement for Geolocation layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=28264. - notImplemented(); + Evas_Object* view = browser->mainView(); + if (browser->extraViews().size() > 0) + view = browser->extraViews().last(); + + DumpRenderTreeSupportEfl::setMockGeolocationPositionUnavailableError(view, message->string().utf8().data()); } void TestRunner::setGeolocationPermission(bool allow) { - // FIXME: Implement for Geolocation layout tests. setGeolocationPermissionCommon(allow); + Evas_Object* view = browser->mainView(); + if (browser->extraViews().size() > 0) + view = browser->extraViews().last(); + + DumpRenderTreeSupportEfl::setMockGeolocationPermission(view, allow); } int TestRunner::numberOfPendingGeolocationPermissionRequests() { - // FIXME: Implement for Geolocation layout tests. - return -1; + Evas_Object* view = browser->mainView(); + if (browser->extraViews().size() > 0) + view = browser->extraViews().last(); + + return DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests(view); } void TestRunner::addMockSpeechInputResult(JSStringRef, double, JSStringRef) diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp index f574c11e8..bf687b2d3 100644 --- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -73,6 +73,7 @@ extern gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame); volatile bool done; static bool printSeparators; +static int dumpPixelsForAllTests = false; static bool dumpPixelsForCurrentTest; static int dumpTree = 1; static int useTimeoutWatchdog = 1; @@ -548,6 +549,7 @@ static void initializeGlobalsFromCommandLineOptions(int argc, char *argv[]) { struct option options[] = { {"notree", no_argument, &dumpTree, false}, + {"pixel-tests", no_argument, &dumpPixelsForAllTests, true}, {"tree", no_argument, &dumpTree, true}, {"no-timeout", no_argument, &useTimeoutWatchdog, false}, {NULL, 0, NULL, 0} @@ -645,10 +647,6 @@ static void setDefaultsToConsistentStateValuesForTesting() { resetDefaultsToConsistentValues(); - /* Disable the default auth dialog for testing */ - SoupSession* session = webkit_get_default_session(); - soup_session_remove_feature_by_type(session, WEBKIT_TYPE_SOUP_AUTH_DIALOG); - #if PLATFORM(X11) webkit_web_settings_add_extra_plugin_directory(webView, TEST_PLUGIN_DIR); #endif @@ -696,7 +694,7 @@ static void runTest(const string& inputLine) TestCommand command = parseInputLine(inputLine); string& testURL = command.pathOrURL; - dumpPixelsForCurrentTest = command.shouldDumpPixels; + dumpPixelsForCurrentTest = command.shouldDumpPixels || dumpPixelsForAllTests; // Convert the path into a full file URL if it does not look // like an HTTP/S URL (doesn't start with http:// or https://). diff --git a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig index 3bc7a2a84..be91f5e50 100644 --- a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig +++ b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig @@ -21,8 +21,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "CompilerVersion.xcconfig" - +CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; +CLANG_CXX_LIBRARY = libc++; CLANG_WARN_CXX0X_EXTENSIONS = NO; HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include ForwardingHeaders mac/InternalHeaders $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport ${SRCROOT}/../../Source/JavaScriptCore/icu; FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks; @@ -34,29 +34,17 @@ GCC_ENABLE_CPP_RTTI = NO; GCC_OBJC_CALL_CXX_CDTORS = YES GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_TREAT_WARNINGS_AS_ERRORS = YES +GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES WARNING_CFLAGS = -Wall -W -Wno-unused-parameter -Wundef LINKER_DISPLAYS_MANGLED_NAMES = YES; -CLANG_CXX_LIBRARY = $(CLANG_CXX_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -CLANG_CXX_LIBRARY_1060 = libstdc++; -CLANG_CXX_LIBRARY_1070 = libc++; -CLANG_CXX_LIBRARY_1080 = libc++; -CLANG_CXX_LIBRARY_1090 = libc++; - -REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME)); -REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx); -REAL_PLATFORM_NAME_iphoneos = iphoneos; -REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator; -REAL_PLATFORM_NAME_macosx = macosx; - TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); TARGETING_SAME_OS_X_VERSION = $(TARGETING_SAME_OS_X_VERSION_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -TARGETING_SAME_OS_X_VERSION_1060_1060 = YES; TARGETING_SAME_OS_X_VERSION_1070_1070 = YES; TARGETING_SAME_OS_X_VERSION_1080_1080 = YES; TARGETING_SAME_OS_X_VERSION_1090_1090 = YES; diff --git a/Tools/DumpRenderTree/mac/Configurations/CompilerVersion.xcconfig b/Tools/DumpRenderTree/mac/Configurations/CompilerVersion.xcconfig deleted file mode 100644 index a8c7f75a0..000000000 --- a/Tools/DumpRenderTree/mac/Configurations/CompilerVersion.xcconfig +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -IS_XCODE_0400 = $(IS_XCODE_0400_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_0400 = YES; - -IS_XCODE_0400_OR_0410 = $(IS_XCODE_0400_OR_0410_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_OR_0410_0400 = YES; -IS_XCODE_0400_OR_0410_0410 = YES; - -// The version of the LLVM Compiler in Xcode 4.0 and earlier have difficulty compiling our code. -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_$(IS_XCODE_0400)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_YES = YES; - -// The version of the LLVM Compiler in Xcode 4.1 and earlier do not generate fast enough code. -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_$(IS_XCODE_0400_OR_0410)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_YES = YES; - -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_YES = NO; - -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_YES = NO; - - -// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0. -// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version -// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and -// XCODE_VERSION_ACTUAL for the full version number. -TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(REAL_PLATFORM_NAME)); -TARGET_GCC_VERSION_iphoneos = LLVM_GCC_42; -TARGET_GCC_VERSION_iphonesimulator = GCC_42; -TARGET_GCC_VERSION_macosx = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); - -TARGET_GCC_VERSION_macosx_1050 = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_MINOR)); -TARGET_GCC_VERSION_macosx_1050_ = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_ACTUAL)); -TARGET_GCC_VERSION_macosx_1050_0310 = GCC_42; -TARGET_GCC_VERSION_macosx_1050_0320 = GCC_42; - -TARGET_GCC_VERSION_macosx_1060 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1070 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Debug = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Release = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Production = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_NON_LLVM_FALLBACK = GCC_42; -TARGET_GCC_VERSION_macosx_1070_NON_LLVM_FALLBACK = LLVM_GCC_42; - -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_YES = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_NO = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)_NON_LLVM_FALLBACK); - -TARGET_GCC_VERSION_macosx_1080 = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_1090 = LLVM_COMPILER; - -GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); -GCC_VERSION_GCC_40 = 4.0; -GCC_VERSION_GCC_42 = 4.2; -GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; -GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0; diff --git a/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig b/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig index 8e3528d2d..fd5ebdbd1 100644 --- a/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig +++ b/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig @@ -23,28 +23,19 @@ #include "Base.xcconfig" -ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ARCHS_1050 = $(NATIVE_ARCH); -ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1080 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1090 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS = $(ARCHS_STANDARD_32_64_BIT); ONLY_ACTIVE_ARCH = YES; MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) -MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; -MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; MACOSX_DEPLOYMENT_TARGET_1080 = 10.8; MACOSX_DEPLOYMENT_TARGET_1090 = 10.9; -WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(REAL_PLATFORM_NAME)); +WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(PLATFORM_NAME)); WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos = WebKitSystemInterface; WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphonesimulator = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos); WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1050 = WebKitSystemInterfaceLeopard; -WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1060 = WebKitSystemInterfaceSnowLeopard; WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1070 = WebKitSystemInterfaceLion; WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1080 = WebKitSystemInterfaceMountainLion; WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1090 = WebKitSystemInterfaceMountainLion; diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm index 029b358a0..3cd121488 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm @@ -145,6 +145,7 @@ static HistoryDelegate *historyDelegate; PolicyDelegate *policyDelegate; StorageTrackerDelegate *storageDelegate; +static int dumpPixelsForAllTests = NO; static bool dumpPixelsForCurrentTest; static int threaded; static int dumpTree = YES; @@ -328,6 +329,7 @@ static NSSet *allowedFontFamilySet() @"STFangsong", @"STHeiti", @"STIXGeneral", + @"STIXSizeOneSym", @"STKaiti", @"STSong", @"Symbol", @@ -614,6 +616,8 @@ static void resetDefaultsToConsistentValues() [defaults setObject:[path stringByAppendingPathComponent:@"LocalStorage"] forKey:WebStorageDirectoryDefaultsKey]; [defaults setObject:[path stringByAppendingPathComponent:@"LocalCache"] forKey:WebKitLocalCacheDefaultsKey]; + [defaults setBool:NO forKey:@"WebKitKerningAndLigaturesEnabledByDefault"]; + WebPreferences *preferences = [WebPreferences standardPreferences]; [preferences setAllowUniversalAccessFromFileURLs:YES]; @@ -789,6 +793,7 @@ static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[] { struct option options[] = { {"notree", no_argument, &dumpTree, NO}, + {"pixel-tests", no_argument, &dumpPixelsForAllTests, YES}, {"tree", no_argument, &dumpTree, YES}, {"threaded", no_argument, &threaded, YES}, {"complex-text", no_argument, &forceComplexText, YES}, @@ -1297,7 +1302,7 @@ static void runTest(const string& inputLine) TestCommand command = parseInputLine(inputLine); const string& pathOrURL = command.pathOrURL; - dumpPixelsForCurrentTest = command.shouldDumpPixels; + dumpPixelsForCurrentTest = command.shouldDumpPixels || dumpPixelsForAllTests; NSString *pathOrURLString = [NSString stringWithUTF8String:pathOrURL.c_str()]; if (!pathOrURLString) { diff --git a/Tools/DumpRenderTree/mac/EventSendingController.mm b/Tools/DumpRenderTree/mac/EventSendingController.mm index 482bf93db..6f328a566 100644 --- a/Tools/DumpRenderTree/mac/EventSendingController.mm +++ b/Tools/DumpRenderTree/mac/EventSendingController.mm @@ -57,6 +57,13 @@ enum MouseButton { NoMouseButton = -1 }; +struct KeyMappingEntry { + int macKeyCode; + int macNumpadKeyCode; + unichar character; + NSString* characterName; +}; + NSPoint lastMousePosition; NSPoint lastClickPosition; int lastClickButton = NoMouseButton; @@ -699,14 +706,6 @@ static int buildModifierFlags(const WebScriptObject* modifiers) keyCode = 0x4C; else if ([character isEqualToString:@"\x8"]) keyCode = 0x33; - else if ([character isEqualToString:@"7"]) - keyCode = 0x1A; - else if ([character isEqualToString:@"5"]) - keyCode = 0x17; - else if ([character isEqualToString:@"9"]) - keyCode = 0x19; - else if ([character isEqualToString:@"0"]) - keyCode = 0x1D; else if ([character isEqualToString:@"a"]) keyCode = 0x00; else if ([character isEqualToString:@"b"]) @@ -716,6 +715,38 @@ static int buildModifierFlags(const WebScriptObject* modifiers) else if ([character isEqualToString:@"e"]) keyCode = 0x0E; + KeyMappingEntry table[] = { + {0x2F, 0x41, '.', nil}, + {0, 0x43, '*', nil}, + {0, 0x45, '+', nil}, + {0, 0x47, NSClearLineFunctionKey, @"clear"}, + {0x2C, 0x4B, '/', nil}, + {0, 0x4C, 3, @"enter" }, + {0x1B, 0x4E, '-', nil}, + {0x18, 0x51, '=', nil}, + {0x1D, 0x52, '0', nil}, + {0x12, 0x53, '1', nil}, + {0x13, 0x54, '2', nil}, + {0x14, 0x55, '3', nil}, + {0x15, 0x56, '4', nil}, + {0x17, 0x57, '5', nil}, + {0x16, 0x58, '6', nil}, + {0x1A, 0x59, '7', nil}, + {0x1C, 0x5B, '8', nil}, + {0x19, 0x5C, '9', nil}, + }; + for (unsigned i = 0; i < WTF_ARRAY_LENGTH(table); ++i) { + NSString* currentCharacterString = [NSString stringWithCharacters:&table[i].character length:1]; + if ([character isEqualToString:currentCharacterString] || [character isEqualToString:table[i].characterName]) { + if (keyLocation == DOM_KEY_LOCATION_NUMPAD) + keyCode = table[i].macNumpadKeyCode; + else + keyCode = table[i].macKeyCode; + eventCharacter = currentCharacterString; + break; + } + } + NSString *charactersIgnoringModifiers = eventCharacter; int modifierFlags = 0; diff --git a/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm b/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm index 6f75b7e16..4acaac04b 100644 --- a/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm +++ b/Tools/DumpRenderTree/mac/MockGeolocationProvider.mm @@ -23,7 +23,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <wtf/Platform.h> +#import "config.h" #import "MockGeolocationProvider.h" @implementation MockGeolocationProvider diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index 1b8d8d3d7..0bd0b16a6 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -14,6 +14,7 @@ WEBKIT += wtf javascriptcore webcore INCLUDEPATH += \ $$PWD/ \ $$PWD/.. \ + $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \ $${ROOT_WEBKIT_DIR}/Source/WTF @@ -21,8 +22,6 @@ QT = core gui network testlib webkitwidgets widgets have?(QTPRINTSUPPORT): QT += printsupport macx: QT += xml -have?(FONTCONFIG): PKGCONFIG += fontconfig - HEADERS += \ $$PWD/../WorkQueue.h \ $$PWD/../DumpRenderTree.h \ @@ -32,7 +31,6 @@ HEADERS += \ WorkQueueItemQt.h \ TestRunnerQt.h \ GCControllerQt.h \ - QtInitializeTestFonts.h \ testplugin.h SOURCES += \ @@ -44,7 +42,6 @@ SOURCES += \ WorkQueueItemQt.cpp \ TestRunnerQt.cpp \ GCControllerQt.cpp \ - QtInitializeTestFonts.cpp \ testplugin.cpp \ DumpRenderTreeMain.cpp diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp index 260360142..70b5d14e6 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp @@ -29,8 +29,7 @@ #include "DumpRenderTreeQt.h" -#include "QtInitializeTestFonts.h" - +#include "QtTestSupport.h" #include <qapplication.h> #include <qdebug.h> #include <qdir.h> @@ -66,11 +65,11 @@ void messageHandler(QtMsgType type, const QMessageLogContext&, const QString &me // do nothing } -// We only support -v or --stdout or --stderr or -, all the others will be +// We only support -v, -p, --pixel-tests, --stdout, --stderr and -, all the others will be // pass as test case name (even -abc.html is a valid test case name) bool isOption(const QString& str) { - return str == QString("-v") + return str == QString("-v") || str == QString("-p") || str == QString("--pixel-tests") || str == QString("--stdout") || str == QString("--stderr") || str == QString("--timeout") || str == QString("--no-timeout") || str == QString("-"); @@ -89,8 +88,8 @@ QString takeOptionValue(QStringList& arguments, int index) void printUsage() { - fprintf(stderr, "Usage: DumpRenderTree [-v] [--stdout output_filename] [-stderr error_filename] [--no-timeout] [--timeout timeout_MS] filename [filename2..n]\n"); - fprintf(stderr, "Or folder containing test files: DumpRenderTree [-v] dirpath\n"); + fprintf(stderr, "Usage: DumpRenderTree [-v|-p|--pixel-tests] [--stdout output_filename] [-stderr error_filename] [--no-timeout] [--timeout timeout_MS] filename [filename2..n]\n"); + fprintf(stderr, "Or folder containing test files: DumpRenderTree [-v|--pixel-tests] dirpath\n"); fflush(stderr); } @@ -115,7 +114,7 @@ int main(int argc, char* argv[]) if (suppressQtDebugOutput) qInstallMessageHandler(messageHandler); - WebKit::initializeTestFonts(); + WebKit::QtTestSupport::initializeTestFonts(); QApplication::setStyle(new QWindowsStyle); QApplication::setDesktopSettingsAware(false); @@ -156,6 +155,14 @@ int main(int argc, char* argv[]) exit(1); } } + index = args.indexOf("--pixel-tests"); + if (index == -1) + index = args.indexOf("-p"); + if (index != -1) { + dumper.setShouldDumpPixelsForAllTests(); + args.removeAt(index); + } + QWebDatabase::removeAllDatabases(); index = args.indexOf(QLatin1String("--timeout")); diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 0d28cbcc1..ea114e6e0 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -36,9 +36,9 @@ #include "DumpRenderTreeSupportQt.h" #include "EventSenderQt.h" #include "GCControllerQt.h" +#include "QtTestSupport.h" #include "TestRunnerQt.h" #include "TextInputControllerQt.h" -#include "QtInitializeTestFonts.h" #include "testplugin.h" #include "WorkQueue.h" @@ -49,7 +49,6 @@ #include <QFile> #include <QFileInfo> #include <QFocusEvent> -#include <QFontDatabase> #include <QLabel> #include <QLocale> #include <QNetworkAccessManager> @@ -389,7 +388,8 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent) } DumpRenderTree::DumpRenderTree() - : m_stdin(0) + : m_dumpPixelsForAllTests(false) + , m_stdin(0) , m_enableTextOutput(false) , m_standAloneMode(false) , m_graphicsBased(false) @@ -623,9 +623,9 @@ void DumpRenderTree::open(const QUrl& url) QFocusEvent ev(QEvent::FocusIn); m_page->event(&ev); - QWebSettings::clearMemoryCaches(); - QFontDatabase::removeAllApplicationFonts(); - WebKit::initializeTestFonts(); + WebKit::QtTestSupport::clearMemoryCaches(); + + WebKit::QtTestSupport::initializeTestFonts(); DumpRenderTreeSupportQt::dumpFrameLoader(url.toString().contains("loading/")); setTextOutputEnabled(true); @@ -692,7 +692,7 @@ void DumpRenderTree::processLine(const QString &input) { TestCommand command = parseInputLine(std::string(input.toLatin1().constData())); QString pathOrURL = QLatin1String(command.pathOrURL.c_str()); - m_dumpPixelsForCurrentTest = command.shouldDumpPixels; + m_dumpPixelsForCurrentTest = command.shouldDumpPixels || m_dumpPixelsForAllTests; m_expectedHash = QLatin1String(command.expectedPixelHash.c_str()); if (pathOrURL.startsWith(QLatin1String("http:")) diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h index 710f17343..98429c44e 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h @@ -105,6 +105,7 @@ public: void setTimeout(int); void setShouldTimeout(bool flag); + void setShouldDumpPixelsForAllTests() { m_dumpPixelsForAllTests = true; } public Q_SLOTS: void initJSObjects(); @@ -141,6 +142,7 @@ private: TestRunner *m_controller; bool m_dumpPixelsForCurrentTest; + bool m_dumpPixelsForAllTests; QString m_expectedHash; QStringList m_standAloneModeTestList; diff --git a/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp b/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp deleted file mode 100644 index c69347e8d..000000000 --- a/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "QtInitializeTestFonts.h" - -#if HAVE(FONTCONFIG) -#include <QByteArray> -#include <QDir> -#include <fontconfig/fontconfig.h> -#endif - -namespace WebKit { - -void initializeTestFonts() -{ -#if HAVE(FONTCONFIG) - static int numFonts = -1; - - FcInit(); - - // Some test cases may add or remove application fonts (via @font-face). - // Make sure to re-initialize the font set if necessary. - FcFontSet* appFontSet = FcConfigGetFonts(0, FcSetApplication); - if (appFontSet && numFonts >= 0 && appFontSet->nfont == numFonts) - return; - - QByteArray fontDir = getenv("WEBKIT_TESTFONTS"); - if (fontDir.isEmpty() || !QDir(QString::fromLatin1(fontDir)).exists()) { - qFatal("\n\n" - "----------------------------------------------------------------------\n" - "WEBKIT_TESTFONTS environment variable is not set correctly.\n" - "This variable has to point to the directory containing the fonts\n" - "you can clone from git://gitorious.org/qtwebkit/testfonts.git\n" - "----------------------------------------------------------------------\n" - ); - } - - QByteArray configFile = fontDir + "/fonts.conf"; - FcConfig* config = FcConfigCreate(); - if (!FcConfigParseAndLoad(config, reinterpret_cast<const FcChar8*>(configFile.constData()), FcTrue)) - qFatal("Couldn't load font configuration file"); - if (!FcConfigAppFontAddDir(config, reinterpret_cast<const FcChar8*>(fontDir.data()))) - qFatal("Couldn't add font dir!"); - FcConfigSetCurrent(config); - - appFontSet = FcConfigGetFonts(config, FcSetApplication); - numFonts = appFontSet->nfont; -#endif -} - -} diff --git a/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h b/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h deleted file mode 100644 index 60e4761b6..000000000 --- a/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef QtInitializeTestFonts_h -#define QtInitializeTestFonts_h - -namespace WebKit { - -// Helper to share code between test font users. -void initializeTestFonts(); - -} - -#endif diff --git a/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro index f7b638dfc..f962ee18b 100644 --- a/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro +++ b/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro @@ -24,6 +24,7 @@ SOURCES += \ Tests/NPDeallocateCalledBeforeNPShutdown.cpp \ Tests/NPPNewFails.cpp \ Tests/NPPSetWindowCalledDuringDestruction.cpp \ + Tests/NPRuntimeCallsWithNullNPP.cpp \ Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \ Tests/NPRuntimeRemoveProperty.cpp \ Tests/NullNPPGetValuePointer.cpp \ diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp index 81f781430..98fa7100b 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp @@ -408,11 +408,6 @@ QString TestRunner::decodeHostName(const QString& host) return decoded; } -void TestRunner::setMediaType(const QString& type) -{ - DumpRenderTreeSupportQt::setMediaType(m_drt->webPage()->mainFrame(), type); -} - void TestRunner::closeWebInspector() { DumpRenderTreeSupportQt::webInspectorClose(m_drt->webPage()); diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.h b/Tools/DumpRenderTree/qt/TestRunnerQt.h index 9c58f1d83..e54fde09e 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.h +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.h @@ -155,7 +155,6 @@ public Q_SLOTS: void closeWebInspector(); void evaluateInWebInspector(long callId, const QString& script); void removeAllVisitedLinks(); - void setMediaType(const QString&); void setFrameFlatteningEnabled(bool); void setAllowUniversalAccessFromFileURLs(bool enable); void setAllowFileAccessFromFileURLs(bool enable); diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp index ad1726dc9..173f34574 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp @@ -80,6 +80,7 @@ static LPCWSTR fontsEnvironmentVariable = L"WEBKIT_TESTFONTS"; const LPCWSTR kDumpRenderTreeClassName = L"DumpRenderTreeWindow"; static bool dumpTree = true; +static bool dumpPixelsForAllTests = false; static bool dumpPixelsForCurrentTest; static bool dumpAllPixels; static bool printSeparators; @@ -952,7 +953,7 @@ static void runTest(const string& inputLine) { TestCommand command = parseInputLine(inputLine); const string& pathOrURL = command.pathOrURL; - dumpPixelsForCurrentTest = command.shouldDumpPixels; + dumpPixelsForCurrentTest = command.shouldDumpPixels || dumpPixelsForAllTests; static BSTR methodBStr = SysAllocString(TEXT("GET")); @@ -1341,6 +1342,11 @@ extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, cons continue; } + if (!stricmp(argv[i], "--pixel-tests")) { + dumpPixelsForAllTests = true; + continue; + } + tests.append(argv[i]); } diff --git a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp index 538ff249d..cadecaf8f 100644 --- a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp +++ b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp @@ -50,6 +50,7 @@ volatile bool done = true; volatile bool notified = false; static bool printSeparators = true; +static int dumpPixelsForAllTests = false; static int dumpPixelsForCurrentTest; static int dumpTree = 1; time_t startTime; // to detect timeouts / failed tests @@ -225,7 +226,7 @@ static void runTest(const wxString inputLine) TestCommand command = parseInputLine(std::string(inputLine.ToAscii())); string& pathOrURL = command.pathOrURL; - dumpPixelsForCurrentTest = command.shouldDumpPixels; + dumpPixelsForCurrentTest = command.shouldDumpPixels || dumpPixelsForAllTests; // CURL isn't happy if we don't have a protocol. size_t http = pathOrURL.find("http://"); @@ -281,6 +282,11 @@ bool MyApp::OnInit() dumpTree = true; continue; } + + if (!option.CmpNoCase(_T("--pixel-tests"))) { + dumpPixelsForAllTests = true; + continue; + } } wxInitAllImageHandlers(); diff --git a/Tools/EWebLauncher/main.c b/Tools/EWebLauncher/main.c index e17c8cc85..b1192435f 100644 --- a/Tools/EWebLauncher/main.c +++ b/Tools/EWebLauncher/main.c @@ -143,16 +143,16 @@ static const Ecore_Getopt options = { }; typedef struct _User_Arguments { - const char *engine; + char *engine; Eina_Bool quitOption; - const char *backingStore; + char *backingStore; Eina_Bool enableEncodingDetector; Eina_Bool isFlattening; Eina_Bool isFullscreen; Eina_Rectangle geometry; - const char *theme; - const char *userAgent; - const char *databasePath; + char *theme; + char *userAgent; + char *databasePath; } User_Arguments; typedef struct _ELauncher { @@ -426,8 +426,13 @@ static void on_tooltip_text_set(void* user_data, Evas_Object* webview, void* event_info) { const char *text = (const char *)event_info; - if (text && *text != '\0') - info("%s\n", text); + info("Tooltip is set: %s\n", text); +} + +static void +on_tooltip_text_unset(void* user_data, Evas_Object* webview, void* event_info) +{ + info("Tooltip is unset\n"); } static void @@ -571,14 +576,18 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) Eina_Bool status = ewk_view_setting_spatial_navigation_get(obj); ewk_view_setting_spatial_navigation_set(obj, !status); info("Command::keyboard navigation toggle\n"); - } else if (!strcmp(ev->key, "F7")) { - info("Zoom out (F7) was pressed.\n"); + } else if ((!strcmp(ev->key, "minus") || !strcmp(ev->key, "KP_Subtract")) && ctrlPressed) { if (currentZoomLevel > MIN_ZOOM_LEVEL && zoom_level_set(obj, currentZoomLevel - 1)) currentZoomLevel--; - } else if (!strcmp(ev->key, "F8")) { - info("Zoom in (F8) was pressed.\n"); + info("Zoom out (Ctrl + '-') was pressed, zoom level became %.2f\n", zoomLevels[currentZoomLevel] / 100.0); + } else if ((!strcmp(ev->key, "equal") || !strcmp(ev->key, "KP_Add")) && ctrlPressed) { if (currentZoomLevel < MAX_ZOOM_LEVEL && zoom_level_set(obj, currentZoomLevel + 1)) currentZoomLevel++; + info("Zoom in (Ctrl + '+') was pressed, zoom level became %.2f\n", zoomLevels[currentZoomLevel] / 100.0); + } else if (!strcmp(ev->key, "0") && ctrlPressed) { + if (zoom_level_set(obj, DEFAULT_ZOOM_LEVEL)) + currentZoomLevel = DEFAULT_ZOOM_LEVEL; + info("Zoom to default (Ctrl + '0') was pressed, zoom level became %.2f\n", zoomLevels[currentZoomLevel] / 100.0); } else if (!strcmp(ev->key, "n") && ctrlPressed) { info("Create new window (Ctrl+n) was pressed.\n"); browserCreate("http://www.google.com", app->userArgs); @@ -747,6 +756,7 @@ browserCreate(const char *url, User_Arguments *userArgs) evas_object_smart_callback_add(appBrowser->browser, "toolbars,visible,get", on_toolbars_visible_get, appBrowser); evas_object_smart_callback_add(appBrowser->browser, "toolbars,visible,set", on_toolbars_visible_set, appBrowser); evas_object_smart_callback_add(appBrowser->browser, "tooltip,text,set", on_tooltip_text_set, appBrowser); + evas_object_smart_callback_add(appBrowser->browser, "tooltip,text,unset", on_tooltip_text_unset, appBrowser); evas_object_smart_callback_add(appBrowser->browser, "uri,changed", on_url_changed, appBrowser); evas_object_event_callback_add(appBrowser->browser, EVAS_CALLBACK_DEL, on_browser_del, appBrowser); @@ -807,7 +817,16 @@ windowCreate(User_Arguments *userArgs) return NULL; } - app->ee = ecore_evas_new(userArgs->engine, 0, 0, userArgs->geometry.w, userArgs->geometry.h, NULL); +#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X) + if (userArgs->engine) +#endif + app->ee = ecore_evas_new(userArgs->engine, 0, 0, userArgs->geometry.w, userArgs->geometry.h, NULL); +#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X) + else { + const char* engine = "opengl_x11"; + app->ee = ecore_evas_new(engine, 0, 0, userArgs->geometry.w, userArgs->geometry.h, NULL); + } +#endif if (!app->ee) { quit(EINA_FALSE, "ERROR: could not construct evas-ecore\n"); return NULL; diff --git a/Tools/GNUmakefile.am b/Tools/GNUmakefile.am index a8d944dcf..87b8f6a52 100644 --- a/Tools/GNUmakefile.am +++ b/Tools/GNUmakefile.am @@ -224,6 +224,7 @@ TestNetscapePlugin_libtestnetscapeplugin_la_SOURCES = \ Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPDeallocateCalledBeforeNPShutdown.cpp \ Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPNewFails.cpp \ Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPSetWindowCalledDuringDestruction.cpp \ + Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp \ Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \ Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp \ Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp \ diff --git a/Tools/MiniBrowser/Configurations/Base.xcconfig b/Tools/MiniBrowser/Configurations/Base.xcconfig index 85d987d39..c801d582f 100644 --- a/Tools/MiniBrowser/Configurations/Base.xcconfig +++ b/Tools/MiniBrowser/Configurations/Base.xcconfig @@ -21,14 +21,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "CompilerVersion.xcconfig" - +CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; +CLANG_CXX_LIBRARY = libc++; DEBUG_INFORMATION_FORMAT = dwarf-with-dsym; PREBINDING = NO GCC_C_LANGUAGE_STANDARD = gnu99 GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_TREAT_WARNINGS_AS_ERRORS = YES +GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO @@ -36,22 +37,9 @@ WARNING_CFLAGS = -Wall -W -Wno-unused-parameter LINKER_DISPLAYS_MANGLED_NAMES = YES; VALID_ARCHS = i386 x86_64; -CLANG_CXX_LIBRARY = $(CLANG_CXX_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -CLANG_CXX_LIBRARY_1060 = libstdc++; -CLANG_CXX_LIBRARY_1070 = libc++; -CLANG_CXX_LIBRARY_1080 = libc++; -CLANG_CXX_LIBRARY_1090 = libc++; - -REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME)); -REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx); -REAL_PLATFORM_NAME_iphoneos = iphoneos; -REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator; -REAL_PLATFORM_NAME_macosx = macosx; - TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); TARGETING_SAME_OS_X_VERSION = $(TARGETING_SAME_OS_X_VERSION_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -TARGETING_SAME_OS_X_VERSION_1060_1060 = YES; TARGETING_SAME_OS_X_VERSION_1070_1070 = YES; TARGETING_SAME_OS_X_VERSION_1080_1080 = YES; TARGETING_SAME_OS_X_VERSION_1090_1090 = YES; diff --git a/Tools/MiniBrowser/Configurations/CompilerVersion.xcconfig b/Tools/MiniBrowser/Configurations/CompilerVersion.xcconfig deleted file mode 100644 index a8c7f75a0..000000000 --- a/Tools/MiniBrowser/Configurations/CompilerVersion.xcconfig +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -IS_XCODE_0400 = $(IS_XCODE_0400_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_0400 = YES; - -IS_XCODE_0400_OR_0410 = $(IS_XCODE_0400_OR_0410_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_OR_0410_0400 = YES; -IS_XCODE_0400_OR_0410_0410 = YES; - -// The version of the LLVM Compiler in Xcode 4.0 and earlier have difficulty compiling our code. -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_$(IS_XCODE_0400)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_YES = YES; - -// The version of the LLVM Compiler in Xcode 4.1 and earlier do not generate fast enough code. -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_$(IS_XCODE_0400_OR_0410)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_YES = YES; - -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_YES = NO; - -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_YES = NO; - - -// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0. -// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version -// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and -// XCODE_VERSION_ACTUAL for the full version number. -TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(REAL_PLATFORM_NAME)); -TARGET_GCC_VERSION_iphoneos = LLVM_GCC_42; -TARGET_GCC_VERSION_iphonesimulator = GCC_42; -TARGET_GCC_VERSION_macosx = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); - -TARGET_GCC_VERSION_macosx_1050 = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_MINOR)); -TARGET_GCC_VERSION_macosx_1050_ = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_ACTUAL)); -TARGET_GCC_VERSION_macosx_1050_0310 = GCC_42; -TARGET_GCC_VERSION_macosx_1050_0320 = GCC_42; - -TARGET_GCC_VERSION_macosx_1060 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1070 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Debug = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Release = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Production = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_NON_LLVM_FALLBACK = GCC_42; -TARGET_GCC_VERSION_macosx_1070_NON_LLVM_FALLBACK = LLVM_GCC_42; - -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_YES = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_NO = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)_NON_LLVM_FALLBACK); - -TARGET_GCC_VERSION_macosx_1080 = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_1090 = LLVM_COMPILER; - -GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); -GCC_VERSION_GCC_40 = 4.0; -GCC_VERSION_GCC_42 = 4.2; -GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; -GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0; diff --git a/Tools/MiniBrowser/Configurations/DebugRelease.xcconfig b/Tools/MiniBrowser/Configurations/DebugRelease.xcconfig index 0d6374f3b..084cdf91e 100644 --- a/Tools/MiniBrowser/Configurations/DebugRelease.xcconfig +++ b/Tools/MiniBrowser/Configurations/DebugRelease.xcconfig @@ -23,18 +23,11 @@ #include "Base.xcconfig" -ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ARCHS_1050 = $(NATIVE_ARCH); -ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1080 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1090 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS = $(ARCHS_STANDARD_32_64_BIT); ONLY_ACTIVE_ARCH = YES; MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) -MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; -MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; MACOSX_DEPLOYMENT_TARGET_1080 = 10.8; MACOSX_DEPLOYMENT_TARGET_1090 = 10.9; diff --git a/Tools/MiniBrowser/efl/main.c b/Tools/MiniBrowser/efl/main.c index c5dc495a2..23193eb5f 100644 --- a/Tools/MiniBrowser/efl/main.c +++ b/Tools/MiniBrowser/efl/main.c @@ -25,8 +25,6 @@ #include <Elementary.h> #include <Evas.h> -static const int DEFAULT_WIDTH = 800; -static const int DEFAULT_HEIGHT = 600; static const char DEFAULT_URL[] = "http://www.google.com/"; static const char APP_NAME[] = "EFL MiniBrowser"; static const int TOOL_BAR_ICON_SIZE = 24; @@ -42,6 +40,8 @@ static int verbose = 1; static Eina_List *windows = NULL; static char *evas_engine_name = NULL; static Eina_Bool frame_flattening_enabled = EINA_FALSE; +static int window_width = 800; +static int window_height = 600; static Ewk_View_Smart_Class* miniBrowserViewSmartClass() { @@ -67,6 +67,8 @@ static const Ecore_Getopt options = { EINA_TRUE, { ECORE_GETOPT_STORE_STR ('e', "engine", "ecore-evas engine to use."), + ECORE_GETOPT_STORE_STR + ('s', "window-size", "window size in following format (width)x(height)."), ECORE_GETOPT_CALLBACK_NOARGS ('E', "list-engines", "list ecore-evas engines.", ecore_getopt_callback_ecore_evas_list_engines, NULL), @@ -163,6 +165,13 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) } else if (!strcmp(ev->key, "F6")) { info("Stop (F6) was pressed, stop loading.\n"); ewk_view_stop(obj); + } else if (!strcmp(ev->key, "F7")) { + Ewk_Pagination_Mode mode = ewk_view_pagination_mode_get(obj); + mode = (++mode) % (EWK_PAGINATION_MODE_BOTTOM_TO_TOP + 1); + if (ewk_view_pagination_mode_set(obj, mode)) + info("Change Pagination Mode (F7) was pressed, changed to: %d\n", mode); + else + info("Change Pagination Mode (F7) was pressed, but NOT changed!"); } else if (!strcmp(ev->key, "n") && ctrlPressed) { info("Create new window (Ctrl+n) was pressed.\n"); Browser_Window *window = window_create(DEFAULT_URL); @@ -231,7 +240,11 @@ static void on_url_changed(void *user_data, Evas_Object *webview, void *event_info) { Browser_Window *window = (Browser_Window *)user_data; - elm_entry_entry_set(window->url_bar, ewk_view_url_get(window->webview)); + + char *url = elm_entry_utf8_to_markup(ewk_view_url_get(window->webview)); + elm_entry_entry_set(window->url_bar, url); + + free(url); } static void @@ -308,6 +321,79 @@ on_download_request(void *user_data, Evas_Object *webview, void *event_info) eina_strbuf_free(destination_path); } +typedef struct { + Evas_Object *parent; + Evas_Object *window; + Ewk_File_Chooser_Request *request; +} FileSelectorData; + +static void on_filepicker_parent_deletion(void *user_data, Evas *evas, Evas_Object *window, void *event); + +static void close_file_picker(FileSelectorData* fs_data) +{ + evas_object_event_callback_del(fs_data->parent, EVAS_CALLBACK_DEL, on_filepicker_parent_deletion); + evas_object_del(fs_data->window); + ewk_file_chooser_request_unref(fs_data->request); + free(fs_data); +} + +static void +on_filepicker_parent_deletion(void *user_data, Evas *evas, Evas_Object *window, void *event) +{ + close_file_picker((FileSelectorData *)user_data); +} + +static void +on_filepicker_deletion(void *user_data, Evas_Object *window, void *event_info) +{ + close_file_picker((FileSelectorData *)user_data); +} + +static void +on_fileselector_done(void *user_data, Evas_Object *file_selector, void *event_info) +{ + FileSelectorData *fs_data = (FileSelectorData *)user_data; + + const char *selected = (const char *)event_info; + if (selected && *selected) + ewk_file_chooser_request_file_choose(fs_data->request, selected); + + close_file_picker(fs_data); +} + +static void +on_file_chooser_request(void *user_data, Evas_Object *webview, void *event_info) +{ + Browser_Window *app_data = (Browser_Window *)user_data; + Ewk_File_Chooser_Request *request = (Ewk_File_Chooser_Request *)event_info; + + // Show basic file picker which does not currently support multiple files + // or MIME type filtering. + Evas_Object *window = elm_win_add(app_data->window, "file-picker-window", ELM_WIN_DIALOG_BASIC); + elm_win_title_set(window, "File picker"); + elm_win_modal_set(window, EINA_TRUE); + + FileSelectorData* fs_data = (FileSelectorData*)malloc(sizeof(FileSelectorData)); + fs_data->parent = app_data->window; + fs_data->window = window; + fs_data->request = ewk_file_chooser_request_ref(request); + evas_object_smart_callback_add(window, "delete,request", on_filepicker_deletion, fs_data); + evas_object_event_callback_add(app_data->window, EVAS_CALLBACK_DEL, on_filepicker_parent_deletion, fs_data); + + Evas_Object *file_selector = elm_fileselector_add(window); + const char *home_path = getenv("HOME"); + elm_fileselector_path_set(file_selector, home_path ? home_path : "/home"); + evas_object_size_hint_weight_set(file_selector, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(window, file_selector); + evas_object_show(file_selector); + + evas_object_smart_callback_add(file_selector, "done", on_fileselector_done, fs_data); + + evas_object_resize(window, 400, 400); + elm_win_center(window, EINA_TRUE, EINA_TRUE); + evas_object_show(window); +} + static void on_download_finished(void *user_data, Evas_Object *webview, void *event_info) { @@ -380,9 +466,12 @@ on_url_bar_activated(void *user_data, Evas_Object *url_bar, void *event_info) { Browser_Window *app_data = (Browser_Window *)user_data; - const char *user_url = elm_entry_entry_get(url_bar); + const char *markup_url = elm_entry_entry_get(url_bar); + char *user_url = elm_entry_markup_to_utf8(markup_url); char *url = url_from_user_input(user_url); ewk_view_url_set(app_data->webview, url); + + free(user_url); free(url); /* Give focus back to the view */ @@ -465,6 +554,7 @@ on_javascript_alert(Ewk_View_Smart_Data *smartData, const char *message) elm_object_text_set(button, "OK"); elm_object_part_content_set(alert_popup, "button1", button); evas_object_smart_callback_add(button, "clicked", quit_event_loop, NULL); + elm_object_focus_set(button, EINA_TRUE); evas_object_show(alert_popup); /* Make modal */ @@ -494,6 +584,7 @@ on_javascript_confirm(Ewk_View_Smart_Data *smartData, const char *message) elm_object_text_set(ok_button, "OK"); elm_object_part_content_set(confirm_popup, "button2", ok_button); evas_object_smart_callback_add(ok_button, "clicked", on_ok_clicked, &ok); + elm_object_focus_set(ok_button, EINA_TRUE); evas_object_show(confirm_popup); /* Make modal */ @@ -534,9 +625,11 @@ on_javascript_prompt(Ewk_View_Smart_Data *smartData, const char *message, const elm_entry_single_line_set(entry, EINA_TRUE); elm_entry_text_style_user_push(entry, "DEFAULT='font_size=18'"); elm_entry_entry_set(entry, default_value ? default_value : ""); + elm_entry_select_all(entry); evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0); evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0.5); elm_box_pack_end(box, entry); + elm_object_focus_set(entry, EINA_TRUE); evas_object_show(entry); elm_object_content_set(prompt_popup, box); @@ -562,6 +655,158 @@ on_javascript_prompt(Ewk_View_Smart_Data *smartData, const char *message, const return prompt_text; } +typedef struct { + Evas_Object *popup; + Ewk_Auth_Request *request; + Evas_Object *username_entry; + Evas_Object *password_entry; +} AuthData; + +static void +auth_popup_close(AuthData *auth_data) +{ + ewk_object_unref(auth_data->request); + evas_object_del(auth_data->popup); + free(auth_data); +} + +static void +on_auth_cancel(void *user_data, Evas_Object *obj, void *event_info) +{ + AuthData *auth_data = (AuthData *)user_data; + + ewk_auth_request_cancel(auth_data->request); + + auth_popup_close(auth_data); +} + +static void +on_auth_ok(void *user_data, Evas_Object *obj, void *event_info) +{ + AuthData *auth_data = (AuthData *)user_data; + + const char *username = elm_entry_entry_get(auth_data->username_entry); + const char *password = elm_entry_entry_get(auth_data->password_entry); + ewk_auth_request_authenticate(auth_data->request, username, password); + + auth_popup_close(auth_data); +} + +static void +on_authentication_request(void *user_data, Evas_Object *obj, void *event_info) +{ + Browser_Window *window = (Browser_Window *)user_data; + Ewk_Auth_Request *request = ewk_object_ref((Ewk_Auth_Request *)event_info); + + AuthData *auth_data = (AuthData *)malloc(sizeof(AuthData)); + auth_data->request = request; + + Evas_Object *auth_popup = elm_popup_add(window->window); + auth_data->popup = auth_popup; + evas_object_size_hint_weight_set(auth_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_text_set(auth_popup, "title,text", "Authentication Required"); + + /* Popup Content */ + Evas_Object *vbox = elm_box_add(auth_popup); + elm_box_padding_set(vbox, 0, 4); + evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(vbox, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_content_set(auth_popup, vbox); + evas_object_show(vbox); + + /* Authentication message */ + Evas_Object *label = elm_label_add(auth_popup); + elm_label_line_wrap_set(label, ELM_WRAP_WORD); + Eina_Strbuf *auth_text = eina_strbuf_new(); + const char* host = ewk_auth_request_host_get(request); + const char* realm = ewk_auth_request_realm_get(request); + eina_strbuf_append_printf(auth_text, "A username and password are being requested by %s. The site says: \"%s\"", host, realm ? realm : ""); + elm_object_text_set(label, eina_strbuf_string_get(auth_text)); + eina_strbuf_free(auth_text); + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(vbox, label); + evas_object_show(label); + + /* Credential table */ + Evas_Object *table = elm_table_add(auth_popup); + elm_table_padding_set(table, 2, 2); + elm_table_homogeneous_set(table, EINA_TRUE); + evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(vbox, table); + evas_object_show(table); + + /* Username row */ + Evas_Object *username_label = elm_label_add(auth_popup); + elm_object_text_set(username_label, "Username:"); + evas_object_size_hint_weight_set(username_label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(username_label, 1, EVAS_HINT_FILL); + elm_table_pack(table, username_label, 0, 0, 1, 1); + evas_object_show(username_label); + + Evas_Object *username_entry = elm_entry_add(auth_popup); + auth_data->username_entry = username_entry; + elm_entry_scrollable_set(username_entry, EINA_TRUE); + elm_entry_single_line_set(username_entry, EINA_TRUE); + elm_entry_text_style_user_push(username_entry, "DEFAULT='font_size=18'"); + const char *suggested_username = ewk_auth_request_suggested_username_get(request); + elm_entry_entry_set(username_entry, suggested_username ? suggested_username : ""); + evas_object_size_hint_weight_set(username_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(username_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(table, username_entry, 1, 0, 2, 1); + elm_object_focus_set(username_entry, EINA_TRUE); + evas_object_show(username_entry); + + /* Password row */ + Evas_Object *password_label = elm_label_add(auth_popup); + elm_object_text_set(password_label, "Password:"); + evas_object_size_hint_weight_set(password_label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(password_label, 1, EVAS_HINT_FILL); + elm_table_pack(table, password_label, 0, 1, 1, 1); + evas_object_show(password_label); + + Evas_Object *password_entry = elm_entry_add(auth_popup); + auth_data->password_entry = password_entry; + elm_entry_scrollable_set(password_entry, EINA_TRUE); + elm_entry_single_line_set(password_entry, EINA_TRUE); + elm_entry_password_set(password_entry, EINA_TRUE); + elm_entry_text_style_user_push(password_entry, "DEFAULT='font_size=18'"); + evas_object_size_hint_weight_set(password_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(password_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(table, password_entry, 1, 1, 2, 1); + evas_object_show(password_entry); + + /* Popup buttons */ + Evas_Object *cancel_button = elm_button_add(auth_popup); + elm_object_text_set(cancel_button, "Cancel"); + elm_object_part_content_set(auth_popup, "button1", cancel_button); + evas_object_smart_callback_add(cancel_button, "clicked", on_auth_cancel, auth_data); + Evas_Object *ok_button = elm_button_add(auth_popup); + elm_object_text_set(ok_button, "OK"); + elm_object_part_content_set(auth_popup, "button2", ok_button); + evas_object_smart_callback_add(ok_button, "clicked", on_auth_ok, auth_data); + evas_object_show(auth_popup); +} + +static void +on_tooltip_text_set(void *user_data, Evas_Object *obj, void *event_info) +{ + Browser_Window *window = (Browser_Window *)user_data; + const char* message = (const char*)event_info; + + elm_object_tooltip_text_set(window->webview, message); + elm_object_tooltip_show(window->webview); +} + +static void +on_tooltip_text_unset(void *user_data, Evas_Object *obj, void *event_info) +{ + Browser_Window *window = (Browser_Window *)user_data; + + elm_object_tooltip_unset(window->webview); +} + static void on_home_button_clicked(void *user_data, Evas_Object *home_button, void *event_info) { @@ -691,17 +936,21 @@ static Browser_Window *window_create(const char *url) ewk_settings_frame_flattening_enabled_set(settings, frame_flattening_enabled); ewk_settings_developer_extras_enabled_set(settings, EINA_TRUE); + evas_object_smart_callback_add(app_data->webview, "authentication,request", on_authentication_request, app_data); evas_object_smart_callback_add(app_data->webview, "close,window", on_close_window, app_data); evas_object_smart_callback_add(app_data->webview, "create,window", on_new_window, app_data); evas_object_smart_callback_add(app_data->webview, "download,failed", on_download_failed, app_data); evas_object_smart_callback_add(app_data->webview, "download,finished", on_download_finished, app_data); evas_object_smart_callback_add(app_data->webview, "download,request", on_download_request, app_data); + evas_object_smart_callback_add(app_data->webview, "file,chooser,request", on_file_chooser_request, app_data); evas_object_smart_callback_add(app_data->webview, "icon,changed", on_view_icon_changed, app_data); evas_object_smart_callback_add(app_data->webview, "load,error", on_error, app_data); evas_object_smart_callback_add(app_data->webview, "load,progress", on_progress, app_data); evas_object_smart_callback_add(app_data->webview, "title,changed", on_title_changed, app_data); evas_object_smart_callback_add(app_data->webview, "url,changed", on_url_changed, app_data); evas_object_smart_callback_add(app_data->webview, "back,forward,list,changed", on_back_forward_list_changed, app_data); + evas_object_smart_callback_add(app_data->webview, "tooltip,text,set", on_tooltip_text_set, app_data); + evas_object_smart_callback_add(app_data->webview, "tooltip,text,unset", on_tooltip_text_unset, app_data); evas_object_event_callback_add(app_data->webview, EVAS_CALLBACK_KEY_DOWN, on_key_down, app_data); evas_object_event_callback_add(app_data->webview, EVAS_CALLBACK_MOUSE_DOWN, on_mouse_down, app_data); @@ -714,7 +963,7 @@ static Browser_Window *window_create(const char *url) if (url) ewk_view_url_set(app_data->webview, url); - evas_object_resize(app_data->window, DEFAULT_WIDTH, DEFAULT_HEIGHT); + evas_object_resize(app_data->window, window_width, window_height); evas_object_show(app_data->window); view_focus_set(app_data, EINA_TRUE); @@ -722,15 +971,42 @@ static Browser_Window *window_create(const char *url) return app_data; } +static void +parse_window_size(const char *input_string, int *width, int *height) +{ + static const unsigned max_length = 4; + int parsed_width; + int parsed_height; + char **arr; + unsigned elements; + + arr = eina_str_split_full(input_string, "x", 0, &elements); + + if (elements == 2 && (strlen(arr[0]) <= max_length) && (strlen(arr[1]) <= max_length)) { + parsed_width = atoi(arr[0]); + if (width && parsed_width) + *width = parsed_width; + + parsed_height = atoi(arr[1]); + if (height && parsed_height) + *height = parsed_height; + } + + free(arr[0]); + free(arr); +} + EAPI_MAIN int elm_main(int argc, char *argv[]) { int args = 1; unsigned char quitOption = 0; Browser_Window *window; + char *window_size_string = NULL; Ecore_Getopt_Value values[] = { ECORE_GETOPT_VALUE_STR(evas_engine_name), + ECORE_GETOPT_VALUE_STR(window_size_string), ECORE_GETOPT_VALUE_BOOL(quitOption), ECORE_GETOPT_VALUE_BOOL(frame_flattening_enabled), ECORE_GETOPT_VALUE_BOOL(quitOption), @@ -755,6 +1031,19 @@ elm_main(int argc, char *argv[]) if (evas_engine_name) elm_config_preferred_engine_set(evas_engine_name); +#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X) + else { + evas_engine_name = "opengl_x11"; + elm_config_preferred_engine_set(evas_engine_name); + } +#endif + + // Enable favicon database. + Ewk_Context *context = ewk_context_default_get(); + ewk_context_favicon_database_directory_set(context, NULL); + + if (window_size_string) + parse_window_size(window_size_string, &window_width, &window_height); if (args < argc) { char *url = url_from_user_input(argv[args]); diff --git a/Tools/MiniBrowser/mac/WK2BrowserWindowController.m b/Tools/MiniBrowser/mac/WK2BrowserWindowController.m index b30b7ff9f..1731eb650 100644 --- a/Tools/MiniBrowser/mac/WK2BrowserWindowController.m +++ b/Tools/MiniBrowser/mac/WK2BrowserWindowController.m @@ -733,10 +733,8 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters if (!emptyURL) emptyURL = WKURLCreateWithUTF8CString(""); - if (WKURLIsEqual(URLRef, emptyURL)) { - WKRelease(URLRef); + if (WKURLIsEqual(URLRef, emptyURL)) return; - } CFURLRef cfSourceURL = WKURLCopyCFURL(0, URLRef); [urlText setStringValue:(NSString*)CFURLGetString(cfSourceURL)]; @@ -746,6 +744,8 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters - (void)updateProvisionalURLForFrame:(WKFrameRef)frame { WKURLRef url = WKFrameCopyProvisionalURL(frame); + if (!url) + return; [self updateTextFieldFromURL:url]; WKRelease(url); } @@ -753,6 +753,8 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters - (void)updateCommittedURLForFrame:(WKFrameRef)frame { WKURLRef url = WKFrameCopyURL(frame); + if (!url) + return; [self updateTextFieldFromURL:url]; WKRelease(url); } diff --git a/Tools/MiniBrowser/qt/MiniBrowser.pro b/Tools/MiniBrowser/qt/MiniBrowser.pro index f5c1803fa..0fbddbe13 100644 --- a/Tools/MiniBrowser/qt/MiniBrowser.pro +++ b/Tools/MiniBrowser/qt/MiniBrowser.pro @@ -9,10 +9,10 @@ TEMPLATE = app WEBKIT += wtf INCLUDEPATH += \ + $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \ $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/ SOURCES += \ - $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp \ BrowserWindow.cpp \ main.cpp \ MiniBrowserApplication.cpp \ @@ -20,7 +20,6 @@ SOURCES += \ utils.cpp \ HEADERS += \ - $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h \ BrowserWindow.h \ MiniBrowserApplication.h \ UrlLoader.h \ diff --git a/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp b/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp index 68307c351..ec919a6a7 100644 --- a/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp +++ b/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp @@ -29,7 +29,7 @@ #include "MiniBrowserApplication.h" #include "BrowserWindow.h" -#include "QtInitializeTestFonts.h" +#include "QtTestSupport.h" #include "private/qquickwebview_p.h" #include "utils.h" #include <QRegExp> @@ -140,7 +140,6 @@ bool MiniBrowserApplication::notify(QObject* target, QEvent* event) switch (mouseEvent->type()) { case QEvent::MouseButtonPress: - case QEvent::MouseButtonDblClick: touchPoint.setId(mouseEvent->button()); if (m_touchPoints.contains(touchPoint.id())) { touchPoint.setState(Qt::TouchPointMoved); @@ -176,6 +175,10 @@ bool MiniBrowserApplication::notify(QObject* target, QEvent* event) touchPoint.setId(mouseEvent->button()); touchPoint.setState(Qt::TouchPointReleased); break; + case QEvent::MouseButtonDblClick: + // Eat double-clicks, their accompanying press event is all we need. + event->accept(); + return true; default: Q_ASSERT_X(false, "multi-touch mocking", "unhandled event type"); } @@ -332,7 +335,7 @@ void MiniBrowserApplication::handleUserOptions() } if (takeOptionFlag(&args, QStringLiteral("--use-test-fonts"))) - WebKit::initializeTestFonts(); + WebKit::QtTestSupport::initializeTestFonts(); if (args.contains("-r")) { QString listFile = takeOptionValue(&args, "-r"); diff --git a/Tools/QtTestBrowser/QtTestBrowser.pro b/Tools/QtTestBrowser/QtTestBrowser.pro index f69606ab9..2fa9086d9 100644 --- a/Tools/QtTestBrowser/QtTestBrowser.pro +++ b/Tools/QtTestBrowser/QtTestBrowser.pro @@ -7,12 +7,12 @@ TEMPLATE = app INCLUDEPATH += \ + $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \ $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/ \ $${ROOT_WEBKIT_DIR}/Source/WTF SOURCES += \ - $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp \ locationedit.cpp \ launcherwindow.cpp \ qttestbrowser.cpp \ @@ -25,7 +25,6 @@ SOURCES += \ cookiejar.cpp HEADERS += \ - $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h \ locationedit.h \ launcherwindow.h \ mainwindow.h \ diff --git a/Tools/QtTestBrowser/qttestbrowser.cpp b/Tools/QtTestBrowser/qttestbrowser.cpp index 64cb26153..fcd13a204 100644 --- a/Tools/QtTestBrowser/qttestbrowser.cpp +++ b/Tools/QtTestBrowser/qttestbrowser.cpp @@ -31,7 +31,7 @@ */ #include "DumpRenderTreeSupportQt.h" -#include "QtInitializeTestFonts.h" +#include "QtTestSupport.h" #include "launcherwindow.h" #include "urlloader.h" @@ -241,7 +241,7 @@ void LauncherApplication::handleUserOptions() #endif if (args.contains("-use-test-fonts")) - WebKit::initializeTestFonts(); + WebKit::QtTestSupport::initializeTestFonts(); if (args.contains("-print-loaded-urls")) windowOptions.printLoadedUrls = true; diff --git a/Tools/Scripts/check-inspector-strings b/Tools/Scripts/check-inspector-strings index 48e5809f5..267c03a68 100755 --- a/Tools/Scripts/check-inspector-strings +++ b/Tools/Scripts/check-inspector-strings @@ -35,7 +35,9 @@ import os.path import re import sys -from webkitpy.common.checkout.scm import detect_scm_system +from webkitpy.common.checkout.scm import SCMDetector +from webkitpy.common.system.filesystem import FileSystem +from webkitpy.common.system.executive import Executive from webkitpy.common.system.logutils import configure_logging from webkitpy.style.checker import ProcessorBase from webkitpy.style.filereader import TextFileReader @@ -47,10 +49,6 @@ _localized_strings = "Source/WebCore/English.lproj/localizedStrings.js" _log = logging.getLogger("check-inspector-strings") -def decode_unicode_escapes(s): - xNN_converted_to_u00NN = s.replace("\\x", "\\u00") - return eval("ur\"" + xNN_converted_to_u00NN + "\"") - class StringsExtractor(ProcessorBase): def __init__(self, patterns): self._patterns = patterns @@ -70,7 +68,7 @@ class StringsExtractor(ProcessorBase): for pattern in self._patterns: line_strings = re.findall(pattern, line) for string in line_strings: - self.strings[index].append(decode_unicode_escapes(string)) + self.strings[index].append(string) index += 1 class LocalizedStringsExtractor: @@ -78,22 +76,60 @@ class LocalizedStringsExtractor: self.localized_strings = [] def process_file(self, file_path): - localized_strings_file = codecs.open(file_path, encoding="utf-16", mode="r") + localized_strings_file = codecs.open(file_path, encoding="utf-8", mode="r") try: contents = localized_strings_file.read() lines = contents.split("\n") for line in lines: match = re.match(r"localizedStrings\[\"((?:[^\"\\]|\\.)*?)\"", line) if match: - self.localized_strings.append(decode_unicode_escapes(match.group(1))) + self.localized_strings.append(match.group(1)) finally: localized_strings_file.close() +def extract_ui_strings(str, out): + line_unrecognized = False + idx = 0 + while idx < len(str): + idx = str.find("WebInspector.UIString(", idx) + if idx == -1: + break + idx = idx + len("WebInspector.UIString(") + balance = 1 + item_recognized = False + while idx < len(str): + if str[idx] == ')': + balance = balance - 1 + if balance == 0: + break + elif str[idx] == '(': + balance = balance + 1 + elif balance == 1: + if str[idx] == ',': + break + elif str[idx] == '"': + str_idx = idx + 1 + while str_idx < len(str): + if str[str_idx] == '\\': + str_idx = str_idx + 1 + elif str[str_idx] == '"': + out.add(str[idx + 1 : str_idx]) + idx = str_idx + item_recognized = True + break + str_idx = str_idx + 1 + idx = idx + 1 + if not item_recognized: + line_unrecognized = True + if line_unrecognized: + _log.info("Unrecognized: %s" % str) + if __name__ == "__main__": configure_logging() cwd = os.path.abspath(os.curdir) - scm = detect_scm_system(cwd) + filesystem = FileSystem() + scm = SCMDetector(filesystem, Executive()).detect_scm_system(cwd) if scm is None: _log.error("WebKit checkout not found: You must run this script " @@ -102,14 +138,17 @@ if __name__ == "__main__": checkout_root = scm.checkout_root _log.debug("WebKit checkout found with root: %s" % checkout_root) - change_directory(checkout_root=checkout_root, paths=None) + change_directory(filesystem, checkout_root=checkout_root, paths=None) - strings_extractor = StringsExtractor([r"WebInspector\.(?:UIString|formatLocalized)\(\"((?:[^\"\\]|\\.)*?)\"", r"\"((?:[^\"\\]|\\.)*?)\""]) - file_reader = TextFileReader(strings_extractor) + strings_extractor = StringsExtractor([r"(WebInspector\.UIString\(.*)", r"\"((?:[^\"\\]|\\.)*?)\""]) + file_reader = TextFileReader(filesystem, strings_extractor) file_reader.process_paths([_inspector_directory, _devtools_directory]) localized_strings_extractor = LocalizedStringsExtractor() localized_strings_extractor.process_file(_localized_strings) - ui_strings = frozenset(strings_extractor.strings[0]) + raw_ui_strings = frozenset(strings_extractor.strings[0]) + ui_strings = set() + for s in raw_ui_strings: + extract_ui_strings(s, ui_strings) strings = frozenset(strings_extractor.strings[1]) localized_strings = frozenset(localized_strings_extractor.localized_strings) diff --git a/Tools/Scripts/old-run-webkit-tests b/Tools/Scripts/old-run-webkit-tests index 89e4abcb2..ef3b197d4 100755 --- a/Tools/Scripts/old-run-webkit-tests +++ b/Tools/Scripts/old-run-webkit-tests @@ -2746,9 +2746,9 @@ sub printResults my $message; if ($typeCount == 1) { $typeText =~ s/were/was/; - $message = sprintf "1 test case (%d%%) %s\n", 1 * 100 / $count, $typeText; + $message = sprintf "1 test case %s\n", $typeText; } else { - $message = sprintf "%d test cases (%d%%) %s\n", $typeCount, $typeCount * 100 / $count, $typeText; + $message = sprintf "%d test cases %s\n", $typeCount, $typeText; } $message =~ s-\(0%\)-(<1%)-; print $message; diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests index 1276596f1..b24cb24e7 100755 --- a/Tools/Scripts/run-gtk-tests +++ b/Tools/Scripts/run-gtk-tests @@ -67,7 +67,8 @@ class TestRunner: SkippedTest("unittests/testwebinspector", "/webkit/webinspector/close-and-inspect", "Test is flaky in GTK Linux 32-bit Release bot", 82869), SkippedTest("WebKit2APITests/TestWebKitWebView", "/webkit2/WebKitWebView/mouse-target", "Test is flaky in GTK Linux 32-bit Release bot", 82866), SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868), - SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810), + SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810), + SkippedTest("WebKit2APITests/TestWebKitAccessibility", "/webkit2/WebKitAccessibility/atspi-basic-hierarchy", "Test fails", 100408), SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.WKConnection", "Tests fail and time out out", 84959), SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.RestoreSessionStateContainingFormData", "Session State is not implemented in GTK+ port", 84960), SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.SpacebarScrolling", "Test fails", 84961), @@ -119,7 +120,6 @@ class TestRunner: return None def _start_accessibility_daemons(self): - return False spi_bus_launcher_path = self._lookup_atspi2_binary('at-spi-bus-launcher') spi_registryd_path = self._lookup_atspi2_binary('at-spi2-registryd') if not spi_bus_launcher_path or not spi_registryd_path: diff --git a/Tools/Scripts/update-webkit b/Tools/Scripts/update-webkit index eb94f165b..6ba8044f4 100755 --- a/Tools/Scripts/update-webkit +++ b/Tools/Scripts/update-webkit @@ -34,7 +34,6 @@ use strict; use FindBin; use lib $FindBin::Bin; use File::Basename; -use File::Path; use File::Spec; use Getopt::Long; use VCSUtils; @@ -87,8 +86,6 @@ if ($useNinja) { $ENV{"GYP_GENERATORS"} = "ninja"; } -my $startTime = time(); - my @svnOptions = (); push @svnOptions, '-q' if $quiet; @@ -105,13 +102,6 @@ if (-d "../Internal") { runSvnUpdate() if isSVNDirectory("."); runGitUpdate() if isGitDirectory("."); } elsif (isChromium()) { - # Workaround for https://bugs.webkit.org/show_bug.cgi?id=38926 - # We should remove the following "if" block when we find a right fix. - if ((isCygwin() || isWindows()) && (stat("WebKit/chromium/features.gypi"))[9] >= $startTime) { - print "features.gypi has been updated. Cleaning the build directories.\n"; - rmtree(["WebKit/chromium/Debug", "WebKit/chromium/Release"]); - } - my @chromiumUpdateArgs = ("perl", "Tools/Scripts/update-webkit-chromium"); push @chromiumUpdateArgs, "--chromium-android" if isChromiumAndroid(); push @chromiumUpdateArgs, "--force" if forceChromiumUpdate(); diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm index 0291c4776..c0e73c246 100755 --- a/Tools/Scripts/webkitdirs.pm +++ b/Tools/Scripts/webkitdirs.pm @@ -723,7 +723,7 @@ sub builtDylibPathForName } if (isQt()) { my $isSearchingForWebCore = $libraryName =~ "WebCore"; - $libraryName = "QtWebKit"; + $libraryName = "QtWebKitWidgets"; my $result; if (isDarwin() and -d "$configurationProductDir/lib/$libraryName.framework") { $result = "$configurationProductDir/lib/$libraryName.framework/$libraryName"; @@ -2429,7 +2429,17 @@ sub buildChromiumNinja($$@) } my $command = ""; - $command .= "ninja -C out/$config $target $makeArgs"; + # Find ninja. + my $ninjaPath; + if (commandExists('ninja')) { + $ninjaPath = 'ninja'; + } elsif (-e 'Source/WebKit/chromium/depot_tools/ninja') { + $ninjaPath = 'Source/WebKit/chromium/depot_tools/ninja'; + } else { + die "ninja not found. Install chromium's depot_tools by running update-webkit first\n"; + } + + $command .= "$ninjaPath -C out/$config $target $makeArgs"; print "$command\n"; return system $command; diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 5a77bf117..b34aec74b 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -52,6 +52,7 @@ my ( $css3ConditionalRulesSupport, $css3TextSupport, $cssBoxDecorationBreakSupport, + $cssDeviceAdaptation, $cssExclusionsSupport, $cssFiltersSupport, $cssHierarchiesSupport, @@ -111,6 +112,7 @@ my ( $pageVisibilityAPISupport, $progressTagSupport, $quotaSupport, + $resolutionMediaQuerySupport, $registerProtocolHandlerSupport, $requestAnimationFrameSupport, $scriptedSpeechSupport, @@ -126,7 +128,6 @@ my ( $tiledBackingStoreSupport, $touchEventsSupport, $touchIconLoadingSupport, - $undoManagerSupport, $vibrationSupport, $videoSupport, $videoTrackSupport, @@ -138,6 +139,7 @@ my ( $webTimingSupport, $workersSupport, $xhrResponseBlobSupport, + $xhrTimeoutSupport, $xsltSupport, ); @@ -163,6 +165,9 @@ my @features = ( { option => "csp-next", desc => "Toggle Content Security Policy 1.1 support", define => "ENABLE_CSP_NEXT", default => 0, value => \$cspNextSupport }, + { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support", + define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation }, + { option => "css-exclusions", desc => "Toggle CSS Exclusions support", define => "ENABLE_CSS_EXCLUSIONS", default => 1, value => \$cssExclusionsSupport }, @@ -349,6 +354,9 @@ my @features = ( { option => "quota", desc => "Toggle Quota support", define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport }, + { option => "resolution-media-query", desc => "Toggle resolution media query support", + define => "ENABLE_RESOLUTION_MEDIA_QUERY", default => (isEfl() || isQt()), value => \$resolutionMediaQuerySupport }, + { option => "request-animation-frame", desc => "Toggle Request Animation Frame support", define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isEfl() || isBlackBerry()), value => \$requestAnimationFrameSupport }, @@ -391,9 +399,6 @@ my @features = ( { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support", define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport }, - { option => "undo-manager", desc => "Toggle Undo Manager support", - define => "ENABLE_UNDO_MANAGER", default => 0, value => \$undoManagerSupport }, - { option => "vibration", desc => "Toggle Vibration support", define => "ENABLE_VIBRATION", default => (isEfl() || isBlackBerry()), value => \$vibrationSupport }, @@ -427,6 +432,9 @@ my @features = ( { option => "xhr-response-blob", desc => "Toggle XHR Response BLOB support", define => "ENABLE_XHR_RESPONSE_BLOB", default => isBlackBerry(), value => \$xhrResponseBlobSupport }, + { option => "xhr-timeout", desc => "Toggle XHR Timeout support", + define => "ENABLE_XHR_TIMEOUT", default => (isEfl() || isGtk() || isAppleMacWebKit()), value => \$xhrTimeoutSupport }, + { option => "xslt", desc => "Toggle XSLT support", define => "ENABLE_XSLT", default => 1, value => \$xsltSupport }, ); diff --git a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py index 562d19ec8..d2d53a568 100644 --- a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py +++ b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py @@ -32,10 +32,11 @@ import logging _log = logging.getLogger(__name__) + # Yes, it's a hypergraph. # FIXME: Should this function live with the ports somewhere? # Perhaps this should move onto PortFactory? -def _baseline_search_hypergraph(host): +def _baseline_search_hypergraph(host, port_names): hypergraph = {} # These edges in the hypergraph aren't visible on build.webkit.org, @@ -46,7 +47,7 @@ def _baseline_search_hypergraph(host): fallback_path = ['LayoutTests'] port_factory = host.port_factory - for port_name in port_factory.all_port_names(): + for port_name in port_names: port = port_factory.get(port_name) webkit_base = port.webkit_base() search_path = port.baseline_search_path() @@ -74,14 +75,14 @@ def _invert_dictionary(dictionary): class BaselineOptimizer(object): - def __init__(self, host): + def __init__(self, host, port_names): self._host = host self._filesystem = self._host.filesystem self._scm = self._host.scm() - self._hypergraph = _baseline_search_hypergraph(host) + self._hypergraph = _baseline_search_hypergraph(host, port_names) self._directories = reduce(set.union, map(set, self._hypergraph.values())) - def _read_results_by_directory(self, baseline_name): + def read_results_by_directory(self, baseline_name): results_by_directory = {} for directory in self._directories: path = self._filesystem.join(self._scm.checkout_root, directory, baseline_name) @@ -122,7 +123,7 @@ class BaselineOptimizer(object): results_by_directory[directory] = result def _find_optimal_result_placement(self, baseline_name): - results_by_directory = self._read_results_by_directory(baseline_name) + results_by_directory = self.read_results_by_directory(baseline_name) results_by_port_name = self._results_by_port_name(results_by_directory) port_names_by_result = _invert_dictionary(results_by_port_name) @@ -181,7 +182,7 @@ class BaselineOptimizer(object): return best_so_far except KeyError as e: # FIXME: KeyErrors get raised if we're missing baselines. We should handle this better. - return results_by_directory + return {} def _find_in_fallbackpath(self, fallback_path, current_result, results_by_directory): for index, directory in enumerate(fallback_path): @@ -196,6 +197,15 @@ class BaselineOptimizer(object): del results_by_port_name[port_name] return results_by_port_name + def _platform(self, filename): + platform_dir = 'LayoutTests' + self._filesystem.sep + 'platform' + self._filesystem.sep + if filename.startswith(platform_dir): + return filename.replace(platform_dir, '').split(self._filesystem.sep)[0] + platform_dir = self._filesystem.join(self._scm.checkout_root, platform_dir) + if filename.startswith(platform_dir): + return filename.replace(platform_dir, '').split(self._filesystem.sep)[0] + return '(generic)' + def _move_baselines(self, baseline_name, results_by_directory, new_results_by_directory): data_for_result = {} for directory, result in results_by_directory.items(): @@ -208,12 +218,12 @@ class BaselineOptimizer(object): if new_results_by_directory.get(directory) != result: file_names.append(self._filesystem.join(self._scm.checkout_root, directory, baseline_name)) if file_names: - _log.debug("deleting:") - for filename in file_names: - _log.debug(" " + self._filesystem.relpath(filename, self._scm.checkout_root).replace(baseline_name, '')) + _log.debug(" Deleting:") + for platform_dir in sorted(self._platform(filename) for filename in file_names): + _log.debug(" " + platform_dir) self._scm.delete_list(file_names) else: - _log.debug("nothing to delete") + _log.debug(" (Nothing to delete)") file_names = [] for directory, result in new_results_by_directory.items(): @@ -223,33 +233,42 @@ class BaselineOptimizer(object): self._filesystem.write_binary_file(destination, data_for_result[result]) file_names.append(destination) if file_names: - _log.debug("adding:") - for filename in file_names: - _log.debug(" " + self._filesystem.relpath(filename, self._scm.checkout_root).replace(baseline_name, '')) + _log.debug(" Adding:") + for platform_dir in sorted(self._platform(filename) for filename in file_names): + _log.debug(" " + platform_dir) self._scm.add_list(file_names) else: - _log.debug("nothing to add") + _log.debug(" (Nothing to add)") def directories_by_result(self, baseline_name): - results_by_directory = self._read_results_by_directory(baseline_name) + results_by_directory = self.read_results_by_directory(baseline_name) return _invert_dictionary(results_by_directory) + def write_by_directory(self, results_by_directory, writer, indent): + for path in sorted(results_by_directory): + writer("%s%s: %s" % (indent, self._platform(path), results_by_directory[path][0:6])) + def optimize(self, baseline_name): + basename = self._filesystem.basename(baseline_name) results_by_directory, new_results_by_directory = self._find_optimal_result_placement(baseline_name) self.new_results_by_directory = new_results_by_directory if new_results_by_directory == results_by_directory: - _log.debug("No optimization found, optimal?") + if new_results_by_directory: + _log.debug(" %s: (already optimal)" % basename) + self.write_by_directory(results_by_directory, _log.debug, " ") + else: + _log.debug(" %s: (no baselines found)" % basename) return True if self._filtered_results_by_port_name(results_by_directory) != self._filtered_results_by_port_name(new_results_by_directory): - _log.warning("Optimization failed") + _log.warning(" %s: optimization failed" % basename) + self.write_by_directory(results_by_directory, _log.warning, " ") return False - _log.debug("before: ") - for path, result in results_by_directory.items(): - _log.debug(" %s: %s" % (self._filesystem.relpath(path, self._scm.checkout_root).replace(baseline_name, ''), result[0:6])) - _log.debug("after: ") - for path, result in new_results_by_directory.items(): - _log.debug(" %s: %s" % (self._filesystem.relpath(path, self._scm.checkout_root).replace(baseline_name, ''), result[0:6])) + _log.debug(" %s:" % basename) + _log.debug(" Before: ") + self.write_by_directory(results_by_directory, _log.debug, " ") + _log.debug(" After: ") + self.write_by_directory(new_results_by_directory, _log.debug, " ") self._move_baselines(baseline_name, results_by_directory, new_results_by_directory) return True diff --git a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py index d44f71e91..a5fd06568 100644 --- a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py +++ b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py @@ -37,12 +37,12 @@ from webkitpy.common.host_mock import MockHost class TestBaselineOptimizer(BaselineOptimizer): def __init__(self, mock_results_by_directory): host = MockHost() - BaselineOptimizer.__init__(self, host) + BaselineOptimizer.__init__(self, host, host.port_factory.all_port_names()) self._mock_results_by_directory = mock_results_by_directory # We override this method for testing so we don't have to construct an # elaborate mock file system. - def _read_results_by_directory(self, baseline_name): + def read_results_by_directory(self, baseline_name): return self._mock_results_by_directory def _move_baselines(self, baseline_name, results_by_directory, new_results_by_directory): @@ -64,7 +64,7 @@ class BaselineOptimizerTest(unittest.TestCase): host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/chromium-win/another/test-expected.txt', 'result A') host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/chromium-mac/another/test-expected.txt', 'result A') host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/chromium/another/test-expected.txt', 'result B') - baseline_optimizer = BaselineOptimizer(host) + baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_names()) baseline_optimizer._move_baselines('another/test-expected.txt', { 'LayoutTests/platform/chromium-win': 'aaa', 'LayoutTests/platform/chromium-mac': 'aaa', diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index 5396024a0..3931c5c39 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -107,6 +107,7 @@ watchers_who_are_not_contributors = [ contributors_who_are_not_committers = [ + Contributor("Adobe Bug Tracker", "WebkitBugTracker@adobe.com"), Contributor("Aharon Lanin", "aharon@google.com"), Contributor("Alan Stearns", "stearns@adobe.com", "astearns"), Contributor("Alejandro Pineiro", "apinheiro@igalia.com"), @@ -130,6 +131,7 @@ contributors_who_are_not_committers = [ Contributor("Felician Marton", ["felician@inf.u-szeged.hu", "marton.felician.zoltan@stud.u-szeged.hu"], "Felician"), Contributor("Finnur Thorarinsson", ["finnur@chromium.org", "finnur.webkit@gmail.com"], "finnur"), Contributor("Forms Bugs", "forms-bugs@chromium.org"), + Contributor("Glenn Adams", "glenn@skynav.com", "gasubic"), Contributor("Gabor Ballabas", "gaborb@inf.u-szeged.hu", "bgabor"), Contributor("Grace Kloba", "klobag@chromium.org", "klobag"), Contributor("Greg Simon", "gregsimon@chromium.org", "gregsimon"), @@ -161,7 +163,6 @@ contributors_who_are_not_committers = [ Contributor("Szilard Ledan-Muntean", "szledan@inf.u-szeged.hu", "szledan"), Contributor("Tab Atkins", ["tabatkins@google.com", "jackalmage@gmail.com"], "tabatkins"), Contributor("Tamas Czene", ["tczene@inf.u-szeged.hu", "Czene.Tamas@stud.u-szeged.hu"], "tczene"), - Contributor("Terry Anderson", "tdanderson@chromium.org", "tdanderson"), Contributor("Tien-Ren Chen", "trchen@chromium.org", "trchen"), Contributor("WebKit Review Bot", "webkit.review.bot@gmail.com", "sheriff-bot"), Contributor("Web Components Team", "webcomponents-bugzilla@chromium.org"), @@ -218,6 +219,7 @@ committers_unable_to_review = [ Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"], "otte"), Committer("Bill Budge", ["bbudge@chromium.org", "bbudge@gmail.com"], "bbudge"), Committer("Brett Wilson", "brettw@chromium.org", "brettx"), + Committer("Bruno de Oliveira Abinader", ["bruno.abinader@basyskom.com", "brunoabinader@gmail.com"], "abinader"), Committer("Cameron McCormack", ["cam@mcc.id.au", "cam@webkit.org"], "heycam"), Committer("Carol Szabo", ["carol@webkit.org", "carol.szabo@nokia.com"], "cszabo1"), Committer("Cary Clark", ["caryclark@google.com", "caryclark@chromium.org"], "caryclark"), @@ -232,7 +234,7 @@ committers_unable_to_review = [ Committer("Dan Winship", "danw@gnome.org", "danw"), Committer("Dana Jansens", "danakj@chromium.org", "danakj"), Committer("Daniel Cheng", "dcheng@chromium.org", "dcheng"), - Committer("Dave Barton", "dbarton@mathscribe.com", "dbarton"), + Committer("Dave Barton", "dbarton@mathscribe.com", "davebarton"), Committer("Dave Tharp", "dtharp@codeaurora.org", "dtharp"), Committer("David Michael Barr", ["davidbarr@chromium.org", "davidbarr@google.com", "b@rr-dav.id.au"], "barrbrain"), Committer("David Grogan", ["dgrogan@chromium.org", "dgrogan@google.com"], "dgrogan"), @@ -296,6 +298,7 @@ committers_unable_to_review = [ Committer("John Knottenbelt", "jknotten@chromium.org", "jknotten"), Committer("Johnny Ding", ["jnd@chromium.org", "johnnyding.webkit@gmail.com"], "johnnyding"), Committer("Jon Lee", "jonlee@apple.com", "jonlee"), + Committer("Jonathan Dong", ["jonathan.dong@torchmobile.com.cn"], "jondong"), Committer("Joone Hur", ["joone@webkit.org", "joone.hur@intel.com"], "joone"), Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"), Committer("Joshua Bell", ["jsbell@chromium.org", "jsbell@google.com"], "jsbell"), @@ -310,6 +313,7 @@ committers_unable_to_review = [ Committer("Kenichi Ishibashi", "bashi@chromium.org", "bashi"), Committer("Kenji Imasaki", "imasaki@chromium.org", "imasaki"), Committer("Kent Hansen", "kent.hansen@nokia.com", "khansen"), + Committer("Kihong Kwon", "kihong.kwon@samsung.com", "kihong"), Committer(u"Kim Gr\u00f6nholm", "kim.1.gronholm@nokia.com"), Committer("Kimmo Kinnunen", ["kimmo.t.kinnunen@nokia.com", "kimmok@iki.fi", "ktkinnun@webkit.org"], "kimmok"), Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"), @@ -383,7 +387,9 @@ committers_unable_to_review = [ Committer("Stephen Chenney", "schenney@chromium.org", "schenney"), Committer("Steve Lacey", "sjl@chromium.org", "stevela"), Committer("Taiju Tsuiki", "tzik@chromium.org", "tzik"), + Committer("Takashi Sakamoto", "tasak@google.com", "tasak"), Committer("Takashi Toyoshima", "toyoshim@chromium.org", "toyoshim"), + Committer("Terry Anderson", "tdanderson@chromium.org", "tdanderson"), Committer("Thomas Sepez", "tsepez@chromium.org", "tsepez"), Committer("Tom Hudson", ["tomhudson@google.com", "tomhudson@chromium.org"], "tomhudson"), Committer("Tom Zakrajsek", "tomz@codeaurora.org", "tomz"), @@ -401,7 +407,7 @@ committers_unable_to_review = [ Committer("W. James MacLean", "wjmaclean@chromium.org", "seumas"), Committer("Xianzhu Wang", ["wangxianzhu@chromium.org", "phnixwxz@gmail.com", "wangxianzhu@google.com"], "wangxianzhu"), Committer("Xiaomei Ji", "xji@chromium.org", "xji"), - Committer("Yael Aharon", "yael.aharon@nokia.com", "yael"), + Committer("Yael Aharon", ["yael.aharon.m@gmail.com", "yael@webkit.org"], "yael"), Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]), Committer("Yi Shen", ["yi.4.shen@nokia.com", "shenyi2006@gmail.com"]), Committer("Yongjun Zhang", ["yongjun.zhang@nokia.com", "yongjun_zhang@apple.com"]), @@ -496,8 +502,8 @@ reviewers_list = [ Reviewer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com", "jchaffraix@google.com", "jchaffraix@codeaurora.org"], "jchaffraix"), Reviewer("Justin Garcia", "justin.garcia@apple.com", "justing"), Reviewer("Ken Kocienda", "kocienda@apple.com"), - Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org", "kenneth.christiansen@gmail.com"], ["kenne", "kenneth"]), - Reviewer("Kenneth Russell", "kbr@google.com", "kbr_google"), + Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.r.christiansen@intel.com", "kenneth.christiansen@gmail.com"], ["kenneth_", "kenneth", "kenne"]), + Reviewer("Kenneth Russell", ["kbr@google.com", "kbr@chromium.org"], ["kbr_google", "kbrgg"]), Reviewer("Kent Tamura", ["tkent@chromium.org", "tkent@google.com"], "tkent"), Reviewer("Kentaro Hara", ["haraken@chromium.org"], "haraken"), Reviewer("Kevin Decker", "kdecker@apple.com", "superkevin"), diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist index ac2270004..c3c9c9a2c 100755 --- a/Tools/Scripts/webkitpy/common/config/watchlist +++ b/Tools/Scripts/webkitpy/common/config/watchlist @@ -259,8 +259,9 @@ "filename": r"Source/WebCore/svg" r"|Source/WebCore/rendering/svg", }, - "WebInspectorProtocol": { - "filename": r"Source/WebCore/inspector/Inspector.json", + "WebInspectorAPI": { + "filename": r"Source/WebCore/inspector/*.json" + r"|Source/WebCore/inspector/*.idl", }, "WebSocket": { "filename": r"Source/WebCore/Modules/websockets" @@ -334,7 +335,7 @@ "WatchListScript": [ "levin+watchlist@chromium.org", ], "WebGL": [ "dino@apple.com" ], "WebIDL": [ "abarth@webkit.org", "ojan@chromium.org" ], - "WebInspectorProtocol": [ "timothy@apple.com", "joepeck@webkit.org" ], + "WebInspectorAPI": [ "timothy@apple.com", "joepeck@webkit.org" ], "WebKitGTKTranslations": [ "gns@gnome.org", "mrobinson@webkit.org" ], "WebSocket": [ "yutak@chromium.org" ], "XSS": [ "dbates@webkit.org" ], diff --git a/Tools/Scripts/webkitpy/common/net/web_mock.py b/Tools/Scripts/webkitpy/common/net/web_mock.py index 596dd0a41..423573c60 100644 --- a/Tools/Scripts/webkitpy/common/net/web_mock.py +++ b/Tools/Scripts/webkitpy/common/net/web_mock.py @@ -30,7 +30,11 @@ import StringIO class MockWeb(object): + def __init__(self): + self.urls_fetched = [] + def get_binary(self, url, convert_404_to_None=False): + self.urls_fetched.append(url) return "MOCK Web result, convert 404 to None=%s" % convert_404_to_None diff --git a/Tools/Scripts/webkitpy/common/system/autoinstall.py b/Tools/Scripts/webkitpy/common/system/autoinstall.py index 00aff83ff..f3045f86b 100755 --- a/Tools/Scripts/webkitpy/common/system/autoinstall.py +++ b/Tools/Scripts/webkitpy/common/system/autoinstall.py @@ -33,7 +33,6 @@ import codecs import logging -import new import os import shutil import sys @@ -42,7 +41,6 @@ import tempfile import urllib import urlparse import zipfile -import zipimport _log = logging.getLogger(__name__) @@ -97,35 +95,9 @@ class AutoInstaller(object): self._target_dir = target_dir self._temp_dir = temp_dir - def _log_transfer(self, message, source, target, log_method=None): - """Log a debug message that involves a source and target.""" - if log_method is None: - log_method = _log.debug - - log_method("%s" % message) - log_method(' From: "%s"' % source) - log_method(' To: "%s"' % target) - - def _create_directory(self, path, name=None): - """Create a directory.""" - log = _log.debug - - name = name + " " if name is not None else "" - log('Creating %sdirectory...' % name) - log(' "%s"' % path) - - os.makedirs(path) - def _write_file(self, path, text, encoding): - """Create a file at the given path with given text. - - This method overwrites any existing file. - - """ - _log.debug("Creating file...") - _log.debug(' "%s"' % path) - with codecs.open(path, "w", encoding) as file: - file.write(text) + with codecs.open(path, "w", encoding) as filehandle: + filehandle.write(text) def _set_up_target_dir(self, target_dir, append_to_search_path, make_package): @@ -143,17 +115,20 @@ class AutoInstaller(object): """ if not os.path.exists(target_dir): - self._create_directory(target_dir, "autoinstall target") + os.makedirs(target_dir) if append_to_search_path: sys.path.append(target_dir) if make_package: - init_path = os.path.join(target_dir, "__init__.py") - if not os.path.exists(init_path): - text = ("# This file is required for Python to search this " - "directory for modules.\n") - self._write_file(init_path, text, "ascii") + self._make_package(target_dir) + + def _make_package(self, target_dir): + init_path = os.path.join(target_dir, "__init__.py") + if not os.path.exists(init_path): + text = ("# This file is required for Python to search this " + "directory for modules.\n") + self._write_file(init_path, text, "ascii") def _create_scratch_directory_inner(self, prefix): """Create a scratch directory without exception handling. @@ -182,7 +157,7 @@ class AutoInstaller(object): temp directory if it does not already exist. """ - prefix = target_name + "_" + prefix = target_name.replace(os.sep, "_") + "_" try: scratch_dir = self._create_scratch_directory_inner(prefix) except OSError: @@ -192,51 +167,32 @@ class AutoInstaller(object): if temp_dir is None or os.path.exists(temp_dir): raise # Else try again after creating the temp directory. - self._create_directory(temp_dir, "autoinstall temp") + os.makedirs(temp_dir) scratch_dir = self._create_scratch_directory_inner(prefix) return scratch_dir def _url_downloaded_path(self, target_name): - """Return the path to the file containing the URL downloaded.""" - filename = ".%s.url" % target_name - path = os.path.join(self._target_dir, filename) - return path + return os.path.join(self._target_dir, ".%s.url" % target_name) def _is_downloaded(self, target_name, url): - """Return whether a package version has been downloaded.""" version_path = self._url_downloaded_path(target_name) - _log.debug('Checking %s URL downloaded...' % target_name) - _log.debug(' "%s"' % version_path) - if not os.path.exists(version_path): - # Then no package version has been downloaded. - _log.debug("No URL file found.") return False - with codecs.open(version_path, "r", "utf-8") as file: - version = file.read() - - return version.strip() == url.strip() + with codecs.open(version_path, "r", "utf-8") as filehandle: + return filehandle.read().strip() == url.strip() def _record_url_downloaded(self, target_name, url): - """Record the URL downloaded to a file.""" version_path = self._url_downloaded_path(target_name) - _log.debug("Recording URL downloaded...") - _log.debug(' URL: "%s"' % url) - _log.debug(' To: "%s"' % version_path) - self._write_file(version_path, url, "utf-8") def _extract_targz(self, path, scratch_dir): - # tarfile.extractall() extracts to a path without the - # trailing ".tar.gz". + # tarfile.extractall() extracts to a path without the trailing ".tar.gz". target_basename = os.path.basename(path[:-len(".tar.gz")]) target_path = os.path.join(scratch_dir, target_basename) - self._log_transfer("Starting gunzip/extract...", path, target_path) - try: tar_file = tarfile.open(path) except tarfile.ReadError, err: @@ -248,11 +204,6 @@ class AutoInstaller(object): raise Exception(message) try: - # This is helpful for debugging purposes. - _log.debug("Listing tar file contents...") - for name in tar_file.getnames(): - _log.debug(' * "%s"' % name) - _log.debug("Extracting gzipped tar file...") tar_file.extractall(target_path) finally: tar_file.close() @@ -263,33 +214,23 @@ class AutoInstaller(object): # available in Python 2.6 but not in earlier versions. # NOTE: The version in 2.6.1 (which shipped on Snow Leopard) is broken! def _extract_all(self, zip_file, target_dir): - self._log_transfer("Extracting zip file...", zip_file, target_dir) - - # This is helpful for debugging purposes. - _log.debug("Listing zip file contents...") - for name in zip_file.namelist(): - _log.debug(' * "%s"' % name) - for name in zip_file.namelist(): path = os.path.join(target_dir, name) - self._log_transfer("Extracting...", name, path) - if not os.path.basename(path): # Then the path ends in a slash, so it is a directory. - self._create_directory(path) + os.makedirs(path) continue - # Otherwise, it is a file. try: # We open this file w/o encoding, as we're reading/writing # the raw byte-stream from the zip file. outfile = open(path, 'wb') - except IOError, err: + except IOError: # Not all zip files seem to list the directories explicitly, # so try again after creating the containing directory. _log.debug("Got IOError: retrying after creating directory...") - dir = os.path.dirname(path) - self._create_directory(dir) + dirname = os.path.dirname(path) + os.makedirs(dirname) outfile = open(path, 'wb') try: @@ -298,13 +239,10 @@ class AutoInstaller(object): outfile.close() def _unzip(self, path, scratch_dir): - # zipfile.extractall() extracts to a path without the - # trailing ".zip". + # zipfile.extractall() extracts to a path without the trailing ".zip". target_basename = os.path.basename(path[:-len(".zip")]) target_path = os.path.join(scratch_dir, target_basename) - self._log_transfer("Starting unzip...", path, target_path) - try: zip_file = zipfile.ZipFile(path, "r") except zipfile.BadZipfile, err: @@ -345,7 +283,6 @@ class AutoInstaller(object): return new_path def _download_to_stream(self, url, stream): - """Download an URL to a stream, and return the number of bytes.""" try: netstream = urllib.urlopen(url) except IOError, err: @@ -364,29 +301,21 @@ class AutoInstaller(object): raise ValueError("HTTP Error code %s" % code) BUFSIZE = 2**13 # 8KB - bytes = 0 while True: data = netstream.read(BUFSIZE) if not data: break stream.write(data) - bytes += len(data) netstream.close() - return bytes def _download(self, url, scratch_dir): - """Download URL contents, and return the download path.""" url_path = urlparse.urlsplit(url)[2] url_path = os.path.normpath(url_path) # Removes trailing slash. target_filename = os.path.basename(url_path) target_path = os.path.join(scratch_dir, target_filename) - self._log_transfer("Starting download...", url, target_path) - with open(target_path, "wb") as stream: - bytes = self._download_to_stream(url, stream) - - _log.debug("Downloaded %s bytes." % bytes) + self._download_to_stream(url, stream) return target_path @@ -407,19 +336,21 @@ class AutoInstaller(object): source_path = os.path.join(path, url_subpath) if os.path.exists(target_path): - _log.debug('Refreshing install: deleting "%s".' % target_path) if os.path.isdir(target_path): shutil.rmtree(target_path) else: os.remove(target_path) - self._log_transfer("Moving files into place...", source_path, target_path) - - # The shutil.move() command creates intermediate directories if they - # do not exist, but we do not rely on this behavior since we - # need to create the __init__.py file anyway. + # shutil.move() command creates intermediate directories if they do not exist. shutil.move(source_path, target_path) + # ensure all the new directories are importable. + intermediate_dirs = os.path.dirname(os.path.relpath(target_path, self._target_dir)) + parent_dirname = self._target_dir + for dirname in intermediate_dirs.split(os.sep): + parent_dirname = os.path.join(parent_dirname, dirname) + self._make_package(parent_dirname) + self._record_url_downloaded(package_name, url) def install(self, url, should_refresh=False, target_name=None, @@ -453,13 +384,10 @@ class AutoInstaller(object): target_path = os.path.join(self._target_dir, target_name) if not should_refresh and self._is_downloaded(target_name, url): - _log.debug('URL for %s already downloaded. Skipping...' - % target_name) - _log.debug(' "%s"' % url) return False - self._log_transfer("Auto-installing package: %s" % target_name, - url, target_path, log_method=_log.info) + package_name = target_name.replace(os.sep, '.') + _log.info("Auto-installing package: %s" % package_name) # The scratch directory is where we will download and prepare # files specific to this install until they are ready to move @@ -467,7 +395,7 @@ class AutoInstaller(object): scratch_dir = self._create_scratch_directory(target_name) try: - self._install(package_name=target_name, + self._install(package_name=package_name, target_path=target_path, scratch_dir=scratch_dir, url=url, @@ -480,38 +408,7 @@ class AutoInstaller(object): % (target_name, target_path, err)) raise Exception(message) finally: - _log.debug('Cleaning up: deleting "%s".' % scratch_dir) shutil.rmtree(scratch_dir) - _log.debug('Auto-installed %s to:' % target_name) + _log.debug('Auto-installed %s to:' % url) _log.debug(' "%s"' % target_path) return True - - -if __name__=="__main__": - - # Configure the autoinstall logger to log DEBUG messages for - # development testing purposes. - console = logging.StreamHandler() - - formatter = logging.Formatter('%(name)s: %(levelname)-8s %(message)s') - console.setFormatter(formatter) - _log.addHandler(console) - _log.setLevel(logging.DEBUG) - - # Use a more visible temp directory for debug purposes. - this_dir = os.path.dirname(__file__) - target_dir = os.path.join(this_dir, "autoinstalled") - temp_dir = os.path.join(target_dir, "Temp") - - installer = AutoInstaller(target_dir=target_dir, - temp_dir=temp_dir) - - installer.install(should_refresh=False, - target_name="pep8.py", - url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b", - url_subpath="pep8-0.5.0/pep8.py") - installer.install(should_refresh=False, - target_name="mechanize", - url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.4.zip", - url_subpath="mechanize") - diff --git a/Tools/Scripts/webkitpy/common/system/executive.py b/Tools/Scripts/webkitpy/common/system/executive.py index f1a401268..b1d239090 100644 --- a/Tools/Scripts/webkitpy/common/system/executive.py +++ b/Tools/Scripts/webkitpy/common/system/executive.py @@ -215,6 +215,9 @@ class Executive(object): if e.errno == errno.ECHILD: # Can't wait on a non-child process, but the kill worked. return + if e.errno == errno.EACCES and sys.platform == 'cygwin': + # Cygwin python sometimes can't kill native processes. + return raise def _win32_check_running_pid(self, pid): diff --git a/Tools/Scripts/webkitpy/common/system/executive_mock.py b/Tools/Scripts/webkitpy/common/system/executive_mock.py index cce21b233..c2613530b 100644 --- a/Tools/Scripts/webkitpy/common/system/executive_mock.py +++ b/Tools/Scripts/webkitpy/common/system/executive_mock.py @@ -60,6 +60,7 @@ class MockExecutive(object): # FIXME: Once executive wraps os.getpid() we can just use a static pid for "this" process. self._running_pids = {'test-webkitpy': os.getpid()} self._proc = None + self.calls = [] def check_running_pid(self, pid): return pid in self._running_pids.values() @@ -92,6 +93,9 @@ class MockExecutive(object): return_stderr=True, decode_output=False, env=None): + + self.calls.append(args) + assert(isinstance(args, list) or isinstance(args, tuple)) if self._should_log: env_string = "" @@ -109,7 +113,14 @@ class MockExecutive(object): def cpu_count(self): return 2 + def kill_all(self, process_name): + pass + + def kill_process(self, pid): + pass + def popen(self, args, cwd=None, env=None, **kwargs): + self.calls.append(args) if self._should_log: cwd_string = "" if cwd: @@ -123,32 +134,27 @@ class MockExecutive(object): return self._proc def run_in_parallel(self, commands): + num_previous_calls = len(self.calls) command_outputs = [] for cmd_line, cwd in commands: command_outputs.append([0, self.run_command(cmd_line, cwd=cwd), '']) + + new_calls = self.calls[num_previous_calls:] + self.calls = self.calls[:num_previous_calls] + self.calls.append(new_calls) return command_outputs -class MockExecutive2(object): - @staticmethod - def ignore_error(error): - pass - def __init__(self, output='', exit_code=0, exception=None, - run_command_fn=None, stderr=''): +class MockExecutive2(MockExecutive): + """MockExecutive2 is like MockExecutive except it doesn't log anything.""" + + def __init__(self, output='', exit_code=0, exception=None, run_command_fn=None, stderr=''): self._output = output self._stderr = stderr self._exit_code = exit_code self._exception = exception self._run_command_fn = run_command_fn - - def cpu_count(self): - return 2 - - def kill_all(self, process_name): - pass - - def kill_process(self, pid): - pass + self.calls = [] def run_command(self, args, @@ -159,6 +165,7 @@ class MockExecutive2(object): return_stderr=True, decode_output=False, env=None): + self.calls.append(args) assert(isinstance(args, list) or isinstance(args, tuple)) if self._exception: raise self._exception diff --git a/Tools/Scripts/webkitpy/common/system/file_lock_mock.py b/Tools/Scripts/webkitpy/common/system/file_lock_mock.py new file mode 100644 index 000000000..e2c1d5cdf --- /dev/null +++ b/Tools/Scripts/webkitpy/common/system/file_lock_mock.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# Copyright (c) 2012 Google Inc. All rights reserved. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +class MockFileLock(object): + def __init__(self, lock_file_path, max_wait_time_sec=20): + pass + + def acquire_lock(self): + pass + + def release_lock(self): + pass diff --git a/Tools/Scripts/webkitpy/common/system/logutils.py b/Tools/Scripts/webkitpy/common/system/logutils.py index eef463693..def3bec4e 100644 --- a/Tools/Scripts/webkitpy/common/system/logutils.py +++ b/Tools/Scripts/webkitpy/common/system/logutils.py @@ -125,7 +125,7 @@ def get_logger(path): return logging.getLogger(logger_name) -def _default_handlers(stream): +def _default_handlers(stream, logging_level): """Return a list of the default logging handlers to use. Args: @@ -148,7 +148,11 @@ def _default_handlers(stream): # Create the handler. handler = logging.StreamHandler(stream) - formatter = logging.Formatter("%(name)s: [%(levelname)s] %(message)s") + if logging_level == logging.DEBUG: + formatter = logging.Formatter("%(name)s: [%(levelname)s] %(message)s") + else: + formatter = logging.Formatter("%(message)s") + handler.setFormatter(formatter) handler.addFilter(logging_filter) @@ -195,7 +199,7 @@ def configure_logging(logging_level=None, logger=None, stream=None, if stream is None: stream = sys.stderr if handlers is None: - handlers = _default_handlers(stream) + handlers = _default_handlers(stream, logging_level) logger.setLevel(logging_level) diff --git a/Tools/Scripts/webkitpy/common/system/logutils_unittest.py b/Tools/Scripts/webkitpy/common/system/logutils_unittest.py index f1b494d4d..72789eb37 100644 --- a/Tools/Scripts/webkitpy/common/system/logutils_unittest.py +++ b/Tools/Scripts/webkitpy/common/system/logutils_unittest.py @@ -107,7 +107,11 @@ class ConfigureLoggingTest(ConfigureLoggingTestBase): def test_info_message(self): self._log.info("test message") - self._assert_log_messages(["unittest: [INFO] test message\n"]) + self._assert_log_messages(["test message\n"]) + + def test_debug_message(self): + self._log.debug("test message") + self._assert_log_messages([]) def test_below_threshold_message(self): # We test the boundary case of a logging level equal to 19. @@ -120,9 +124,21 @@ class ConfigureLoggingTest(ConfigureLoggingTestBase): def test_two_messages(self): self._log.info("message1") self._log.info("message2") - self._assert_log_messages(["unittest: [INFO] message1\n", - "unittest: [INFO] message2\n"]) + self._assert_log_messages(["message1\n", + "message2\n"]) + + +class ConfigureLoggingVerboseTest(ConfigureLoggingTestBase): + def _logging_level(self): + return logging.DEBUG + + def test_info_message(self): + self._log.info("test message") + self._assert_log_messages(["unittest: [INFO] test message\n"]) + def test_debug_message(self): + self._log.debug("test message") + self._assert_log_messages(["unittest: [DEBUG] test message\n"]) class ConfigureLoggingCustomLevelTest(ConfigureLoggingTestBase): @@ -135,7 +151,7 @@ class ConfigureLoggingCustomLevelTest(ConfigureLoggingTestBase): def test_logged_message(self): self._log.log(self._level, "test message") - self._assert_log_messages(["unittest: [Level 36] test message\n"]) + self._assert_log_messages(["test message\n"]) def test_below_threshold_message(self): self._log.log(self._level - 1, "test message") diff --git a/Tools/Scripts/webkitpy/common/system/platforminfo.py b/Tools/Scripts/webkitpy/common/system/platforminfo.py index a9717cc84..b2451f5f9 100644 --- a/Tools/Scripts/webkitpy/common/system/platforminfo.py +++ b/Tools/Scripts/webkitpy/common/system/platforminfo.py @@ -27,6 +27,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import re +import sys class PlatformInfo(object): @@ -86,6 +87,31 @@ class PlatformInfo(object): return long(self._executive.run_command(["sysctl", "-n", "hw.memsize"])) return None + def terminal_width(self): + """Returns sys.maxint if the width cannot be determined.""" + try: + if self.is_win(): + # From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/ + from ctypes import windll, create_string_buffer + handle = windll.kernel32.GetStdHandle(-12) # -12 == stderr + console_screen_buffer_info = create_string_buffer(22) # 22 == sizeof(console_screen_buffer_info) + if windll.kernel32.GetConsoleScreenBufferInfo(handle, console_screen_buffer_info): + import struct + _, _, _, _, _, left, _, right, _, _, _ = struct.unpack("hhhhHhhhhhh", console_screen_buffer_info.raw) + # Note that we return 1 less than the width since writing into the rightmost column + # automatically performs a line feed. + return right - left + return sys.maxint + else: + import fcntl + import struct + import termios + packed = fcntl.ioctl(sys.stderr.fileno(), termios.TIOCGWINSZ, '\0' * 8) + _, columns, _, _ = struct.unpack('HHHH', packed) + return columns + except: + return sys.maxint + def _determine_os_name(self, sys_platform): if sys_platform == 'darwin': return 'mac' diff --git a/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py b/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py index 34fa97fb4..bc72810cf 100644 --- a/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py +++ b/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py @@ -42,7 +42,7 @@ class MockPlatformInfo(object): return self.os_name == 'win' def is_cygwin(self): - return False + return self.os_name == 'cygwin' def is_freebsd(self): return self.os_name == 'freebsd' @@ -52,3 +52,6 @@ class MockPlatformInfo(object): def total_bytes_memory(self): return 3 * 1024 * 1024 * 1024 # 3GB is a reasonable amount of ram to mock. + + def terminal_width(self): + return 80 diff --git a/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py b/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py index 445ef5f7d..a2b4255b7 100644 --- a/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py +++ b/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py @@ -79,6 +79,7 @@ class TestPlatformInfo(unittest.TestCase): self.assertNotEquals(info.os_version, '') self.assertNotEquals(info.display_name(), '') self.assertTrue(info.is_mac() or info.is_win() or info.is_linux() or info.is_freebsd()) + self.assertNotEquals(info.terminal_width(), None) if info.is_mac(): self.assertTrue(info.total_bytes_memory() > 0) diff --git a/Tools/Scripts/webkitpy/common/system/systemhost.py b/Tools/Scripts/webkitpy/common/system/systemhost.py index 3b4439ee4..dfec68bc1 100644 --- a/Tools/Scripts/webkitpy/common/system/systemhost.py +++ b/Tools/Scripts/webkitpy/common/system/systemhost.py @@ -30,7 +30,7 @@ import os import platform import sys -from webkitpy.common.system import environment, executive, filesystem, platforminfo, user, workspace +from webkitpy.common.system import environment, executive, file_lock, filesystem, platforminfo, user, workspace class SystemHost(object): @@ -43,3 +43,6 @@ class SystemHost(object): def copy_current_environment(self): return environment.Environment(os.environ.copy()) + + def make_file_lock(self, path): + return file_lock.FileLock(path) diff --git a/Tools/Scripts/webkitpy/common/system/systemhost_mock.py b/Tools/Scripts/webkitpy/common/system/systemhost_mock.py index 4667b08b9..a529f3483 100644 --- a/Tools/Scripts/webkitpy/common/system/systemhost_mock.py +++ b/Tools/Scripts/webkitpy/common/system/systemhost_mock.py @@ -29,6 +29,7 @@ from webkitpy.common.system.environment import Environment from webkitpy.common.system.executive_mock import MockExecutive from webkitpy.common.system.filesystem_mock import MockFileSystem +from webkitpy.common.system.file_lock_mock import MockFileLock from webkitpy.common.system.platforminfo_mock import MockPlatformInfo from webkitpy.common.system.user_mock import MockUser from webkitpy.common.system.workspace_mock import MockWorkspace @@ -50,3 +51,6 @@ class MockSystemHost(object): def copy_current_environment(self): return Environment({"MOCK_ENVIRON_COPY": '1'}) + + def make_file_lock(self, path): + return MockFileLock(path) diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py index 420128619..17cbe3125 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py @@ -126,7 +126,7 @@ class LayoutTestRunner(object): all_shards = locked_shards + unlocked_shards self._remaining_locked_shards = locked_shards - if locked_shards and self._options.http: + if self._port.requires_http_server() or (locked_shards and self._options.http): self.start_servers_with_lock(2 * min(num_workers, len(locked_shards))) num_workers = min(num_workers, len(all_shards)) @@ -252,7 +252,7 @@ class LayoutTestRunner(object): index = find(list_name, self._remaining_locked_shards) if index >= 0: self._remaining_locked_shards.pop(index) - if not self._remaining_locked_shards: + if not self._remaining_locked_shards and not self._port.requires_http_server(): self.stop_servers_with_lock() def _handle_finished_test(self, worker_name, result, elapsed_time, log_messages=[]): diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py index c0a70e615..636edd2be 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py @@ -459,7 +459,7 @@ class Manager(object): def _run_tests(self, tests, result_summary, num_workers): test_inputs = [self._test_input_for_file(test) for test in tests] - needs_http = any(self._is_http_test(test) for test in tests) + needs_http = self._port.requires_http_server() or any(self._is_http_test(test) for test in tests) needs_websockets = any(self._is_websocket_test(test) for test in tests) return self._runner.run_tests(test_inputs, self._expectations, result_summary, num_workers, needs_http, needs_websockets, self._retrying) diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py index b48c5b933..234259657 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py @@ -689,7 +689,7 @@ class TestExpectationsModel(object): # to be warnings and return False". if prev_expectation_line.matching_configurations == expectation_line.matching_configurations: - expectation_line.warnings.append('Duplicate or ambiguous entry for %s on lines %s:%d and %s:%d.' % (expectation_line.name, + expectation_line.warnings.append('Duplicate or ambiguous entry lines %s:%d and %s:%d.' % ( self._shorten_filename(prev_expectation_line.filename), prev_expectation_line.line_number, self._shorten_filename(expectation_line.filename), expectation_line.line_number)) return True @@ -758,16 +758,16 @@ class TestExpectations(object): 'missing': MISSING} # (aggregated by category, pass/fail/skip, type) - EXPECTATION_DESCRIPTIONS = {SKIP: ('skipped', 'skipped', ''), - PASS: ('passes', 'passed', ''), - FAIL: ('failures', 'failed', ''), - IMAGE: ('image-only failures', 'failed', ' (image diff)'), - TEXT: ('text-only failures', 'failed', ' (text diff)'), - IMAGE_PLUS_TEXT: ('image and text failures', 'failed', ' (image and text diff)'), - AUDIO: ('audio failures', 'failed', ' (audio diff)'), - CRASH: ('crashes', 'crashed', ''), - TIMEOUT: ('timeouts', 'timed out', ''), - MISSING: ('no expected results found', 'no expected result found', '')} + EXPECTATION_DESCRIPTIONS = {SKIP: 'skipped', + PASS: 'passes', + FAIL: 'failures', + IMAGE: 'image-only failures', + TEXT: 'text-only failures', + IMAGE_PLUS_TEXT: 'image and text failures', + AUDIO: 'audio failures', + CRASH: 'crashes', + TIMEOUT: 'timeouts', + MISSING: 'missing results'} EXPECTATION_ORDER = (PASS, CRASH, TIMEOUT, MISSING, FAIL, IMAGE, SKIP) @@ -837,16 +837,19 @@ class TestExpectations(object): suffixes.add('wav') return set(suffixes) - def __init__(self, port, tests=None, is_lint_mode=False, include_overrides=True): + # FIXME: This constructor does too much work. We should move the actual parsing of + # the expectations into separate routines so that linting and handling overrides + # can be controlled separately, and the constructor can be more of a no-op. + def __init__(self, port, tests=None, include_overrides=True, expectations_to_lint=None): self._full_test_list = tests self._test_config = port.test_configuration() - self._is_lint_mode = is_lint_mode + self._is_lint_mode = expectations_to_lint is not None self._model = TestExpectationsModel(self._shorten_filename) - self._parser = TestExpectationParser(port, tests, is_lint_mode) + self._parser = TestExpectationParser(port, tests, self._is_lint_mode) self._port = port self._skipped_tests_warnings = [] - expectations_dict = port.expectations_dict() + expectations_dict = expectations_to_lint or port.expectations_dict() self._expectations = self._parser.parse(expectations_dict.keys()[0], expectations_dict.values()[0]) self._add_expectations(self._expectations) @@ -929,6 +932,10 @@ class TestExpectations(object): self._has_warnings = True if self._is_lint_mode: raise ParseError(warnings) + _log.warning('--lint-test-files warnings:') + for warning in warnings: + _log.warning(warning) + _log.warning('') def _process_tests_without_expectations(self): if self._full_test_list: diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py index c3fc02658..d78ae3f2b 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py @@ -80,7 +80,8 @@ Bug(test) failures/expected/image.html [ WontFix Mac ] if overrides: expectations_dict['overrides'] = overrides self._port.expectations_dict = lambda: expectations_dict - self._exp = TestExpectations(self._port, self.get_basic_tests(), is_lint_mode) + expectations_to_lint = expectations_dict if is_lint_mode else None + self._exp = TestExpectations(self._port, self.get_basic_tests(), expectations_to_lint=expectations_to_lint) def assert_exp(self, test, result): self.assertEquals(self._exp.get_expectations(self.get_test(test)), @@ -183,6 +184,15 @@ class MiscTests(Base): "expectations:2 Path does not exist. non-existent-test.html") self.assertEqual(str(e), warnings) + def test_parse_warnings_are_logged_if_not_in_lint_mode(self): + oc = OutputCapture() + try: + oc.capture_output() + self.parse_exp('-- this should be a syntax error', is_lint_mode=False) + finally: + _, _, logs = oc.restore_output() + self.assertNotEquals(logs, '') + def test_error_on_different_platform(self): # parse_exp uses a Windows port. Assert errors on Mac show up in lint mode. self.assertRaises(ParseError, self.parse_exp, @@ -247,7 +257,8 @@ class SkippedTests(Base): expectations_dict['overrides'] = overrides port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(skips) - exp = TestExpectations(port, ['failures/expected/text.html'], lint) + expectations_to_lint = expectations_dict if lint else None + exp = TestExpectations(port, ['failures/expected/text.html'], expectations_to_lint=expectations_to_lint) # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ] self.assertEquals(exp.get_modifiers('failures/expected/text.html'), diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py b/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py index 13d4001b5..402b30aea 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py @@ -110,20 +110,18 @@ class TestFailure(object): class FailureTimeout(TestFailure): - """Test timed out. We also want to restart DumpRenderTree if this happens.""" def __init__(self, is_reftest=False): super(FailureTimeout, self).__init__() self.is_reftest = is_reftest def message(self): - return "Test timed out" + return "test timed out" def driver_needs_restart(self): return True class FailureCrash(TestFailure): - """DumpRenderTree/WebKitTestRunner crashed.""" def __init__(self, is_reftest=False, process_name='DumpRenderTree', pid=None): super(FailureCrash, self).__init__() self.process_name = process_name @@ -132,7 +130,7 @@ class FailureCrash(TestFailure): def message(self): if self.pid: - return "%s (pid %d) crashed" % (self.process_name, self.pid) + return "%s crashed [pid=%d]" % (self.process_name, self.pid) return self.process_name + " crashed" def driver_needs_restart(self): @@ -140,101 +138,79 @@ class FailureCrash(TestFailure): class FailureMissingResult(TestFailure): - """Expected result was missing.""" - def message(self): - return "No expected results found" + return "-expected.txt was missing" class FailureTextMismatch(TestFailure): - """Text diff output failed.""" - def message(self): - return "Text diff mismatch" - + return "text diff" class FailureMissingImageHash(TestFailure): - """Actual result hash was missing.""" - def message(self): - return "No expected image hash found" + return "-expected.png was missing an embedded checksum" class FailureMissingImage(TestFailure): - """Actual result image was missing.""" - def message(self): - return "No expected image found" + return "-expected.png was missing" class FailureImageHashMismatch(TestFailure): - """Image hashes didn't match.""" def __init__(self, diff_percent=0): super(FailureImageHashMismatch, self).__init__() self.diff_percent = diff_percent def message(self): - return "Image mismatch" + return "image diff" class FailureImageHashIncorrect(TestFailure): - """Actual result hash is incorrect.""" - def message(self): - return "Images match, expected image hash incorrect. " + return "-expected.png embedded checksum is incorrect" class FailureReftestMismatch(TestFailure): - """The result didn't match the reference rendering.""" - def __init__(self, reference_filename=None): super(FailureReftestMismatch, self).__init__() self.reference_filename = reference_filename self.diff_percent = None def message(self): - return "Mismatch with reference" + return "reference mismatch" class FailureReftestMismatchDidNotOccur(TestFailure): - """Unexpected match between the result and the reference rendering.""" - def __init__(self, reference_filename=None): super(FailureReftestMismatchDidNotOccur, self).__init__() self.reference_filename = reference_filename def message(self): - return "Mismatch with the reference did not occur" + return "reference mismatch didn't happen" class FailureReftestNoImagesGenerated(TestFailure): - """Both the reftest and the -expected html file didn't generate pixel results.""" - def __init__(self, reference_filename=None): super(FailureReftestNoImagesGenerated, self).__init__() self.reference_filename = reference_filename def message(self): - return "Reftest didn't generate pixel results." + return "reference didn't generate pixel results." class FailureMissingAudio(TestFailure): - """Actual result image was missing.""" - def message(self): - return "No expected audio found" + return "expected audio result was missing" class FailureAudioMismatch(TestFailure): - """Audio files didn't match.""" - def message(self): - return "Audio mismatch" + return "audio mismatch" class FailureEarlyExit(TestFailure): def message(self): - return "Skipped due to early exit" + return "skipped due to early exit" # Convenient collection of all failure classes for anything that might diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_failures_unittest.py b/Tools/Scripts/webkitpy/layout_tests/models/test_failures_unittest.py index e096b171f..1c8f029a6 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_failures_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_failures_unittest.py @@ -70,4 +70,4 @@ class TestFailuresTest(unittest.TestCase): def test_crashes(self): self.assertEquals(FailureCrash().message(), 'DumpRenderTree crashed') - self.assertEquals(FailureCrash(process_name='foo', pid=1234).message(), 'foo (pid 1234) crashed') + self.assertEquals(FailureCrash(process_name='foo', pid=1234).message(), 'foo crashed [pid=1234]') diff --git a/Tools/Scripts/webkitpy/layout_tests/port/__init__.py b/Tools/Scripts/webkitpy/layout_tests/port/__init__.py index 93bda9f56..6365b4ce8 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/__init__.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/__init__.py @@ -33,4 +33,4 @@ import builders # Why is this in port? from base import Port # It's possible we don't need to export this virtual baseclass outside the module. from driver import Driver, DriverInput, DriverOutput -from factory import port_options +from factory import platform_options, configuration_options diff --git a/Tools/Scripts/webkitpy/layout_tests/port/apple.py b/Tools/Scripts/webkitpy/layout_tests/port/apple.py index 055419a14..4b97f419b 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/apple.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/apple.py @@ -98,6 +98,3 @@ class ApplePort(Port): for architecture in self.ARCHITECTURES: configurations.append(TestConfiguration(version=self._strip_port_name_prefix(port_name), architecture=architecture, build_type=build_type)) return configurations - - def expectations_files(self): - return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpectations') for d in self._skipped_file_search_paths()] diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py index ae55c684d..ea1e9d033 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/base.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py @@ -207,7 +207,6 @@ class Port(object): baseline_search_paths = self.baseline_search_path() return baseline_search_paths[0] - def baseline_search_path(self): return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path() @@ -697,11 +696,8 @@ class Port(object): return self._filesystem.abspath(self.path_from_webkit_base('.')) def skipped_layout_tests(self, test_list): - """Returns the set of tests found in Skipped files. Does *not* include tests marked as SKIP in expectations files.""" - tests_to_skip = set(self._expectations_from_skipped_files(self._skipped_file_search_paths())) - tests_to_skip.update(self._tests_for_other_platforms()) - tests_to_skip.update(self._skipped_tests_for_unsupported_features(test_list)) - return tests_to_skip + """Returns tests skipped outside of the TestExpectations files.""" + return set(self._tests_for_other_platforms()).union(self._skipped_tests_for_unsupported_features(test_list)) def _tests_from_skipped_file_contents(self, skipped_file_contents): tests_to_skip = [] @@ -903,6 +899,11 @@ class Port(object): method.""" pass + def requires_http_server(self): + """Does the port require an HTTP server for running tests? This could + be the case when the tests aren't run on the host platform.""" + return False + def start_http_server(self, additional_dirs=None, number_of_servers=None): """Start a web server. Raise an error if it can't start or is already running. @@ -927,6 +928,13 @@ class Port(object): server.start() self._websocket_server = server + def http_server_supports_ipv6(self): + # Cygwin is the only platform to still use Apache 1.3, which only supports IPV4. + # Once it moves to Apache 2, we can drop this method altogether. + if self.host.platform.is_cygwin(): + return False + return True + def acquire_http_lock(self): self._http_lock = http_lock.HttpLock(None, filesystem=self._filesystem, executive=self._executive) self._http_lock.wait_for_httpd_lock() @@ -1030,8 +1038,20 @@ class Port(object): return expectations def expectations_files(self): - # FIXME: see comment in path_to_expectations_file(). - return [self.path_to_test_expectations_file()] + # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] and any directories + # included via --additional-platform-directory, not the full casade. + search_paths = [self.port_name] + if self.name() != self.port_name: + search_paths.append(self.name()) + + if self.get_option('webkit_test_runner'): + # Because nearly all of the skipped tests for WebKit 2 are due to cross-platform + # issues, all wk2 ports share a skipped list under platform/wk2. + search_paths.extend([self._wk2_port_name(), "wk2"]) + + search_paths.extend(self.get_option("additional_platform_directory", [])) + + return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpectations') for d in search_paths] def repository_paths(self): """Returns a list of (repository_name, repository_path) tuples of its depending code base. @@ -1488,26 +1508,6 @@ class Port(object): # except for Qt because WebKit2 is only supported by Qt 5.0 (therefore: qt-5.0-wk2). return "%s-wk2" % self.port_name - def _skipped_file_search_paths(self): - # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] and any directories - # included via --additional-platform-directory, not the full casade. - # Note order doesn't matter since the Skipped file contents are all combined; however - # we use this order explicitly so we can re-use it for TestExpectations files. - # FIXME: Update this when we get rid of Skipped files altogether. - - search_paths = set([self.port_name]) - if 'future' not in self.name(): - search_paths.add(self.name()) - - if self.get_option('webkit_test_runner'): - # Because nearly all of the skipped tests for WebKit 2 are due to cross-platform - # issues, all wk2 ports share a skipped list under platform/wk2. - search_paths.update([self._wk2_port_name(), "wk2"]) - - search_paths.update(self.get_option("additional_platform_directory", [])) - - return search_paths - class VirtualTestSuite(object): def __init__(self, name, base, args, tests=None): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py index e9b2f060d..1fe75ccd4 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py @@ -379,6 +379,14 @@ class PortTest(unittest.TestCase): def test_operating_system(self): self.assertEqual('mac', self.make_port().operating_system()) + def test_http_server_supports_ipv6(self): + port = self.make_port() + self.assertTrue(port.http_server_supports_ipv6()) + port.host.platform.os_name = 'cygwin' + self.assertFalse(port.http_server_supports_ipv6()) + port.host.platform.os_name = 'win' + self.assertTrue(port.http_server_supports_ipv6()) + def test_check_httpd_success(self): port = self.make_port(executive=MockExecutive2()) port._path_to_apache = lambda: '/usr/sbin/httpd' @@ -451,6 +459,9 @@ class PortTest(unittest.TestCase): port = self.make_port(options=optparse.Values({'build_directory': '/my-build-directory/'})) self.assertEqual(port._build_path(), '/my-build-directory/Release') + def test_dont_require_http_server(self): + port = self.make_port() + self.assertEqual(port.requires_http_server(), False) if __name__ == '__main__': unittest.main() diff --git a/Tools/Scripts/webkitpy/layout_tests/port/builders.py b/Tools/Scripts/webkitpy/layout_tests/port/builders.py index c2ab8d212..155ac898b 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/builders.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/builders.py @@ -58,7 +58,8 @@ _exact_matches = { "WebKit Mac10.6 (dbg)": {"port_name": "chromium-mac-snowleopard", "specifiers": set(["snowleopard", "debug"])}, "WebKit Mac10.7": {"port_name": "chromium-mac-lion", "specifiers": set(["lion", "release"])}, "WebKit Mac10.7 (dbg)": {"port_name": "chromium-mac-lion", "specifiers": set(["lion", "debug"])}, - "WebKit Mac10.8": {"port_name": "chromium-mac-mountainlion", "specifiers": set(["mountainlion", "release"])}, + "WebKit Mac10.8": {"port_name": "chromium-mac-mountainlion", "specifiers": set(["mountainlion", "release"]), + "move_overwritten_baselines_to": ["chromium-mac-lion"]}, # These builders are on build.webkit.org. "Apple MountainLion Release WK1 (Tests)": {"port_name": "mac-mountainlion", "specifiers": set(["mountainlion"]), "rebaseline_override_dir": "mac"}, diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py index 6389feb63..b8ac55ac1 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py @@ -180,7 +180,9 @@ class ChromiumAndroidPort(chromium.ChromiumPort): def additional_drt_flag(self): # The Chromium port for Android always uses the hardware GPU path. - return ['--encode-binary', '--enable-hardware-gpu'] + return ['--encode-binary', '--enable-hardware-gpu', + '--force-compositing-mode', + '--enable-accelerated-fixed-position'] def default_timeout_ms(self): # Android platform has less computing power than desktop platforms. @@ -232,20 +234,16 @@ class ChromiumAndroidPort(chromium.ChromiumPort): android_expectations_file = self.path_from_webkit_base('LayoutTests', 'platform', 'chromium-android', 'TestExpectations') return super(ChromiumAndroidPort, self).expectations_files() + [android_expectations_file] - def start_http_server(self, additional_dirs=None, number_of_servers=0): - # The http server runs during the whole testing period, so ignore this call. - pass - - def stop_http_server(self): - # Same as start_http_server(). - pass - - def setup_test_run(self): - # Start the HTTP server so that the device can access the test cases. - super(ChromiumAndroidPort, self).start_http_server(additional_dirs={TEST_PATH_PREFIX: self.layout_tests_dir()}) + def requires_http_server(self): + """Chromium Android runs tests on devices, and uses the HTTP server to + serve the actual layout tests to DumpRenderTree.""" + return True - def clean_up_test_run(self): - super(ChromiumAndroidPort, self).stop_http_server() + def start_http_server(self, additional_dirs=None, number_of_servers=0): + if not additional_dirs: + additional_dirs = {} + additional_dirs[TEST_PATH_PREFIX] = self.layout_tests_dir() + super(ChromiumAndroidPort, self).start_http_server(additional_dirs, number_of_servers) def create_driver(self, worker_number, no_timeout=False): # We don't want the default DriverProxy which is not compatible with our driver. diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py index bb4229e65..fce69c67d 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py @@ -165,6 +165,10 @@ class ChromiumAndroidPortTest(chromium_port_testcase.ChromiumPortTestCase): self.assertEquals(self.mock_run_command._mock_devices[1], port._get_device_serial(1)) self.assertRaises(AssertionError, port._get_device_serial, 2) + def test_must_require_http_server(self): + port = self.make_port() + self.assertEquals(port.requires_http_server(), True) + class ChromiumAndroidDriverTest(unittest.TestCase): def setUp(self): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl.py b/Tools/Scripts/webkitpy/layout_tests/port/efl.py index 1022cd7b7..0c9acd8d8 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/efl.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/efl.py @@ -62,8 +62,6 @@ class EflPort(Port, PulseAudioSanitizer): if self.webprocess_cmd_prefix: env['WEB_PROCESS_CMD_PREFIX'] = self.webprocess_cmd_prefix - env['XDG_CACHE_HOME'] = str(self._filesystem.mkdtemp(prefix='%s-Efl-CacheDir-' % self.driver_name())) - env['XDG_DATA_HOME'] = str(self._filesystem.mkdtemp(prefix='%s-Efl-DataDir-' % self.driver_name())) return env def default_timeout_ms(self): @@ -107,6 +105,9 @@ class EflPort(Port, PulseAudioSanitizer): search_paths.append(self.port_name) return search_paths + def default_baseline_search_path(self): + return map(self._webkit_baseline_path, self._search_paths()) + def expectations_files(self): # FIXME: We should be able to use the default algorithm here. return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self._search_paths()])) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py index 7e4750219..ad7c64454 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py @@ -29,35 +29,47 @@ """Factory method to retrieve the appropriate port implementation.""" +import fnmatch import optparse import re from webkitpy.layout_tests.port import builders -def port_options(**help_strings): +def platform_options(use_globs=False): return [ - optparse.make_option("-t", "--target", dest="configuration", - help="(DEPRECATED)"), + optparse.make_option('--platform', action='store', + help=('Glob-style list of platform/ports to use (e.g., "mac*")' if use_globs else 'Platform to use (e.g., "mac-lion")')), + optparse.make_option('--chromium', action='store_const', dest='platform', + const=('chromium*' if use_globs else 'chromium'), + help=('Alias for --platform=chromium*' if use_globs else 'Alias for --platform=chromium')), + optparse.make_option('--chromium-android', action='store_const', dest='platform', + const=('chromium-android*' if use_globs else 'chromium-android'), + help=('Alias for --platform=chromium-android*' if use_globs else 'Alias for --platform=chromium')), + optparse.make_option('--efl', action='store_const', dest='platform', + const=('efl*' if use_globs else 'efl'), + help=('Alias for --platform=efl*' if use_globs else 'Alias for --platform=efl')), + optparse.make_option('--gtk', action='store_const', dest='platform', + const=('gtk*' if use_globs else 'gtk'), + help=('Alias for --platform=gtk*' if use_globs else 'Alias for --platform=gtk')), + optparse.make_option('--qt', action='store_const', dest="platform", + const=('qt*' if use_globs else 'qt'), + help=('Alias for --platform=qt' if use_globs else 'Alias for --platform=qt')), + ] + + +def configuration_options(): + return [ + optparse.make_option("-t", "--target", dest="configuration", help="(DEPRECATED)"), # FIXME: --help should display which configuration is default. optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'), optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'), - optparse.make_option('--platform', action='store', - help=help_strings.get('platform', 'Platform/Port being tested (e.g., "mac-lion")')), - optparse.make_option('--chromium', action='store_const', const='chromium', dest='platform', - help='Alias for --platform=chromium'), - optparse.make_option('--chromium-android', action='store_const', const='chromium-android', dest='platform', - help='Alias for --platform=chromium-android'), - optparse.make_option('--efl', action='store_const', const='efl', dest="platform", - help='Alias for --platform=efl'), - optparse.make_option('--gtk', action='store_const', const='gtk', dest="platform", - help='Alias for --platform=gtk'), - optparse.make_option('--qt', action='store_const', const='qt', dest="platform", - help='Alias for --platform=qt'), optparse.make_option('--32-bit', action='store_const', const='x86', default=None, dest="architecture", - help='use 32-bit binaries by default (x86 instead of x86_64)')] + help='use 32-bit binaries by default (x86 instead of x86_64)'), + ] + def _builder_options(builder_name): @@ -116,18 +128,18 @@ class PortFactory(object): return cls(self._host, port_name, options=options, **kwargs) raise NotImplementedError('unsupported platform: "%s"' % port_name) - def all_port_names(self): + def all_port_names(self, platform=None): """Return a list of all valid, fully-specified, "real" port names. This is the list of directories that are used as actual baseline_paths() by real ports. This does not include any "fake" names like "test" - or "mock-mac", and it does not include any directories that are not .""" - # FIXME: There's probably a better way to generate this list ... - return builders.all_port_names() + or "mock-mac", and it does not include any directories that are not. + + If platform is not specified, we will glob-match all ports""" + platform = platform or '*' + return fnmatch.filter(builders.all_port_names(), platform) def get_from_builder_name(self, builder_name): port_name = builders.port_name_for_builder_name(builder_name) - assert(port_name) # Need to update port_name_for_builder_name - port = self.get(port_name, _builder_options(builder_name)) - assert(port) # Need to update port_name_for_builder_name - return port + assert port_name, "unrecognized builder name '%s'" % builder_name + return self.get(port_name, _builder_options(builder_name)) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py index 6c57b5363..3d820274e 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py @@ -38,9 +38,6 @@ from webkitpy.layout_tests.port.xvfbdriver import XvfbDriver class GtkPort(Port, PulseAudioSanitizer): port_name = "gtk" - def expectations_files(self): - return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpectations') for d in self._skipped_file_search_paths()] - def warn_if_bug_missing_in_test_expectations(self): return True diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py index d0289ade5..c2b26b2f7 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py @@ -49,23 +49,6 @@ class MacTest(port_testcase.PortTestCase): super(MacTest, self).test_default_timeout_ms() self.assertEquals(self.make_port(options=MockOptions(guard_malloc=True)).default_timeout_ms(), 350000) - def test_expectations_files(self): - self.assertEquals(len(self.make_port().expectations_files()), 2) - self.assertEquals(len(self.make_port(options=MockOptions(webkit_test_runner=True)).expectations_files()), 4) - - def test_skipped_file_search_paths(self): - # We should have two skipped files - platform+version and platform; however, we don't - # have platform+version for either the most recent version or mac-future. - self.assert_skipped_file_search_paths('mac-snowleopard', set(['mac-snowleopard', 'mac'])) - self.assert_skipped_file_search_paths('mac-lion', set(['mac-lion', 'mac'])) - self.assert_skipped_file_search_paths('mac-mountainlion', set(['mac'])) - self.assert_skipped_file_search_paths('mac-future', set(['mac'])) - - self.assert_skipped_file_search_paths('mac-snowleopard', set(['mac-snowleopard', 'mac', 'mac-wk2', 'wk2']), use_webkit2=True) - self.assert_skipped_file_search_paths('mac-lion', set(['mac', 'mac-lion', 'mac-wk2', 'wk2']), use_webkit2=True) - self.assert_skipped_file_search_paths('mac-future', set(['mac', 'mac-wk2', 'wk2']), use_webkit2=True) - - example_skipped_file = u""" # <rdar://problem/5647952> fast/events/mouseout-on-window.html needs mac DRT to issue mouse out events diff --git a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py index f704a7a13..b036f4b0d 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py @@ -502,15 +502,22 @@ class PortTestCase(unittest.TestCase): def test_skipped_layout_tests(self): self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(test_list=[]), set(['media'])) - def test_skipped_file_search_paths(self): + def test_expectations_files(self): port = TestWebKitPort() - self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport'])) + + def platform_dirs(port): + return [port.host.filesystem.basename(port.host.filesystem.dirname(f)) for f in port.expectations_files()] + + self.assertEqual(platform_dirs(port), ['testwebkitport']) + port._name = "testwebkitport-version" - self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version'])) + self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version']) + port._options = MockOptions(webkit_test_runner=True) - self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version', 'testwebkitport-wk2', 'wk2'])) + self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version', 'testwebkitport-wk2', 'wk2']) + port._options = MockOptions(additional_platform_directory=["internal-testwebkitport"]) - self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version', 'internal-testwebkitport'])) + self.assertEqual(platform_dirs(port), ['testwebkitport', 'testwebkitport-version', 'internal-testwebkitport']) def test_root_option(self): port = TestWebKitPort() diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt.py b/Tools/Scripts/webkitpy/layout_tests/port/qt.py index 76aadef2a..55f13ee8c 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/qt.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/qt.py @@ -62,7 +62,7 @@ class QtPort(Port): def __init__(self, host, port_name, **kwargs): super(QtPort, self).__init__(host, port_name, **kwargs) - # FIXME: This will allow Port.baseline_search_path and Port._skipped_file_search_paths + # FIXME: This will allow Port.baseline_search_path # to do the right thing, but doesn't include support for qt-4.8 or qt-arm (seen in LayoutTests/platform) yet. self._operating_system = port_name.replace('qt-', '') @@ -115,8 +115,6 @@ class QtPort(Port): return version def _search_paths(self): - # Qt port uses same paths for baseline_search_path and _skipped_file_search_paths - # # qt-5.0-wk1 qt-5.0-wk2 # \/ # qt-5.0 qt-4.8 diff --git a/Tools/Scripts/webkitpy/layout_tests/port/server_process.py b/Tools/Scripts/webkitpy/layout_tests/port/server_process.py index bfdf8301b..8f0cda9ba 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/server_process.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/server_process.py @@ -226,6 +226,11 @@ class ServerProcess(object): return output def _wait_for_data_and_update_buffers_using_select(self, deadline, stopping=False): + if self._proc.stdout.closed or self._proc.stderr.closed: + # If the process crashed and is using FIFOs, like Chromium Android, the + # stdout and stderr pipes will be closed. + return + out_fd = self._proc.stdout.fileno() err_fd = self._proc.stderr.fileno() select_fds = (out_fd, err_fd) @@ -331,22 +336,21 @@ class ServerProcess(object): self._port.check_for_leaks(self.name(), self.pid()) now = time.time() - self._proc.stdin.close() - self._proc.stdin = None + if self._proc.stdin: + self._proc.stdin.close() + self._proc.stdin = None killed = False - if not timeout_secs: - self._kill() - killed = True - elif not self._host.platform.is_win(): - # FIXME: Why aren't we calling this on win? + if timeout_secs: deadline = now + timeout_secs while self._proc.poll() is None and time.time() < deadline: time.sleep(0.01) if self._proc.poll() is None: - _log.warning('stopping %s timed out, killing it' % self._name) - self._kill() - killed = True - _log.warning('killed') + _log.warning('stopping %s(pid %d) timed out, killing it' % (self._name, self._proc.pid)) + + if self._proc.poll() is None: + self._kill() + killed = True + _log.debug('killed pid %d' % self._proc.pid) # read any remaining data on the pipes and return it. if not killed: diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py index 726575614..f7dd2919e 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/test.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py @@ -64,7 +64,6 @@ class TestInstance(object): self.actual_image = self.base + '\x8a' + '-png' + 'tEXtchecksum\x00' + self.actual_checksum self.expected_text = self.actual_text - self.expected_checksum = self.actual_checksum self.expected_image = self.actual_image self.actual_audio = None @@ -117,16 +116,15 @@ def unit_test_list(): actual_audio=base64.b64encode('audio_fail-wav'), expected_audio='audio-wav', actual_text=None, expected_text=None, actual_image=None, expected_image=None, - actual_checksum=None, expected_checksum=None) + actual_checksum=None) tests.add('failures/expected/keyboard.html', keyboard=True) tests.add('failures/expected/missing_check.html', - expected_checksum=None, - expected_image=None) + expected_image='missing_check-png') tests.add('failures/expected/missing_image.html', expected_image=None) tests.add('failures/expected/missing_audio.html', expected_audio=None, actual_text=None, expected_text=None, actual_image=None, expected_image=None, - actual_checksum=None, expected_checksum=None) + actual_checksum=None) tests.add('failures/expected/missing_text.html', expected_text=None) tests.add('failures/expected/newlines_leading.html', expected_text="\nfoo\n", actual_text="foo\n") @@ -138,6 +136,7 @@ def unit_test_list(): tests.add('failures/expected/skip_text.html', actual_text='text diff') tests.add('failures/flaky/text.html') tests.add('failures/unexpected/missing_text.html', expected_text=None) + tests.add('failures/unexpected/missing_check.html', expected_image='missing-check-png') tests.add('failures/unexpected/missing_image.html', expected_image=None) tests.add('failures/unexpected/missing_render_tree_dump.html', actual_text="""layer at (0,0) size 800x600 RenderView at (0,0) size 800x600 @@ -152,12 +151,18 @@ layer at (0,0) size 800x34 error="mock-std-error-output") tests.add('failures/unexpected/web-process-crash-with-stderr.html', web_process_crash=True, error="mock-std-error-output") + tests.add('failures/unexpected/pass.html') + tests.add('failures/unexpected/text-checksum.html', + actual_text='text-checksum_fail-txt', + actual_checksum='text-checksum_fail-checksum') tests.add('failures/unexpected/text-image-checksum.html', actual_text='text-image-checksum_fail-txt', + actual_image='text-image-checksum_fail-pngtEXtchecksum\x00checksum_fail', actual_checksum='text-image-checksum_fail-checksum') tests.add('failures/unexpected/checksum-with-matching-image.html', actual_checksum='text-image-checksum_fail-checksum') tests.add('failures/unexpected/skip_pass.html') + tests.add('failures/unexpected/text.html', actual_text='text_fail-txt') tests.add('failures/unexpected/timeout.html', timeout=True) tests.add('http/tests/passes/text.html') tests.add('http/tests/passes/image.html') @@ -169,10 +174,9 @@ layer at (0,0) size 800x34 actual_audio=base64.b64encode('audio-wav'), expected_audio='audio-wav', actual_text=None, expected_text=None, actual_image=None, expected_image=None, - actual_checksum=None, expected_checksum=None) + actual_checksum=None) tests.add('passes/platform_image.html') tests.add('passes/checksum_in_image.html', - expected_checksum=None, expected_image='tEXtchecksum\x00checksum_in_image-checksum') tests.add('passes/skipped/skip.html') @@ -281,6 +285,7 @@ Bug(test) failures/expected/timeout.html [ Timeout ] Bug(test) failures/expected/hang.html [ WontFix ] Bug(test) failures/expected/keyboard.html [ WontFix ] Bug(test) failures/expected/exception.html [ WontFix ] +Bug(test) failures/unexpected/pass.html [ Failure ] Bug(test) passes/skipped/skip.html [ Skip ] """) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py b/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py index b927720db..b98c0392e 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py @@ -77,12 +77,16 @@ class XvfbDriver(Driver): environment = self._port.setup_environ_for_server(server_name) # We must do this here because the DISPLAY number depends on _worker_number environment['DISPLAY'] = ":%d" % display_id - # Drivers should use separate application cache locations - environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(self._port.results_directory(), '%s-appcache-%d' % (server_name, self._worker_number)) self._driver_tempdir = self._port._filesystem.mkdtemp(prefix='%s-' % self._port.driver_name()) environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir) environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir() + # Currently on WebKit2, there is no API for setting the application + # cache directory. Each worker should have it's own and it should be + # cleaned afterwards, so we set it to inside the temporary folder by + # prepending XDG_CACHE_HOME with DUMPRENDERTREE_TEMP. + environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache') + self._crashed_process_name = None self._crashed_pid = None self._server_process = self._port._server_process_constructor(self._port, server_name, self.cmd_line(pixel_tests, per_test_args), environment) diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index 89522079c..1c8e7321a 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -41,7 +41,7 @@ from webkitpy.common.host import Host from webkitpy.common.system import stack_utils from webkitpy.layout_tests.controllers.manager import Manager, WorkerException, TestRunInterruptedException from webkitpy.layout_tests.models import test_expectations -from webkitpy.layout_tests.port import port_options +from webkitpy.layout_tests.port import configuration_options, platform_options from webkitpy.layout_tests.views import printing @@ -67,19 +67,20 @@ def lint(port, options): lint_failed = False for port_to_lint in ports_to_lint: - expectations_file = port_to_lint.path_to_test_expectations_file() - if expectations_file in files_linted: - continue - - try: - test_expectations.TestExpectations(port_to_lint, is_lint_mode=True) - except test_expectations.ParseError, e: - lint_failed = True - _log.error('') - for warning in e.warnings: - _log.error(warning) - _log.error('') - files_linted.add(expectations_file) + expectations_dict = port_to_lint.expectations_dict() + for expectations_file in expectations_dict.keys(): + if expectations_file in files_linted: + continue + + try: + test_expectations.TestExpectations(port_to_lint, expectations_to_lint={expectations_file: expectations_dict[expectations_file]}) + except test_expectations.ParseError, e: + lint_failed = True + _log.error('') + for warning in e.warnings: + _log.error(warning) + _log.error('') + files_linted.add(expectations_file) if lint_failed: _log.error('Lint failed.') @@ -200,7 +201,8 @@ def parse_args(args=None): option_group_definitions = [] - option_group_definitions.append(("Configuration options", port_options())) + option_group_definitions.append(("Platform options", platform_options())) + option_group_definitions.append(("Configuration options", configuration_options())) option_group_definitions.append(("Printing Options", printing.print_options())) # FIXME: These options should move onto the ChromiumPort. 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 85437449b..0cf42d0ee 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py @@ -176,7 +176,8 @@ 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 = 14 +unexpected_failures = 12 +unexpected_tests_count = unexpected_failures + 4 class StreamTestingMixin(object): @@ -199,9 +200,6 @@ class LintTest(unittest.TestCase, StreamTestingMixin): self.name = name self.path = path - def path_to_test_expectations_file(self): - return self.path - def test_configuration(self): return None @@ -244,7 +242,7 @@ class LintTest(unittest.TestCase, StreamTestingMixin): FakePort(host, 'b-win', 'path-to-b'))) self.assertEquals(run_webkit_tests.lint(host.port_factory.ports['a'], MockOptions(platform=None)), 0) - self.assertEquals(host.ports_parsed, ['a', 'b']) + self.assertEquals(host.ports_parsed, ['a', 'b', 'b-win']) host.ports_parsed = [] self.assertEquals(run_webkit_tests.lint(host.port_factory.ports['a'], MockOptions(platform='a')), 0) @@ -267,6 +265,15 @@ class LintTest(unittest.TestCase, StreamTestingMixin): self.assertEmpty(out) self.assertTrue(any(['Lint failed' in msg for msg in err.buflist])) + # ensure we lint *all* of the files in the cascade. + port_obj.expectations_dict = lambda: {'foo': '-- syntax error1', 'bar': '-- syntax error2'} + res, out, err = run_and_capture(port_obj, options, parsed_args) + + self.assertEqual(res, -1) + self.assertEmpty(out) + self.assertTrue(any(['foo:1' in msg for msg in err.buflist])) + self.assertTrue(any(['bar:1' in msg for msg in err.buflist])) + class MainTest(unittest.TestCase, StreamTestingMixin): def setUp(self): @@ -496,7 +503,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin): def test_run_singly_actually_runs_tests(self): res, _, _, _ = logging_run(['--run-singly', 'failures/unexpected']) - self.assertEquals(res, 10) + self.assertEquals(res, unexpected_failures) def test_single_file(self): # FIXME: We should consider replacing more of the get_tests_run()-style tests @@ -561,7 +568,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin): file_list = host.filesystem.written_files.keys() file_list.remove('/tmp/layout-test-results/tests_run0.txt') self.assertEquals(res, 1) - expected_token = '"unexpected":{"text-image-checksum.html":{"expected":"PASS","actual":"TEXT"},"missing_text.html":{"expected":"PASS","is_missing_text":true,"actual":"MISSING"}' + expected_token = '"unexpected":{"text-image-checksum.html":{"expected":"PASS","actual":"IMAGE+TEXT","image_diff_percent":1},"missing_text.html":{"expected":"PASS","is_missing_text":true,"actual":"MISSING"}' json_string = host.filesystem.read_text_file('/tmp/layout-test-results/full_results.json') self.assertTrue(json_string.find(expected_token) != -1) self.assertTrue(json_string.find('"num_regressions":1') != -1) diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py b/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py index a616fab5b..7dede92a6 100644 --- a/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py +++ b/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py @@ -33,6 +33,7 @@ import logging import os import re +import socket import sys from webkitpy.layout_tests.servers import http_server_base @@ -42,7 +43,6 @@ _log = logging.getLogger(__name__) class LayoutTestApacheHttpd(http_server_base.HttpServerBase): - def __init__(self, port_obj, output_dir, additional_dirs=None, number_of_servers=None): """Args: port_obj: handle to the platform-specific routines @@ -77,7 +77,6 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase): '-C', "\'DocumentRoot \"%s\"\'" % document_root, '-c', "\'Alias /js-test-resources \"%s\"'" % js_test_resources_dir, '-c', "\'Alias /media-resources \"%s\"'" % media_resources_dir, - '-C', "\'Listen %s\'" % "127.0.0.1:8000", '-c', "\'TypesConfig \"%s\"\'" % mime_types_path, '-c', "\'CustomLog \"%s\" common\'" % access_log, '-c', "\'ErrorLog \"%s\"\'" % error_log, @@ -85,6 +84,30 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase): '-c', "\'PidFile %s'" % self._pid_file, '-k', "start"] + enable_ipv6 = self._port_obj.http_server_supports_ipv6() + # Perform part of the checks Apache's APR does when trying to listen to + # a specific host/port. This allows us to avoid trying to listen to + # IPV6 addresses when it fails on Apache. APR itself tries to call + # getaddrinfo() again without AI_ADDRCONFIG if the first call fails + # with EBADFLAGS, but that is not how it normally fails in our use + # cases, so ignore that for now. + # See https://bugs.webkit.org/show_bug.cgi?id=98602#c7 + try: + socket.getaddrinfo('::1', 0, 0, 0, 0, socket.AI_ADDRCONFIG) + except: + enable_ipv6 = False + + for mapping in self._mappings: + port = mapping['port'] + + start_cmd += ['-C', "\'Listen 127.0.0.1:%d\'" % port] + + # We listen to both IPv4 and IPv6 loop-back addresses, but ignore + # requests to 8000 from random users on network. + # See https://bugs.webkit.org/show_bug.cgi?id=37104 + if enable_ipv6: + start_cmd += ['-C', "\'Listen [::1]:%d\'" % port] + if additional_dirs: for alias, path in additional_dirs.iteritems(): start_cmd += ['-c', "\'Alias %s \"%s\"\'" % (alias, path), @@ -98,7 +121,6 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase): '-c', "\'MinSpareServers %d\'" % self._number_of_servers, '-c', "\'MaxSpareServers %d\'" % self._number_of_servers] - stop_cmd = [executable, '-f', "\"%s\"" % self._get_apache_config_file_path(test_dir, output_dir), '-c', "\'PidFile %s'" % self._pid_file, diff --git a/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py b/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py index 7a36391fa..acea93ea4 100644 --- a/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py +++ b/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py @@ -32,9 +32,6 @@ import os import sys import time -from webkitpy.common.memoized import memoized - - LOG_HANDLER_NAME = 'MeteredStreamLogHandler' @@ -55,7 +52,7 @@ class MeteredStream(object): def _ensure_newline(txt): return txt if txt.endswith('\n') else txt + '\n' - def __init__(self, stream=None, verbose=False, logger=None, time_fn=None, pid=None): + def __init__(self, stream=None, verbose=False, logger=None, time_fn=None, pid=None, number_of_columns=None): self._stream = stream or sys.stderr self._verbose = verbose self._time_fn = time_fn or time.time @@ -65,6 +62,9 @@ class MeteredStream(object): self._last_partial_line = '' self._last_write_time = 0.0 self._throttle_delay_in_secs = 0.066 if self._erasing else 10.0 + self._number_of_columns = sys.maxint + if self._isatty and number_of_columns: + self._number_of_columns = number_of_columns self._logger = logger self._log_handler = None @@ -122,19 +122,8 @@ class MeteredStream(object): self._last_partial_line = '' self._stream.flush() - @memoized def number_of_columns(self): - if not self._isatty: - return sys.maxint - try: - import fcntl - import struct - import termios - packed = fcntl.ioctl(self._stream.fileno(), termios.TIOCGWINSZ, '\0' * 8) - _, columns, _, _ = struct.unpack('HHHH', packed) - return columns - except: - return sys.maxint + return self._number_of_columns class _LogHandler(logging.Handler): diff --git a/Tools/Scripts/webkitpy/layout_tests/views/printing.py b/Tools/Scripts/webkitpy/layout_tests/views/printing.py index 44500ecc7..b7a9195a8 100644 --- a/Tools/Scripts/webkitpy/layout_tests/views/printing.py +++ b/Tools/Scripts/webkitpy/layout_tests/views/printing.py @@ -73,7 +73,8 @@ class Printer(object): self._port = port self._options = options self._buildbot_stream = buildbot_output - self._meter = MeteredStream(regular_output, options.debug_rwt_logging, logger=logger) + self._meter = MeteredStream(regular_output, options.debug_rwt_logging, logger=logger, + number_of_columns=self._port.host.platform.terminal_width()) self._running_tests = [] self._completed_tests = [] @@ -298,7 +299,7 @@ class Printer(object): desc = TestExpectations.EXPECTATION_DESCRIPTIONS[result] if not_passing and len(results): pct = len(results) * 100.0 / not_passing - self._print_for_bot(" %5d %-24s (%4.1f%%)" % (len(results), desc[0], pct)) + self._print_for_bot(" %5d %-24s (%4.1f%%)" % (len(results), desc, pct)) def _print_one_line_summary(self, total, expected, unexpected): incomplete = total - expected - unexpected @@ -356,29 +357,34 @@ class Printer(object): def print_finished_test(self, result, expected, exp_str, got_str): self.num_completed += 1 test_name = result.test_name + + result_message = self._result_message(result.type, result.failures, expected, self._options.verbose) + if self._options.details: self._print_test_trace(result, exp_str, got_str) elif (self._options.verbose and not self._options.debug_rwt_logging) or not expected: - desc = TestExpectations.EXPECTATION_DESCRIPTIONS[result.type] - suffix = ' ' + desc[1] - if not expected: - suffix += ' unexpectedly' + desc[2] - self.writeln(self._test_status_line(test_name, suffix)) + self.writeln(self._test_status_line(test_name, result_message)) elif self.num_completed == self.num_tests: self._meter.write_update('') else: - desc = TestExpectations.EXPECTATION_DESCRIPTIONS[result.type] - suffix = ' ' + desc[1] if test_name == self._running_tests[0]: - self._completed_tests.insert(0, [test_name, suffix]) + self._completed_tests.insert(0, [test_name, result_message]) else: - self._completed_tests.append([test_name, suffix]) + self._completed_tests.append([test_name, result_message]) - for test_name, suffix in self._completed_tests: - self._meter.write_throttled_update(self._test_status_line(test_name, suffix)) + for test_name, result_message in self._completed_tests: + self._meter.write_throttled_update(self._test_status_line(test_name, result_message)) self._completed_tests = [] self._running_tests.remove(test_name) + def _result_message(self, result_type, failures, expected, verbose): + exp_string = ' unexpectedly' if not expected else '' + if result_type == test_expectations.PASS: + return ' passed%s' % exp_string + else: + return ' failed%s (%s)' % (exp_string, ', '.join(failure.message() for failure in failures)) + + def _print_test_trace(self, result, exp_str, got_str): test_name = result.test_name self._print_default(self._test_status_line(test_name, '')) @@ -447,7 +453,7 @@ class Printer(object): descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS for key, tests in flaky.iteritems(): result = TestExpectations.EXPECTATIONS[key.lower()] - self._print_for_bot("Unexpected flakiness: %s (%d)" % (descriptions[result][0], len(tests))) + self._print_for_bot("Unexpected flakiness: %s (%d)" % (descriptions[result], len(tests))) tests.sort() for test in tests: @@ -465,10 +471,10 @@ class Printer(object): descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS for key, tests in regressions.iteritems(): result = TestExpectations.EXPECTATIONS[key.lower()] - self._print_for_bot("Regressions: Unexpected %s : (%d)" % (descriptions[result][0], len(tests))) + self._print_for_bot("Regressions: Unexpected %s (%d)" % (descriptions[result], len(tests))) tests.sort() for test in tests: - self._print_for_bot(" %s [ %s ] " % (test, TestExpectationParser._inverted_expectation_tokens[key])) + self._print_for_bot(" %s [ %s ]" % (test, TestExpectationParser._inverted_expectation_tokens[key])) self._print_for_bot("") if len(unexpected_results['tests']) and self._options.debug_rwt_logging: diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest.py b/Tools/Scripts/webkitpy/performance_tests/perftest.py index 32b9d8bc6..9e2f87d47 100644 --- a/Tools/Scripts/webkitpy/performance_tests/perftest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftest.py @@ -381,7 +381,6 @@ class PerfTestFactory(object): _pattern_map = [ (re.compile(r'^inspector/'), ChromiumStylePerfTest), - (re.compile(r'^PageLoad/'), PageLoadingPerfTest), (re.compile(r'(.+)\.replay$'), ReplayPerfTest), ] diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py index 4410903e9..259fc7854 100755 --- a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py @@ -362,10 +362,6 @@ class TestPerfTestFactory(unittest.TestCase): test = PerfTestFactory.create_perf_test(MockPort(), 'inspector/some-test', '/path/inspector/some-test') self.assertEqual(test.__class__, ChromiumStylePerfTest) - def test_page_loading_test(self): - test = PerfTestFactory.create_perf_test(MockPort(), 'PageLoad/some-test', '/path/PageLoad/some-test') - self.assertEqual(test.__class__, PageLoadingPerfTest) - if __name__ == '__main__': unittest.main() diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py index 6119c61d3..9c9295f63 100755 --- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py @@ -598,13 +598,6 @@ max 548000 bytes port.skipped_perf_tests = lambda: ['inspector/unsupported_test1.html', 'unsupported'] self.assertEqual(self._collect_tests_and_sort_test_name(runner), ['inspector/test1.html', 'inspector/test2.html', 'inspector/unsupported_test1.html', 'unsupported/unsupported_test2.html']) - def test_collect_tests_with_page_load_svg(self): - runner, port = self.create_runner() - self._add_file(runner, 'PageLoad', 'some-svg-test.svg') - tests = runner._collect_tests() - self.assertEqual(len(tests), 1) - self.assertEqual(tests[0].__class__.__name__, 'PageLoadingPerfTest') - def test_collect_tests_should_ignore_replay_tests_by_default(self): runner, port = self.create_runner() self._add_file(runner, 'Replay', 'www.webkit.org.replay') diff --git a/Tools/Scripts/webkitpy/pylintrc b/Tools/Scripts/webkitpy/pylintrc index bdd040415..caadcfbe6 100644 --- a/Tools/Scripts/webkitpy/pylintrc +++ b/Tools/Scripts/webkitpy/pylintrc @@ -64,6 +64,7 @@ load-plugins= # CHANGED: # C0103: Invalid name "" # C0111: Missing docstring +# C0301: Line too long # C0302: Too many lines in module (N) # I0010: Unable to consider inline option '' # I0011: Locally disabling WNNNN @@ -93,7 +94,7 @@ load-plugins= # W0614: Unused import X from wildcard import # W0703: Catch "Exception" # W1201: Specify string format arguments as logging function parameters -disable=C0103,C0111,C0302,I0010,I0011,R0201,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0212,W0401,W0402,W0404,W0511,W0603,W0614,W0703,W1201 +disable=C0103,C0111,C0301,C0302,I0010,I0011,R0201,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,W0122,W0141,W0142,W0212,W0401,W0402,W0404,W0511,W0603,W0614,W0703,W1201 [REPORTS] diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py index ebbd1ad2f..a1447e2fb 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py @@ -1594,7 +1594,7 @@ def check_function_definition_and_pass_ptr(type_text, row, location_description, """ match_ref_or_own_ptr = '(?=\W|^)(Ref|Own)Ptr(?=\W)' bad_type_usage = search(match_ref_or_own_ptr, type_text) - if not bad_type_usage or type_text.endswith('&'): + if not bad_type_usage or type_text.endswith('&') or type_text.endswith('*'): return type_name = bad_type_usage.group(0) error(row, 'readability/pass_ptr', 5, diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py index 6f001e0cb..552220101 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py @@ -3421,6 +3421,11 @@ class PassPtrTest(CppStyleTestBase): '{\n' '}', '') + self.assert_pass_ptr_check( + 'int myFunction(RefPtr<Type1>*)\n' + '{\n' + '}', + '') def test_own_ptr_parameter_value(self): self.assert_pass_ptr_check( diff --git a/Tools/Scripts/webkitpy/style/checkers/test_expectations.py b/Tools/Scripts/webkitpy/style/checkers/test_expectations.py index 1ce40cd39..51b97bec5 100644 --- a/Tools/Scripts/webkitpy/style/checkers/test_expectations.py +++ b/Tools/Scripts/webkitpy/style/checkers/test_expectations.py @@ -79,7 +79,7 @@ class TestExpectationsChecker(object): pass def check_test_expectations(self, expectations_str, tests=None): - parser = TestExpectationParser(self._port_obj, tests, False) + parser = TestExpectationParser(self._port_obj, tests, allow_rebaseline_modifier=False) expectations = parser.parse('expectations', expectations_str) level = 5 diff --git a/Tools/Scripts/webkitpy/test/main.py b/Tools/Scripts/webkitpy/test/main.py index 852413299..e639a4578 100644 --- a/Tools/Scripts/webkitpy/test/main.py +++ b/Tools/Scripts/webkitpy/test/main.py @@ -178,17 +178,19 @@ class Tester(object): return True def _test_names(self, loader, names): + parallel_test_method_prefixes = ['test_'] + serial_test_method_prefixes = ['serial_test_'] if self._options.integration_tests: - loader.test_method_prefixes.append('integration_test_') + parallel_test_method_prefixes.append('integration_test_') + serial_test_method_prefixes.append('serial_integration_test_') parallel_tests = [] - if self._options.child_processes > 1: - for name in names: - parallel_tests.extend(self._all_test_names(loader.loadTestsFromName(name, None))) - loader.test_method_prefixes = [] + loader.test_method_prefixes = parallel_test_method_prefixes + for name in names: + parallel_tests.extend(self._all_test_names(loader.loadTestsFromName(name, None))) serial_tests = [] - loader.test_method_prefixes = ['serial_test_', 'serial_integration_test_'] + loader.test_method_prefixes = serial_test_method_prefixes for name in names: serial_tests.extend(self._all_test_names(loader.loadTestsFromName(name, None))) @@ -216,7 +218,7 @@ class Tester(object): class _Loader(unittest.TestLoader): - test_method_prefixes = ['test_'] + test_method_prefixes = [] def getTestCaseNames(self, testCaseClass): def isTestMethod(attrname, testCaseClass=testCaseClass): diff --git a/Tools/Scripts/webkitpy/test/main_unittest.py b/Tools/Scripts/webkitpy/test/main_unittest.py index 2020f5b60..4fa6ef384 100644 --- a/Tools/Scripts/webkitpy/test/main_unittest.py +++ b/Tools/Scripts/webkitpy/test/main_unittest.py @@ -21,13 +21,33 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import logging +import sys import unittest import StringIO +from webkitpy.common.system.filesystem import FileSystem +from webkitpy.common.system.executive import Executive from webkitpy.common.system.outputcapture import OutputCapture from webkitpy.test.main import Tester, _Loader +STUBS_CLASS = __name__ + ".TestStubs" + + +class TestStubs(unittest.TestCase): + def test_empty(self): + pass + + def integration_test_empty(self): + pass + + def serial_test_empty(self): + pass + + def serial_integration_test_empty(self): + pass + + class TesterTest(unittest.TestCase): def test_no_tests_found(self): @@ -53,9 +73,45 @@ class TesterTest(unittest.TestCase): self.assertTrue('No tests to run' in errors.getvalue()) self.assertTrue('No tests to run' in logs) - def test_individual_names_are_not_run_twice(self): + def _find_test_names(self, args): tester = Tester() - tester._options, args = tester._parse_args(["webkitpy.test.main_unittest.TesterTest.test_no_tests_found"]) - parallel_tests, serial_tests = tester._test_names(_Loader(), args) + tester._options, args = tester._parse_args(args) + return tester._test_names(_Loader(), args) + + def test_individual_names_are_not_run_twice(self): + args = [STUBS_CLASS + '.test_empty'] + parallel_tests, serial_tests = self._find_test_names(args) self.assertEquals(parallel_tests, args) self.assertEquals(serial_tests, []) + + def test_integration_tests_are_not_found_by_default(self): + parallel_tests, serial_tests = self._find_test_names([STUBS_CLASS]) + self.assertEquals(parallel_tests, [ + STUBS_CLASS + '.test_empty', + ]) + self.assertEquals(serial_tests, [ + STUBS_CLASS + '.serial_test_empty', + ]) + + def test_integration_tests_are_found(self): + parallel_tests, serial_tests = self._find_test_names(['--integration-tests', STUBS_CLASS]) + self.assertEquals(parallel_tests, [ + STUBS_CLASS + '.integration_test_empty', + STUBS_CLASS + '.test_empty', + ]) + self.assertEquals(serial_tests, [ + STUBS_CLASS + '.serial_integration_test_empty', + STUBS_CLASS + '.serial_test_empty', + ]) + + def integration_test_coverage_works(self): + filesystem = FileSystem() + executive = Executive() + module_path = filesystem.path_to_module(self.__module__) + script_dir = module_path[0:module_path.find('webkitpy') - 1] + proc = executive.popen([sys.executable, filesystem.join(script_dir, 'test-webkitpy'), '-c', STUBS_CLASS + '.test_empty'], + stdout=executive.PIPE, stderr=executive.PIPE) + out, _ = proc.communicate() + retcode = proc.returncode + self.assertEquals(retcode, 0) + self.assertTrue('Cover' in out) diff --git a/Tools/Scripts/webkitpy/thirdparty/__init__.py b/Tools/Scripts/webkitpy/thirdparty/__init__.py index 17ae62a07..74ea5f601 100644 --- a/Tools/Scripts/webkitpy/thirdparty/__init__.py +++ b/Tools/Scripts/webkitpy/thirdparty/__init__.py @@ -65,7 +65,12 @@ class AutoinstallImportHook(object): def __init__(self, filesystem=None): self._fs = filesystem or FileSystem() - def find_module(self, fullname, path): + def _ensure_autoinstalled_dir_is_in_sys_path(self): + # Some packages require that the are being put somewhere under a directory in sys.path. + if not _AUTOINSTALLED_DIR in sys.path: + sys.path.append(_AUTOINSTALLED_DIR) + + def find_module(self, fullname, _): # This method will run before each import. See http://www.python.org/dev/peps/pep-0302/ if '.autoinstalled' not in fullname: return @@ -98,11 +103,14 @@ class AutoinstallImportHook(object): "pep8-0.5.0/pep8.py") def _install_pylint(self): - installed_something = False + self._ensure_autoinstalled_dir_is_in_sys_path() + did_install_something = False if not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "pylint")): - installed_something = self._install('http://pypi.python.org/packages/source/p/pylint/pylint-0.25.1.tar.gz#md5=728bbc2b339bc3749af013709a7f87a5', 'pylint-0.25.1') - self._fs.move(self._fs.join(_AUTOINSTALLED_DIR, "pylint-0.25.1"), self._fs.join(_AUTOINSTALLED_DIR, "pylint")) - return installed_something + installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR) + did_install_something = installer.install("http://pypi.python.org/packages/source/l/logilab-common/logilab-common-0.58.1.tar.gz#md5=77298ab2d8bb8b4af9219791e7cee8ce", url_subpath="logilab-common-0.58.1", target_name="logilab/common") + did_install_something |= installer.install("http://pypi.python.org/packages/source/l/logilab-astng/logilab-astng-0.24.1.tar.gz#md5=ddaf66e4d85714d9c47a46d4bed406de", url_subpath="logilab-astng-0.24.1", target_name="logilab/astng") + did_install_something |= installer.install('http://pypi.python.org/packages/source/p/pylint/pylint-0.25.1.tar.gz#md5=728bbc2b339bc3749af013709a7f87a5', url_subpath="pylint-0.25.1", target_name="pylint") + return did_install_something # autoinstalled.buildbot is used by BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py # and should ideally match the version of BuildBot used at build.webkit.org. @@ -114,24 +122,23 @@ class AutoinstallImportHook(object): # without including other modules as a side effect. jinja_dir = self._fs.join(_AUTOINSTALLED_DIR, "jinja2") installer = AutoInstaller(append_to_search_path=True, target_dir=jinja_dir) - installed_something = installer.install(url="http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz#md5=1c49a8825c993bfdcf55bb36897d28a2", + did_install_something = installer.install(url="http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz#md5=1c49a8825c993bfdcf55bb36897d28a2", url_subpath="Jinja2-2.6/jinja2") SQLAlchemy_dir = self._fs.join(_AUTOINSTALLED_DIR, "sqlalchemy") installer = AutoInstaller(append_to_search_path=True, target_dir=SQLAlchemy_dir) - installed_something |= installer.install(url="http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.7.7.tar.gz#md5=ddf6df7e014cea318fa981364f3f93b9", + did_install_something |= installer.install(url="http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.7.7.tar.gz#md5=ddf6df7e014cea318fa981364f3f93b9", url_subpath="SQLAlchemy-0.7.7/lib/sqlalchemy") - installed_something |= self._install("http://pypi.python.org/packages/source/b/buildbot/buildbot-0.8.6p1.tar.gz#md5=b6727d2810c692062c657492bcbeac6a", "buildbot-0.8.6p1/buildbot") - return installed_something + did_install_something |= self._install("http://pypi.python.org/packages/source/b/buildbot/buildbot-0.8.6p1.tar.gz#md5=b6727d2810c692062c657492bcbeac6a", "buildbot-0.8.6p1/buildbot") + return did_install_something def _install_coverage(self): - installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR) - return installer.install(url="http://pypi.python.org/packages/source/c/coverage/coverage-3.5.1.tar.gz#md5=410d4c8155a4dab222f2bc51212d4a24", url_subpath="coverage-3.5.1/coverage") + self._ensure_autoinstalled_dir_is_in_sys_path() + return self._install(url="http://pypi.python.org/packages/source/c/coverage/coverage-3.5.1.tar.gz#md5=410d4c8155a4dab222f2bc51212d4a24", url_subpath="coverage-3.5.1/coverage") def _install_eliza(self): - installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR) - return installer.install(url="http://www.adambarth.com/webkit/eliza", target_name="eliza.py") + return self._install(url="http://www.adambarth.com/webkit/eliza", target_name="eliza.py") def _install_irc(self): # Since irclib and ircbot are two top-level packages, we need to import @@ -139,26 +146,26 @@ class AutoinstallImportHook(object): # organization purposes. irc_dir = self._fs.join(_AUTOINSTALLED_DIR, "irc") installer = AutoInstaller(target_dir=irc_dir) - installed_something = installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip", + did_install_something = installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip", url_subpath="irclib.py") - installed_something |= installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip", + did_install_something |= installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip", url_subpath="ircbot.py") - return installed_something + return did_install_something def _install_webpagereplay(self): - installed_something = False + did_install_something = False if not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "webpagereplay")): - installed_something = self._install("http://web-page-replay.googlecode.com/files/webpagereplay-1.1.2.tar.gz", "webpagereplay-1.1.2") + did_install_something = self._install("http://web-page-replay.googlecode.com/files/webpagereplay-1.1.2.tar.gz", "webpagereplay-1.1.2") self._fs.move(self._fs.join(_AUTOINSTALLED_DIR, "webpagereplay-1.1.2"), self._fs.join(_AUTOINSTALLED_DIR, "webpagereplay")) - init_path = self._fs.join(_AUTOINSTALLED_DIR, "webpagereplay", "__init__.py") - if not self._fs.exists(init_path): - self._fs.write_text_file(init_path, "") - return installed_something + module_init_path = self._fs.join(_AUTOINSTALLED_DIR, "webpagereplay", "__init__.py") + if not self._fs.exists(module_init_path): + self._fs.write_text_file(module_init_path, "") + return did_install_something - def _install(self, url, url_subpath): + def _install(self, url, url_subpath=None, target_name=None): installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR) - return installer.install(url=url, url_subpath=url_subpath) + return installer.install(url=url, url_subpath=url_subpath, target_name=target_name) _hook = AutoinstallImportHook() @@ -167,7 +174,7 @@ sys.meta_path.append(_hook) def autoinstall_everything(): install_methods = [method for method in dir(_hook.__class__) if method.startswith('_install_')] - installed_something = False + did_install_something = False for method in install_methods: - installed_something |= getattr(_hook, method)() - return installed_something + did_install_something |= getattr(_hook, method)() + return did_install_something diff --git a/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py b/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py index 3583ab432..b3eb75f98 100644 --- a/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py +++ b/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py @@ -32,13 +32,14 @@ import unittest from webkitpy.thirdparty import AutoinstallImportHook + class ThirdpartyTest(unittest.TestCase): def test_import_hook(self): # Add another import hook and make sure we get called. class MockImportHook(AutoinstallImportHook): def __init__(self): AutoinstallImportHook.__init__(self) - self._eliza_installed = False + self.eliza_installed = False def _install_eliza(self): self.eliza_installed = True @@ -48,11 +49,26 @@ class ThirdpartyTest(unittest.TestCase): # The actual AutoinstallImportHook should be installed before us, # so these modules will get installed before MockImportHook runs. sys.meta_path.append(mock_import_hook) + # unused-variable, import failures - pylint: disable-msg=W0612,E0611,F0401 from webkitpy.thirdparty.autoinstalled import eliza self.assertTrue(mock_import_hook.eliza_installed) finally: sys.meta_path.remove(mock_import_hook) + def test_imports(self): + # This method tests that we can actually import everything. + # unused-variable, import failures - pylint: disable-msg=W0612,E0611,F0401 + import webkitpy.thirdparty.autoinstalled.buildbot + import webkitpy.thirdparty.autoinstalled.coverage + import webkitpy.thirdparty.autoinstalled.eliza + import webkitpy.thirdparty.autoinstalled.irc.ircbot + import webkitpy.thirdparty.autoinstalled.irc.irclib + import webkitpy.thirdparty.autoinstalled.mechanize + import webkitpy.thirdparty.autoinstalled.pylint + import webkitpy.thirdparty.autoinstalled.webpagereplay + import webkitpy.thirdparty.autoinstalled.pep8 + + if __name__ == '__main__': unittest.main() diff --git a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py index 0cef8c867..8b3341623 100644 --- a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py +++ b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py @@ -45,6 +45,7 @@ from webkitpy.tool.mocktool import MockTool class MockCommitQueue(CommitQueueTaskDelegate): def __init__(self, error_plan): self._error_plan = error_plan + self._failure_status_id = 0 def run_command(self, command): log("run_webkit_patch: %s" % command) @@ -60,7 +61,8 @@ class MockCommitQueue(CommitQueueTaskDelegate): def command_failed(self, failure_message, script_error, patch): log("command_failed: failure_message='%s' script_error='%s' patch='%s'" % ( failure_message, script_error, patch.id())) - return 3947 + self._failure_status_id += 1 + return self._failure_status_id def refetch_patch(self, patch): return patch @@ -522,6 +524,8 @@ command_failed: failure_message='Unable to pass tests without patch (tree is red """ task = self._run_through_task(commit_queue, expected_stderr, GoldenScriptError) self.assertEqual(task.results_from_patch_test_run(task._patch).failing_tests(), ["foo.html", "bar.html"]) + # failure_status_id should be of the test with patch (1), not the test without patch (2). + self.assertEqual(task.failure_status_id, 1) def test_land_failure(self): commit_queue = MockCommitQueue([ diff --git a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py index 7c1487d7e..eeb06c3af 100644 --- a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py +++ b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py @@ -113,7 +113,7 @@ foo/bar.html has been flaky on the dummy-queue. foo/bar.html was authored by abarth@webkit.org. http://trac.webkit.org/browser/trunk/LayoutTests/foo/bar.html -The dummy-queue just saw foo/bar.html flake (Text diff mismatch) while processing attachment 10000 on bug 50000. +The dummy-queue just saw foo/bar.html flake (text diff) while processing attachment 10000 on bug 50000. Bot: mock-bot-id Port: MockPort Platform: MockPlatform 1.0 The bots will update this with information from each new failure. diff --git a/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py b/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py index 05ba73798..cde1c842e 100644 --- a/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py +++ b/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py @@ -186,6 +186,7 @@ class PatchAnalysisTask(object): first_results = self._delegate.test_results() first_results_archive = self._delegate.archive_last_test_results(self._patch) first_script_error = self._script_error + first_failure_status_id = self.failure_status_id if self._expected_failures.failures_were_expected(first_results): return True @@ -223,6 +224,7 @@ class PatchAnalysisTask(object): # Now that we have updated information about failing tests with a clean checkout, we can # tell if our original failures were unexpected and fail the patch if necessary. if self._expected_failures.unexpected_failures_observed(first_results): + self.failure_status_id = first_failure_status_id return self.report_failure(first_results_archive, first_results, first_script_error) # We don't know what's going on. The tree is likely very red (beyond our layout-test-results diff --git a/Tools/Scripts/webkitpy/tool/commands/gardenomatic.py b/Tools/Scripts/webkitpy/tool/commands/gardenomatic.py index 7da96e4bc..6cb1519ef 100644 --- a/Tools/Scripts/webkitpy/tool/commands/gardenomatic.py +++ b/Tools/Scripts/webkitpy/tool/commands/gardenomatic.py @@ -22,20 +22,38 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand +from webkitpy.layout_tests.port import builders +from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand from webkitpy.tool.servers.gardeningserver import GardeningHTTPServer -class GardenOMatic(AbstractDeclarativeCommand): +class GardenOMatic(AbstractRebaseliningCommand): name = "garden-o-matic" - help_text = "Experimental command for gardening the WebKit tree." + help_text = "Command for gardening the WebKit tree." + + def __init__(self): + return super(AbstractRebaseliningCommand, self).__init__(options=(self.platform_options + [ + self.move_overwritten_baselines_option, + self.results_directory_option, + self.no_optimize_option, + ])) def execute(self, options, args, tool): print "This command runs a local HTTP server that changes your working copy" print "based on the actions you take in the web-based UI." - httpd = GardeningHTTPServer(httpd_port=8127, config={'tool': tool}) - self._tool.user.open_url(httpd.url()) + args = {} + if options.platform: + # FIXME: This assumes that the port implementation (chromium-, gtk-, etc.) is the first part of options.platform. + args['platform'] = options.platform.split('-')[0] + builder = builders.builder_name_for_port_name(options.platform) + if builder: + args['builder'] = builder + if options.results_directory: + args['useLocalResults'] = "true" + + httpd = GardeningHTTPServer(httpd_port=8127, config={'tool': tool, 'options': options}) + self._tool.user.open_url(httpd.url(args)) print "Local HTTP server started." httpd.serve_forever() diff --git a/Tools/Scripts/webkitpy/tool/commands/queries.py b/Tools/Scripts/webkitpy/tool/commands/queries.py index 9fe8ef353..b7e4a8588 100644 --- a/Tools/Scripts/webkitpy/tool/commands/queries.py +++ b/Tools/Scripts/webkitpy/tool/commands/queries.py @@ -47,7 +47,7 @@ from webkitpy.tool.grammar import pluralize from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand from webkitpy.common.system.deprecated_logging import log from webkitpy.layout_tests.models.test_expectations import TestExpectations -from webkitpy.layout_tests.port import port_options +from webkitpy.layout_tests.port import platform_options, configuration_options class SuggestReviewers(AbstractDeclarativeCommand): @@ -440,7 +440,7 @@ class PrintExpectations(AbstractDeclarativeCommand): help='Print a CSV-style report that includes the port name, modifiers, tests, and expectations'), make_option('-f', '--full', action='store_true', default=False, help='Print a full TestExpectations-style line for every match'), - ] + port_options(platform='port/platform to use. Use glob-style wildcards for multiple ports (implies --csv)') + ] + platform_options(use_globs=True) AbstractDeclarativeCommand.__init__(self, options=options) self._expectation_models = {} @@ -519,7 +519,7 @@ class PrintBaselines(AbstractDeclarativeCommand): help='Print a CSV-style report that includes the port name, test_name, test platform, baseline type, baseline location, and baseline platform'), make_option('--include-virtual-tests', action='store_true', help='Include virtual tests'), - ] + port_options(platform='port/platform to use. Use glob-style wildcards for multiple ports (implies --csv)') + ] + platform_options(use_globs=True) AbstractDeclarativeCommand.__init__(self, options=options) self._platform_regexp = re.compile('platform/([^\/]+)/(.+)') diff --git a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py index b2243566a..6301fea0b 100644 --- a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py @@ -403,14 +403,14 @@ MOCK: release_work_item: commit-queue 10000 queue = TestCommitQueue(MockTool()) expected_stderr = """MOCK bug comment: bug_id=50002, cc=None --- Begin comment --- -The commit-queue just saw foo/bar.html flake (Text diff mismatch) while processing attachment 10000 on bug 50000. +The commit-queue just saw foo/bar.html flake (text diff) while processing attachment 10000 on bug 50000. Port: MockPort Platform: MockPlatform 1.0 --- End comment --- MOCK add_attachment_to_bug: bug_id=50002, description=Failure diff from bot filename=failure.diff mimetype=None MOCK bug comment: bug_id=50002, cc=None --- Begin comment --- -The commit-queue just saw bar/baz.html flake (Text diff mismatch) while processing attachment 10000 on bug 50000. +The commit-queue just saw bar/baz.html flake (text diff) while processing attachment 10000 on bug 50000. Port: MockPort Platform: MockPlatform 1.0 --- End comment --- diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py index 859963261..d9209b118 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py @@ -29,41 +29,45 @@ import json import logging import optparse -import os.path -import re -import shutil import sys -import urllib -import webkitpy.common.config.urls as config_urls from webkitpy.common.checkout.baselineoptimizer import BaselineOptimizer -from webkitpy.common.net.buildbot import BuildBot -from webkitpy.common.net.layouttestresults import LayoutTestResults from webkitpy.common.system.executive import ScriptError -from webkitpy.common.system.user import User from webkitpy.layout_tests.controllers.test_result_writer import TestResultWriter from webkitpy.layout_tests.models import test_failures -from webkitpy.layout_tests.models.test_configuration import TestConfiguration from webkitpy.layout_tests.models.test_expectations import TestExpectations, BASELINE_SUFFIX_LIST from webkitpy.layout_tests.port import builders -from webkitpy.tool.grammar import pluralize +from webkitpy.layout_tests.port import factory from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand _log = logging.getLogger(__name__) + # FIXME: Should TestResultWriter know how to compute this string? def _baseline_name(fs, test_name, suffix): return fs.splitext(test_name)[0] + TestResultWriter.FILENAME_SUFFIX_EXPECTED + "." + suffix class AbstractRebaseliningCommand(AbstractDeclarativeCommand): + # not overriding execute() - pylint: disable-msg=W0223 + + move_overwritten_baselines_option = optparse.make_option("--move-overwritten-baselines", action="store_true", default=False, + help="Move overwritten baselines elsewhere in the baseline path. This is for bringing up new ports.") + + no_optimize_option = optparse.make_option('--no-optimize', dest='optimize', action='store_false', default=True, + help=('Do not optimize/de-dup the expectations after rebaselining (default is to de-dup automatically). ' + 'You can use "webkit-patch optimize-baselines" to optimize separately.')) + + platform_options = factory.platform_options(use_globs=True) + + results_directory_option = optparse.make_option("--results-directory", help="Local results directory to use") + + suffixes_option = optparse.make_option("--suffixes", default=','.join(BASELINE_SUFFIX_LIST), action="store", + help="Comma-separated-list of file types to rebaseline") + def __init__(self, options=None): - options = options or [] - options.extend([ - optparse.make_option('--suffixes', default=','.join(BASELINE_SUFFIX_LIST), action='store', - help='file types to rebaseline')]) - AbstractDeclarativeCommand.__init__(self, options=options) + super(AbstractRebaseliningCommand, self).__init__(options=options) self._baseline_suffix_list = BASELINE_SUFFIX_LIST @@ -72,13 +76,15 @@ class RebaselineTest(AbstractRebaseliningCommand): help_text = "Rebaseline a single test from a buildbot. Only intended for use by other webkit-patch commands." def __init__(self): - options = [ + super(RebaselineTest, self).__init__(options=[ + self.no_optimize_option, + self.results_directory_option, + self.suffixes_option, optparse.make_option("--builder", help="Builder to pull new baselines from"), optparse.make_option("--move-overwritten-baselines-to", action="append", default=[], help="Platform to move existing baselines to before rebaselining. This is for bringing up new ports."), optparse.make_option("--test", help="Test to rebaseline"), - ] - AbstractRebaseliningCommand.__init__(self, options=options) + ]) self._scm_changes = {'add': []} def _results_url(self, builder_name): @@ -101,12 +107,12 @@ class RebaselineTest(AbstractRebaseliningCommand): port = self._tool.port_factory.get(platform) old_baseline = port.expected_filename(test_name, "." + suffix) if not self._tool.filesystem.exists(old_baseline): - _log.info("No existing baseline for %s." % test_name) + _log.debug("No existing baseline for %s." % test_name) continue new_baseline = self._tool.filesystem.join(port.baseline_path(), self._file_name_for_expected_result(test_name, suffix)) if self._tool.filesystem.exists(new_baseline): - _log.info("Existing baseline at %s, not copying over it." % new_baseline) + _log.debug("Existing baseline at %s, not copying over it." % new_baseline) continue old_baselines.append(old_baseline) @@ -116,7 +122,7 @@ class RebaselineTest(AbstractRebaseliningCommand): old_baseline = old_baselines[i] new_baseline = new_baselines[i] - _log.info("Copying baseline from %s to %s." % (old_baseline, new_baseline)) + _log.debug("Copying baseline from %s to %s." % (old_baseline, new_baseline)) self._tool.filesystem.maybe_make_directory(self._tool.filesystem.dirname(new_baseline)) self._tool.filesystem.copyfile(old_baseline, new_baseline) if not self._tool.scm().exists(new_baseline): @@ -136,16 +142,27 @@ class RebaselineTest(AbstractRebaseliningCommand): def _update_expectations_file(self, builder_name, test_name): port = self._tool.port_factory.get_from_builder_name(builder_name) - expectations = TestExpectations(port, include_overrides=False) - - for test_configuration in port.all_test_configurations(): - if test_configuration.version == port.test_configuration().version: - expectationsString = expectations.remove_configuration_from_test(test_name, test_configuration) - self._tool.filesystem.write_text_file(port.path_to_test_expectations_file(), expectationsString) + # Since rebaseline-test-internal can be called multiple times in parallel, + # we need to ensure that we're not trying to update the expectations file + # concurrently as well. + # FIXME: We should rework the code to not need this; maybe just download + # the files in parallel and rebaseline local files serially? + try: + path = port.path_to_test_expectations_file() + lock = self._tool.make_file_lock(path + '.lock') + lock.acquire_lock() + expectations = TestExpectations(port, include_overrides=False) + for test_configuration in port.all_test_configurations(): + if test_configuration.version == port.test_configuration().version: + expectationsString = expectations.remove_configuration_from_test(test_name, test_configuration) + + self._tool.filesystem.write_text_file(path, expectationsString) + finally: + lock.release_lock() def _test_root(self, test_name): - return os.path.splitext(test_name)[0] + return self._tool.filesystem.splitext(test_name)[0] def _file_name_for_actual_result(self, test_name, suffix): return "%s-actual.%s" % (self._test_root(test_name), suffix) @@ -153,8 +170,7 @@ class RebaselineTest(AbstractRebaseliningCommand): def _file_name_for_expected_result(self, test_name, suffix): return "%s-expected.%s" % (self._test_root(test_name), suffix) - def _rebaseline_test(self, builder_name, test_name, move_overwritten_baselines_to, suffix): - results_url = self._results_url(builder_name) + def _rebaseline_test(self, builder_name, test_name, move_overwritten_baselines_to, suffix, results_url): baseline_directory = self._baseline_directory(builder_name) source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_result(test_name, suffix)) @@ -163,17 +179,21 @@ class RebaselineTest(AbstractRebaseliningCommand): if move_overwritten_baselines_to: self._copy_existing_baseline(move_overwritten_baselines_to, test_name, suffix) - _log.info("Retrieving %s." % source_baseline) + _log.debug("Retrieving %s." % source_baseline) self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline) - def _rebaseline_test_and_update_expectations(self, builder_name, test_name, platforms_to_move_existing_baselines_to): + def _rebaseline_test_and_update_expectations(self, options): + if options.results_directory: + results_url = 'file://' + options.results_directory + else: + results_url = self._results_url(options.builder) + self._baseline_suffix_list = options.suffixes.split(',') for suffix in self._baseline_suffix_list: - self._rebaseline_test(builder_name, test_name, platforms_to_move_existing_baselines_to, suffix) - self._update_expectations_file(builder_name, test_name) + self._rebaseline_test(options.builder, options.test, options.move_overwritten_baselines_to, suffix, results_url) + self._update_expectations_file(options.builder, options.test) def execute(self, options, args, tool): - self._baseline_suffix_list = options.suffixes.split(',') - self._rebaseline_test_and_update_expectations(options.builder, options.test, options.move_overwritten_baselines_to) + self._rebaseline_test_and_update_expectations(options) print json.dumps(self._scm_changes) @@ -182,20 +202,27 @@ class OptimizeBaselines(AbstractRebaseliningCommand): help_text = "Reshuffles the baselines for the given tests to use as litte space on disk as possible." argument_names = "TEST_NAMES" - def _optimize_baseline(self, test_name): + def __init__(self): + super(OptimizeBaselines, self).__init__(options=[self.suffixes_option] + self.platform_options) + + def _optimize_baseline(self, optimizer, test_name): for suffix in self._baseline_suffix_list: baseline_name = _baseline_name(self._tool.filesystem, test_name, suffix) - if not self._baseline_optimizer.optimize(baseline_name): - print "Hueristics failed to optimize %s" % baseline_name + if not optimizer.optimize(baseline_name): + print "Heuristics failed to optimize %s" % baseline_name def execute(self, options, args, tool): self._baseline_suffix_list = options.suffixes.split(',') - self._baseline_optimizer = BaselineOptimizer(tool) - self._port = tool.port_factory.get("chromium-win-win7") # FIXME: This should be selectable. + port_names = tool.port_factory.all_port_names(options.platform) + if not port_names: + print "No port names match '%s'" % options.platform + return - for test_name in self._port.tests(args): - print "Optimizing %s." % test_name - self._optimize_baseline(test_name) + optimizer = BaselineOptimizer(tool, port_names) + port = tool.port_factory.get(port_names[0]) + for test_name in port.tests(args): + _log.info("Optimizing %s" % test_name) + self._optimize_baseline(optimizer, test_name) class AnalyzeBaselines(AbstractRebaseliningCommand): @@ -203,45 +230,54 @@ class AnalyzeBaselines(AbstractRebaseliningCommand): help_text = "Analyzes the baselines for the given tests and prints results that are identical." argument_names = "TEST_NAMES" - def _print(self, baseline_name, directories_by_result): - for result, directories in directories_by_result.items(): - if len(directories) <= 1: - continue - results_names = [self._tool.filesystem.join(directory, baseline_name) for directory in directories] - print ' '.join(results_names) - - def _analyze_baseline(self, test_name): + def __init__(self): + super(AnalyzeBaselines, self).__init__(options=[ + self.suffixes_option, + optparse.make_option('--missing', action='store_true', default=False, help='show missing baselines as well'), + ] + self.platform_options) + self._optimizer_class = BaselineOptimizer # overridable for testing + self._baseline_optimizer = None + self._port = None + + def _write(self, msg): + print msg + + def _analyze_baseline(self, options, test_name): for suffix in self._baseline_suffix_list: baseline_name = _baseline_name(self._tool.filesystem, test_name, suffix) - directories_by_result = self._baseline_optimizer.directories_by_result(baseline_name) - self._print(baseline_name, directories_by_result) + results_by_directory = self._baseline_optimizer.read_results_by_directory(baseline_name) + if results_by_directory: + self._write("%s:" % baseline_name) + self._baseline_optimizer.write_by_directory(results_by_directory, self._write, " ") + elif options.missing: + self._write("%s: (no baselines found)" % baseline_name) def execute(self, options, args, tool): self._baseline_suffix_list = options.suffixes.split(',') - self._baseline_optimizer = BaselineOptimizer(tool) - self._port = tool.port_factory.get("chromium-win-win7") # FIXME: This should be selectable. + port_names = tool.port_factory.all_port_names(options.platform) + if not port_names: + print "No port names match '%s'" % options.platform + return + self._baseline_optimizer = self._optimizer_class(tool, port_names) + self._port = tool.port_factory.get(port_names[0]) for test_name in self._port.tests(args): - self._analyze_baseline(test_name) + self._analyze_baseline(options, test_name) -class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): - def __init__(self, options=None): - options = options or [] - options.extend([ - optparse.make_option('--no-optimize', dest='optimize', action='store_false', default=True, - help=('Do not optimize/de-dup the expectations after rebaselining ' - '(default is to de-dup automatically). ' - 'You can use "webkit-patch optimize-baselines" to optimize separately.'))]) - AbstractDeclarativeCommand.__init__(self, options=options) - - def _run_webkit_patch(self, args): +class AbstractParallelRebaselineCommand(AbstractRebaseliningCommand): + # not overriding execute() - pylint: disable-msg=W0223 + + def _run_webkit_patch(self, args, verbose): try: - self._tool.executive.run_command([self._tool.path()] + args, cwd=self._tool.scm().checkout_root) + verbose_args = ['--verbose'] if verbose else [] + stderr = self._tool.executive.run_command([self._tool.path()] + verbose_args + args, cwd=self._tool.scm().checkout_root, return_stderr=True) + for line in stderr.splitlines(): + print >> sys.stderr, line except ScriptError, e: _log.error(e) - def _builders_to_fetch_from(self, builders): + def _builders_to_fetch_from(self, builders_to_check): # This routine returns the subset of builders that will cover all of the baseline search paths # used in the input list. In particular, if the input list contains both Release and Debug # versions of a configuration, we *only* return the Release version (since we don't save @@ -249,7 +285,7 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): release_builders = set() debug_builders = set() builders_to_fallback_paths = {} - for builder in builders: + for builder in builders_to_check: port = self._tool.port_factory.get_from_builder_name(builder) if port.test_configuration().build_type == 'Release': release_builders.add(builder) @@ -262,7 +298,8 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): builders_to_fallback_paths[builder] = fallback_path return builders_to_fallback_paths.keys() - def _rebaseline_commands(self, test_list): + def _rebaseline_commands(self, test_list, options): + path_to_webkit_patch = self._tool.path() cwd = self._tool.scm().checkout_root commands = [] @@ -270,9 +307,14 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): for builder in self._builders_to_fetch_from(test_list[test]): suffixes = ','.join(test_list[test][builder]) cmd_line = [path_to_webkit_patch, 'rebaseline-test-internal', '--suffixes', suffixes, '--builder', builder, '--test', test] - move_overwritten_baselines_to = builders.move_overwritten_baselines_to(builder) - for platform in move_overwritten_baselines_to: - cmd_line.extend(['--move-overwritten-baselines-to', platform]) + if options.move_overwritten_baselines: + move_overwritten_baselines_to = builders.move_overwritten_baselines_to(builder) + for platform in move_overwritten_baselines_to: + cmd_line.extend(['--move-overwritten-baselines-to', platform]) + if options.results_directory: + cmd_line.extend(['--results-directory', options.results_directory]) + if options.verbose: + cmd_line.append('--verbose') commands.append(tuple([cmd_line, cwd])) return commands @@ -282,9 +324,10 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): file_added = False for line in output: try: - files_to_add.update(json.loads(line)['add']) - file_added = True - except ValueError, e: + if line: + files_to_add.update(json.loads(line)['add']) + file_added = True + except ValueError: _log.debug('"%s" is not a JSON object, ignoring' % line) if not file_added: @@ -293,30 +336,48 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): return list(files_to_add) - def _optimize_baselines(self, test_list): + def _optimize_baselines(self, test_list, verbose=False): # We don't run this in parallel because modifying the SCM in parallel is unreliable. for test in test_list: all_suffixes = set() for builder in self._builders_to_fetch_from(test_list[test]): all_suffixes.update(test_list[test][builder]) - self._run_webkit_patch(['optimize-baselines', '--suffixes', ','.join(all_suffixes), test]) + # FIXME: We should propagate the platform options as well. + self._run_webkit_patch(['optimize-baselines', '--suffixes', ','.join(all_suffixes), test], verbose) def _rebaseline(self, options, test_list): - commands = self._rebaseline_commands(test_list) + for test, builders_to_check in sorted(test_list.items()): + _log.info("Rebaselining %s" % test) + for builder, suffixes in sorted(builders_to_check.items()): + _log.debug(" %s: %s" % (builder, ",".join(suffixes))) + + commands = self._rebaseline_commands(test_list, options) command_results = self._tool.executive.run_in_parallel(commands) + log_output = '\n'.join(result[2] for result in command_results).replace('\n\n', '\n') + for line in log_output.split('\n'): + if line: + print >> sys.stderr, line # FIXME: Figure out how to log properly. + files_to_add = self._files_to_add(command_results) if files_to_add: self._tool.scm().add_list(list(files_to_add)) if options.optimize: - self._optimize_baselines(test_list) + self._optimize_baselines(test_list, options.verbose) class RebaselineJson(AbstractParallelRebaselineCommand): name = "rebaseline-json" help_text = "Rebaseline based off JSON passed to stdin. Intended to only be called from other scripts." + def __init__(self,): + super(RebaselineJson, self).__init__(options=[ + self.move_overwritten_baselines_option, + self.no_optimize_option, + self.results_directory_option, + ]) + def execute(self, options, args, tool): self._rebaseline(options, json.loads(sys.stdin.read())) @@ -325,6 +386,13 @@ class RebaselineExpectations(AbstractParallelRebaselineCommand): name = "rebaseline-expectations" help_text = "Rebaselines the tests indicated in TestExpectations." + def __init__(self): + super(RebaselineExpectations, self).__init__(options=[ + self.move_overwritten_baselines_option, + self.no_optimize_option, + ] + self.platform_options) + self._test_list = None + def _update_expectations_files(self, port_name): port = self._tool.port_factory.get(port_name) @@ -356,8 +424,10 @@ class RebaselineExpectations(AbstractParallelRebaselineCommand): self._test_list[test_name][builder_name] = suffixes def execute(self, options, args, tool): + options.results_directory = None self._test_list = {} - for port_name in tool.port_factory.all_port_names(): + port_names = tool.port_factory.all_port_names(options.platform) + for port_name in port_names: self._add_tests_to_rebaseline_for_port(port_name) if not self._test_list: _log.warning("Did not find any tests marked Rebaseline.") @@ -365,7 +435,7 @@ class RebaselineExpectations(AbstractParallelRebaselineCommand): self._rebaseline(options, self._test_list) - for port_name in tool.port_factory.all_port_names(): + for port_name in port_names: self._update_expectations_files(port_name) @@ -375,11 +445,13 @@ class Rebaseline(AbstractParallelRebaselineCommand): argument_names = "[TEST_NAMES]" def __init__(self): - options = [ + super(Rebaseline, self).__init__(options=[ + self.move_overwritten_baselines_option, + self.no_optimize_option, + # FIXME: should we support the platform options in addition to (or instead of) --builders? + self.suffixes_option, optparse.make_option("--builders", default=None, action="append", help="Comma-separated-list of builders to pull new baselines from (can also be provided multiple times)"), - optparse.make_option("--suffixes", default=BASELINE_SUFFIX_LIST, action="append", help="Comma-separated-list of file types to rebaseline (can also be provided multiple times)"), - ] - AbstractParallelRebaselineCommand.__init__(self, options=options) + ]) def _builders_to_pull_from(self): chromium_buildbot_builder_names = [] @@ -403,30 +475,26 @@ class Rebaseline(AbstractParallelRebaselineCommand): failing_tests = builder.latest_layout_test_results().tests_matching_failure_types([test_failures.FailureTextMismatch]) return self._tool.user.prompt_with_list("Which test(s) to rebaseline for %s:" % builder.name(), failing_tests, can_choose_multiple=True) - def _suffixes_to_update(self, options): - suffixes = set() - for suffix_list in options.suffixes: - suffixes |= set(suffix_list.split(",")) - return list(suffixes) - def execute(self, options, args, tool): + options.results_directory = None if options.builders: - builders = [] + builders_to_check = [] for builder_names in options.builders: - builders += [self._builder_with_name(name) for name in builder_names.split(",")] + builders_to_check += [self._builder_with_name(name) for name in builder_names.split(",")] else: - builders = self._builders_to_pull_from() + builders_to_check = self._builders_to_pull_from() test_list = {} + suffixes_to_update = options.suffixes.split(",") - for builder in builders: + for builder in builders_to_check: tests = args or self._tests_to_update(builder) for test in tests: if test not in test_list: test_list[test] = {} - test_list[test][builder.name()] = self._suffixes_to_update(options) + test_list[test][builder.name()] = suffixes_to_update if options.verbose: - print "rebaseline-json: " + str(test_list) + _log.debug("rebaseline-json: " + str(test_list)) self._rebaseline(options, test_list) diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py index 35394245f..d7dafb91c 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py @@ -29,487 +29,373 @@ import unittest from webkitpy.common.system.outputcapture import OutputCapture +from webkitpy.common.checkout.baselineoptimizer import BaselineOptimizer +from webkitpy.common.net.buildbot.buildbot_mock import MockBuilder +from webkitpy.common.system.executive_mock import MockExecutive2 from webkitpy.thirdparty.mock import Mock from webkitpy.tool.commands.rebaseline import * from webkitpy.tool.mocktool import MockTool, MockOptions -from webkitpy.common.net.buildbot.buildbot_mock import MockBuilder -from webkitpy.common.system.executive_mock import MockExecutive -class TestRebaseline(unittest.TestCase): - def test_tests_to_update(self): - command = Rebaseline() - command.bind_to_tool(MockTool()) - build = Mock() - OutputCapture().assert_outputs(self, command._tests_to_update, [build]) +class _BaseTestCase(unittest.TestCase): + MOCK_WEB_RESULT = 'MOCK Web result, convert 404 to None=True' + WEB_PREFIX = 'http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results' + + command_constructor = None + + def setUp(self): + self.tool = MockTool() + self.command = self.command_constructor() # lint warns that command_constructor might not be set, but this is intentional; pylint: disable-msg=E1102 + self.command.bind_to_tool(self.tool) + self.lion_port = self.tool.port_factory.get_from_builder_name("WebKit Mac10.7") + self.lion_expectations_path = self.lion_port.path_to_test_expectations_file() + + # FIXME: we should override builders._exact_matches here to point to a set + # of test ports and restore the value in tearDown(), and that way the + # individual tests wouldn't have to worry about it. + + def _expand(self, path): + if self.tool.filesystem.isabs(path): + return path + return self.tool.filesystem.join(self.lion_port.layout_tests_dir(), path) + + def _read(self, path): + return self.tool.filesystem.read_text_file(self._expand(path)) + + def _write(self, path, contents): + self.tool.filesystem.write_text_file(self._expand(path), contents) + + def _zero_out_test_expectations(self): + for port_name in self.tool.port_factory.all_port_names(): + port = self.tool.port_factory.get(port_name) + for path in port.expectations_files(): + self._write(path, '') + self.tool.filesystem.written_files = {} + + +class TestRebaselineTest(_BaseTestCase): + command_constructor = RebaselineTest # AKA webkit-patch rebaseline-test-internal + + def setUp(self): + super(TestRebaselineTest, self).setUp() + self.options = MockOptions(builder="WebKit Mac10.7", test="userscripts/another-test.html", suffixes="txt", + move_overwritten_baselines_to=None, results_directory=None) def test_baseline_directory(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) + command = self.command self.assertEqual(command._baseline_directory("Apple Win XP Debug (Tests)"), "/mock-checkout/LayoutTests/platform/win-xp") self.assertEqual(command._baseline_directory("Apple Win 7 Release (Tests)"), "/mock-checkout/LayoutTests/platform/win") self.assertEqual(command._baseline_directory("Apple Lion Release WK1 (Tests)"), "/mock-checkout/LayoutTests/platform/mac-lion") self.assertEqual(command._baseline_directory("Apple Lion Release WK2 (Tests)"), "/mock-checkout/LayoutTests/platform/mac-wk2") self.assertEqual(command._baseline_directory("GTK Linux 32-bit Release"), "/mock-checkout/LayoutTests/platform/gtk") - self.assertEqual(command._baseline_directory("EFL Linux 64-bit Debug"), "/mock-checkout/LayoutTests/platform/efl") + self.assertEqual(command._baseline_directory("EFL Linux 64-bit Debug"), "/mock-checkout/LayoutTests/platform/efl-wk1") self.assertEqual(command._baseline_directory("Qt Linux Release"), "/mock-checkout/LayoutTests/platform/qt") self.assertEqual(command._baseline_directory("WebKit Mac10.7"), "/mock-checkout/LayoutTests/platform/chromium-mac-lion") self.assertEqual(command._baseline_directory("WebKit Mac10.6"), "/mock-checkout/LayoutTests/platform/chromium-mac-snowleopard") def test_rebaseline_updates_expectations_file_noop(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) - - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - for path in lion_port.expectations_files(): - tool.filesystem.write_text_file(path, '') - tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ] + self._zero_out_test_expectations() + self._write(self.lion_expectations_path, """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ] Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ] """) - tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "fast/dom/Window/window-postmessage-clone-really-deep-array.html"), "Dummy test contents") - tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "fast/css/large-list-of-rules-crash.html"), "Dummy test contents") - tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") - - expected_logs = """Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.wav. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" - OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["WebKit Mac10.7", "userscripts/another-test.html", None], expected_logs=expected_logs) - - new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) + self._write("fast/dom/Window/window-postmessage-clone-really-deep-array.html", "Dummy test contents") + self._write("fast/css/large-list-of-rules-crash.html", "Dummy test contents") + self._write("userscripts/another-test.html", "Dummy test contents") + + self.options.suffixes = "png,wav,txt" + self.command._rebaseline_test_and_update_expectations(self.options) + + self.assertEquals(self.tool.web.urls_fetched, + [self.WEB_PREFIX + '/userscripts/another-test-actual.png', + self.WEB_PREFIX + '/userscripts/another-test-actual.wav', + self.WEB_PREFIX + '/userscripts/another-test-actual.txt']) + new_expectations = self._read(self.lion_expectations_path) self.assertEqual(new_expectations, """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ] Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ] """) def test_rebaseline_updates_expectations_file(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) + self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") + self._write("userscripts/another-test.html", "Dummy test contents") - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") - tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") + self.options.suffixes = 'png,wav,txt' + self.command._rebaseline_test_and_update_expectations(self.options) - expected_logs = """Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.wav. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" - OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["WebKit Mac10.7", "userscripts/another-test.html", None], expected_logs=expected_logs) - - new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) + self.assertEquals(self.tool.web.urls_fetched, + [self.WEB_PREFIX + '/userscripts/another-test-actual.png', + self.WEB_PREFIX + '/userscripts/another-test-actual.wav', + self.WEB_PREFIX + '/userscripts/another-test-actual.txt']) + new_expectations = self._read(self.lion_expectations_path) self.assertEqual(new_expectations, "Bug(x) [ MountainLion SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") def test_rebaseline_does_not_include_overrides(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) - - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") - tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "Bug(y) [ Mac ] other-test.html [ Failure ]\n") - tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") - - expected_logs = """Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.wav. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" - OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["WebKit Mac10.7", "userscripts/another-test.html", None], expected_logs=expected_logs) - - new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) + self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") + self._write(self.lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "Bug(y) [ Mac ] other-test.html [ Failure ]\n") + self._write("userscripts/another-test.html", "Dummy test contents") + + self.options.suffixes = 'png,wav,txt' + self.command._rebaseline_test_and_update_expectations(self.options) + + self.assertEquals(self.tool.web.urls_fetched, + [self.WEB_PREFIX + '/userscripts/another-test-actual.png', + self.WEB_PREFIX + '/userscripts/another-test-actual.wav', + self.WEB_PREFIX + '/userscripts/another-test-actual.txt']) + + new_expectations = self._read(self.lion_expectations_path) self.assertEqual(new_expectations, "Bug(x) [ MountainLion SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") def test_rebaseline_test(self): - command = RebaselineTest() - command.bind_to_tool(MockTool()) - expected_logs = "Retrieving http://example.com/f/builders/WebKit Linux/results/layout-test-results/userscripts/another-test-actual.txt.\n" - OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Linux", "userscripts/another-test.html", None, "txt"], expected_logs=expected_logs) + self.command._rebaseline_test("WebKit Linux", "userscripts/another-test.html", None, "txt", self.WEB_PREFIX) + self.assertEquals(self.tool.web.urls_fetched, [self.WEB_PREFIX + '/userscripts/another-test-actual.txt']) + + def test_rebaseline_test_with_results_directory(self): + self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") + self.options.results_directory = '/tmp' + self.command._rebaseline_test_and_update_expectations(self.options) + self.assertEquals(self.tool.web.urls_fetched, ['file:///tmp/userscripts/another-test-actual.txt']) def test_rebaseline_test_and_print_scm_changes(self): - command = RebaselineTest() - command.bind_to_tool(MockTool()) - expected_logs = "Retrieving http://example.com/f/builders/WebKit Linux/results/layout-test-results/userscripts/another-test-actual.txt.\n" - command._print_scm_changes = True - command._scm_changes = {'add': [], 'delete': []} - command._tool._scm.exists = lambda x: False - OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Linux", "userscripts/another-test.html", None, "txt"], expected_logs=expected_logs) - self.assertEquals(command._scm_changes, {'add': ['/mock-checkout/LayoutTests/platform/chromium-linux/userscripts/another-test-expected.txt'], 'delete': []}) + self.command._print_scm_changes = True + self.command._scm_changes = {'add': [], 'delete': []} + self.tool._scm.exists = lambda x: False + + self.command._rebaseline_test("WebKit Linux", "userscripts/another-test.html", None, "txt", None) + + self.assertEquals(self.command._scm_changes, {'add': ['/mock-checkout/LayoutTests/platform/chromium-linux/userscripts/another-test-expected.txt'], 'delete': []}) def test_rebaseline_and_copy_test(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) + self._write("userscripts/another-test-expected.txt", "generic result") - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test-expected.txt"), "Dummy expected result") + self.command._rebaseline_test("WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt", None) - expected_logs = """Copying baseline from /mock-checkout/LayoutTests/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" - OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_logs=expected_logs) + self.assertEquals(self._read('platform/chromium-mac-lion/userscripts/another-test-expected.txt'), self.MOCK_WEB_RESULT) + self.assertEquals(self._read('platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt'), 'generic result') def test_rebaseline_and_copy_test_no_existing_result(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) + self.command._rebaseline_test("WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt", None) - expected_logs = """No existing baseline for userscripts/another-test.html. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" - OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_logs=expected_logs) + self.assertEquals(self._read('platform/chromium-mac-lion/userscripts/another-test-expected.txt'), self.MOCK_WEB_RESULT) + self.assertFalse(self.tool.filesystem.exists(self._expand('platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt'))) def test_rebaseline_and_copy_test_with_lion_result(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) + self._write("platform/chromium-mac-lion/userscripts/another-test-expected.txt", "original lion result") - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - tool.filesystem.write_text_file(os.path.join(lion_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") + self.command._rebaseline_test("WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt", self.WEB_PREFIX) - expected_logs = "Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac-lion/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt.\nRetrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt.\n" - OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_logs=expected_logs) + self.assertEquals(self.tool.web.urls_fetched, [self.WEB_PREFIX + '/userscripts/another-test-actual.txt']) + self.assertEquals(self._read("platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt"), "original lion result") + self.assertEquals(self._read("platform/chromium-mac-lion/userscripts/another-test-expected.txt"), self.MOCK_WEB_RESULT) def test_rebaseline_and_copy_no_overwrite_test(self): - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) - - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - tool.filesystem.write_text_file(os.path.join(lion_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") - - snowleopard_port = tool.port_factory.get_from_builder_name("WebKit Mac10.6") - tool.filesystem.write_text_file(os.path.join(snowleopard_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") - - expected_logs = """Existing baseline at /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt, not copying over it. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" - OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_logs=expected_logs) - - def test_rebaseline_all(self): - old_exact_matches = builders._exact_matches - builders._exact_matches = { - "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, - "MOCK builder (Debug)": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier", "debug"])}, - } - - command = RebaselineJson() - tool = MockTool() - options = MockOptions() - options.optimize = True - command.bind_to_tool(tool) - tool.executive = MockExecutive(should_log=True) + self._write("platform/chromium-mac-lion/userscripts/another-test-expected.txt", "original lion result") + self._write("platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt", "original snowleopard result") - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout -""" - OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder": ["txt", "png"]}}], expected_stderr=expected_stderr) + self.command._rebaseline_test("WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt", None) - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder (Debug)', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout -""" - OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt", "png"]}}], expected_stderr=expected_stderr) + self.assertEquals(self._read("platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt"), "original snowleopard result") + self.assertEquals(self._read("platform/chromium-mac-lion/userscripts/another-test-expected.txt"), self.MOCK_WEB_RESULT) - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'user-scripts/another-test.html'], cwd=/mock-checkout -""" - OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt", "png"], "MOCK builder": ["txt"]}}], expected_stderr=expected_stderr) - - builders._exact_matches = old_exact_matches - - def test_rebaseline_expectations(self): - command = RebaselineExpectations() - tool = MockTool() - command.bind_to_tool(tool) - - lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") - for port_name in tool.port_factory.all_port_names(): - port = tool.port_factory.get(port_name) - for path in port.expectations_files(): - tool.filesystem.write_text_file(path, '') - - # Don't enable logging until after we create the mock expectation files as some Port.__init__'s run subcommands. - tool.executive = MockExecutive(should_log=True) - - def run_in_parallel(commands): - print commands - return "" - - tool.executive.run_in_parallel = run_in_parallel - - expected_logs = "Retrieving results for chromium-linux-x86 from WebKit Linux 32.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-linux-x86_64 from WebKit Linux.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-lion from WebKit Mac10.7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-mountainlion from WebKit Mac10.8.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-snowleopard from WebKit Mac10.6.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-win7 from WebKit Win7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-xp from WebKit XP.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for efl from EFL Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for gtk from GTK Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-lion from Apple Lion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-mountainlion from Apple MountainLion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for qt-linux from Qt Linux Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for win-7sp0 from Apple Win 7 Release (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\n" - - expected_stdout = "[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.8', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit XP', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.8', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit XP', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')]\n" - - expected_stderr = """MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -""" - - command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])} - OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=False), [], tool], expected_logs=expected_logs, expected_stdout=expected_stdout, expected_stderr=expected_stderr) - - expected_stderr_with_optimize = """MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'png', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -MOCK run_command: ['qmake', '-v'], cwd=None -""" - - command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])} - OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True), [], tool], expected_logs=expected_logs, expected_stdout=expected_stdout, expected_stderr=expected_stderr_with_optimize) - - def _assert_command(self, command, options=None, args=None, expected_stdout='', expected_stderr='', expected_logs=''): - # FIXME: generalize so more tests use this to get rid of boilerplate. - options = options or MockOptions(optimize=True, builders=None, suffixes=['txt'], verbose=False) - args = args or [] - - tool = MockTool() - command.bind_to_tool(tool) - - port = tool.port_factory.get('chromium-mac-lion') - - for port_name in tool.port_factory.all_port_names(): - port = tool.port_factory.get(port_name) - for path in port.expectations_files(): - tool.filesystem.write_text_file(path, '') - - OutputCapture().assert_outputs(self, command.execute, [options, args, tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr, expected_logs=expected_logs) - - def test_rebaseline_expectations_noop(self): - self._assert_command(RebaselineExpectations(), expected_logs='Did not find any tests marked Rebaseline.\n') - - def test_overrides_are_included_correctly(self): - command = RebaselineExpectations() - tool = MockTool() - command.bind_to_tool(tool) - port = tool.port_factory.get('chromium-mac-lion') - - # This tests that the any tests marked as REBASELINE in the overrides are found, but - # that the overrides do not get written into the main file. - expectations_path = port.expectations_files()[0] - expectations_contents = '' - port._filesystem.write_text_file(expectations_path, expectations_contents) - port.expectations_dict = lambda: { - expectations_path: expectations_contents, - 'overrides': ('Bug(x) userscripts/another-test.html [ Failure Rebaseline ]\n' - 'Bug(y) userscripts/test.html [ Crash ]\n')} + def test_rebaseline_test_internal_with_move_overwritten_baselines_to(self): + self.tool.executive = MockExecutive2() - for path in port.expectations_files(): - port._filesystem.write_text_file(path, '') - port._filesystem.write_text_file(port.layout_tests_dir() + '/userscripts/another-test.html', '') - self.assertEquals(command._tests_to_rebaseline(port), {'userscripts/another-test.html': set(['png', 'txt', 'wav'])}) - self.assertEquals(port._filesystem.read_text_file(expectations_path), expectations_contents) + # FIXME: it's confusing that this is the test- port, and not the regular lion port. Really all of the tests should be using the test ports. + port = self.tool.port_factory.get('test-mac-snowleopard') + self._write(port._filesystem.join(port.layout_tests_dir(), 'platform/test-mac-snowleopard/failures/expected/image-expected.txt'), 'original snowleopard result') - def test_rebaseline(self): old_exact_matches = builders._exact_matches + oc = OutputCapture() try: builders._exact_matches = { - "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, + "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, + "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier"])}, } - command = Rebaseline() - tool = MockTool() - command.bind_to_tool(tool) - - for port_name in tool.port_factory.all_port_names(): - port = tool.port_factory.get(port_name) - for path in port.expectations_files(): - tool.filesystem.write_text_file(path, '') - - tool.executive = MockExecutive(should_log=True) - - def mock_builders_to_pull_from(): - return [MockBuilder('MOCK builder')] - - def mock_tests_to_update(build): - return ['mock/path/to/test.html'] - - command._builders_to_pull_from = mock_builders_to_pull_from - command._tests_to_update = mock_tests_to_update - - expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder': ['txt']}} -""" - - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test.html'], cwd=/mock-checkout -""" - - OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=None, suffixes=["txt"], verbose=True), [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr) + options = MockOptions(optimize=True, builder="MOCK SnowLeopard", suffixes="txt", + move_overwritten_baselines_to=["test-mac-leopard"], verbose=True, test="failures/expected/image.html", + results_directory=None) + oc.capture_output() + self.command.execute(options, [], self.tool) finally: + out, _, _ = oc.restore_output() builders._exact_matches = old_exact_matches - def test_rebaseline_command_line_flags(self): - old_exact_matches = builders._exact_matches - try: - builders._exact_matches = { - "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, - } + self.assertEquals(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-mac-leopard/failures/expected/image-expected.txt')), 'original snowleopard result') + self.assertEquals(out, '{"add": []}\n') - command = Rebaseline() - tool = MockTool() - command.bind_to_tool(tool) - for port_name in tool.port_factory.all_port_names(): - port = tool.port_factory.get(port_name) - for path in port.expectations_files(): - tool.filesystem.write_text_file(path, '') +class TestRebaselineJson(_BaseTestCase): + command_constructor = RebaselineJson - tool.executive = MockExecutive(should_log=True) + def setUp(self): + super(TestRebaselineJson, self).setUp() + self.tool.executive = MockExecutive2() + self.old_exact_matches = builders._exact_matches + builders._exact_matches = { + "MOCK builder": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier"]), + "move_overwritten_baselines_to": ["test-mac-leopard"]}, + "MOCK builder (Debug)": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier", "debug"])}, + } - expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder': ['txt']}} -""" + def tearDown(self): + builders._exact_matches = self.old_exact_matches + super(TestRebaselineJson, self).tearDown() - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test.html'], cwd=/mock-checkout -""" + def test_rebaseline_all(self): + options = MockOptions(optimize=True, verbose=True, move_overwritten_baselines=False, results_directory=None) + self.command._rebaseline(options, {"user-scripts/another-test.html": {"MOCK builder": ["txt", "png"]}}) - builder = "MOCK builder" - test = "mock/path/to/test.html" - OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=[builder], suffixes=["txt"], verbose=True), [test], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr) + # Note that we have one run_in_parallel() call followed by a run_command() + self.assertEquals(self.tool.executive.calls, + [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html', '--verbose']], + ['echo', '--verbose', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html']]) - finally: - builders._exact_matches = old_exact_matches + def test_rebaseline_debug(self): + options = MockOptions(optimize=True, verbose=True, move_overwritten_baselines=False, results_directory=None) + self.command._rebaseline(options, {"user-scripts/another-test.html": {"MOCK builder (Debug)": ["txt", "png"]}}) - def test_rebaseline_multiple_builders(self): - old_exact_matches = builders._exact_matches - try: - builders._exact_matches = { - "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, - "MOCK builder2": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier2"])}, - } + # Note that we have one run_in_parallel() call followed by a run_command() + self.assertEquals(self.tool.executive.calls, + [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder (Debug)', '--test', 'user-scripts/another-test.html', '--verbose']], + ['echo', '--verbose', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html']]) - command = Rebaseline() - tool = MockTool() - command.bind_to_tool(tool) + def test_move_overwritten(self): + options = MockOptions(optimize=True, verbose=True, move_overwritten_baselines=True, results_directory=None) + self.command._rebaseline(options, {"user-scripts/another-test.html": {"MOCK builder": ["txt", "png"]}}) - for port_name in tool.port_factory.all_port_names(): - port = tool.port_factory.get(port_name) - for path in port.expectations_files(): - tool.filesystem.write_text_file(path, '') + # Note that we have one run_in_parallel() call followed by a run_command() + self.assertEquals(self.tool.executive.calls, + [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html', '--move-overwritten-baselines-to', 'test-mac-leopard', '--verbose']], + ['echo', '--verbose', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html']]) - tool.executive = MockExecutive(should_log=True) + def test_no_optimize(self): + options = MockOptions(optimize=False, verbose=True, move_overwritten_baselines=False, results_directory=None) + self.command._rebaseline(options, {"user-scripts/another-test.html": {"MOCK builder (Debug)": ["txt", "png"]}}) - def mock_builders_to_pull_from(): - return [MockBuilder('MOCK builder'), MockBuilder('MOCK builder2')] + # Note that we have only one run_in_parallel() call + self.assertEquals(self.tool.executive.calls, + [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder (Debug)', '--test', 'user-scripts/another-test.html', '--verbose']]]) - def mock_tests_to_update(build): - return ['mock/path/to/test.html'] + def test_results_directory(self): + options = MockOptions(optimize=False, verbose=True, move_overwritten_baselines=False, results_directory='/tmp') + self.command._rebaseline(options, {"user-scripts/another-test.html": {"MOCK builder": ["txt", "png"]}}) - command._builders_to_pull_from = mock_builders_to_pull_from - command._tests_to_update = mock_tests_to_update + # Note that we have only one run_in_parallel() call + self.assertEquals(self.tool.executive.calls, + [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html', '--results-directory', '/tmp', '--verbose']]]) - expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['txt'], 'MOCK builder': ['txt']}} -""" - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test.html'], cwd=/mock-checkout -""" +class TestRebaseline(_BaseTestCase): + # This command shares most of its logic with RebaselineJson, so these tests just test what is different. - OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=None, suffixes=["txt"], verbose=True), [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr) + command_constructor = Rebaseline # AKA webkit-patch rebaseline - finally: - builders._exact_matches = old_exact_matches + def test_tests_to_update(self): + build = Mock() + OutputCapture().assert_outputs(self, self.command._tests_to_update, [build]) + + def test_rebaseline(self): + self.command._builders_to_pull_from = lambda: [MockBuilder('MOCK builder')] + self.command._tests_to_update = lambda builder: ['mock/path/to/test.html'] + + self._zero_out_test_expectations() - def test_rebaseline_multiple_builders_and_tests_command_line(self): old_exact_matches = builders._exact_matches + oc = OutputCapture() try: builders._exact_matches = { "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, - "MOCK builder2": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier2"])}, - "MOCK builder3": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier2"])}, } - - command = Rebaseline() - tool = MockTool() - command.bind_to_tool(tool) - - for port_name in tool.port_factory.all_port_names(): - port = tool.port_factory.get(port_name) - for path in port.expectations_files(): - tool.filesystem.write_text_file(path, '') - - tool.executive = MockExecutive(should_log=True) - - expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['wav', 'txt', 'png'], 'MOCK builder': ['wav', 'txt', 'png'], 'MOCK builder3': ['wav', 'txt', 'png']}, 'mock/path/to/test2.html': {'MOCK builder2': ['wav', 'txt', 'png'], 'MOCK builder': ['wav', 'txt', 'png'], 'MOCK builder3': ['wav', 'txt', 'png']}} -""" - - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'wav,txt,png', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'wav,txt,png', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'wav,txt,png', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test2.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'wav,txt,png', '--builder', 'MOCK builder', '--test', 'mock/path/to/test2.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'wav,txt,png', 'mock/path/to/test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'wav,txt,png', 'mock/path/to/test2.html'], cwd=/mock-checkout -""" - - OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=["MOCK builder,MOCK builder2", "MOCK builder3"], suffixes=["txt,png", "png,wav,txt"], verbose=True), ["mock/path/to/test.html", "mock/path/to/test2.html"], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr) - + oc.capture_output() + self.command.execute(MockOptions(optimize=False, builders=None, suffixes="txt,png", verbose=True, move_overwritten_baselines=False), [], self.tool) finally: + oc.restore_output() builders._exact_matches = old_exact_matches - def test_rebaseline_json_with_move_overwritten_baselines_to(self): - old_exact_matches = builders._exact_matches - try: - builders._exact_matches = { - "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, - "MOCK builder2": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier2"]), - "move_overwritten_baselines_to": ["test-mac-leopard"]}, - } + calls = filter(lambda x: x != ['qmake', '-v'] and x[0] != 'perl', self.tool.executive.calls) + self.assertEquals(calls, + [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html', '--verbose']]]) - command = Rebaseline() - tool = MockTool() - tool.executive = MockExecutive(should_log=True) - command.bind_to_tool(tool) - expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['txt', 'png']}}\n""" - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html', '--move-overwritten-baselines-to', 'test-mac-leopard'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'mock/path/to/test.html'], cwd=/mock-checkout -""" +class TestRebaselineExpectations(_BaseTestCase): + command_constructor = RebaselineExpectations - options = MockOptions(optimize=True, builders=["MOCK builder2"], suffixes=["txt,png"], verbose=True) - OutputCapture().assert_outputs(self, command.execute, [options, ["mock/path/to/test.html"], tool], - expected_stdout=expected_stdout, expected_stderr=expected_stderr) - finally: - builders._exact_matches = old_exact_matches + def setUp(self): + super(TestRebaselineExpectations, self).setUp() + self.options = MockOptions(optimize=False, builders=None, suffixes=['txt'], verbose=False, platform=None, + move_overwritten_baselines=False, results_directory=None) - def test_rebaseline_test_internal_with_move_overwritten_baselines_to(self): - old_exact_matches = builders._exact_matches - try: - builders._exact_matches = { - "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, - "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier"])}, - } + def test_rebaseline_expectations(self): + self._zero_out_test_expectations() - command = RebaselineTest() - tool = MockTool() - tool.executive = MockExecutive(should_log=True) - command.bind_to_tool(tool) + self.tool.executive = MockExecutive2() - port = tool.port_factory.get('test-mac-snowleopard') - tool.filesystem.write_text_file(tool.filesystem.join(port.baseline_version_dir(), 'failures', 'expected', 'image-expected.txt'), '') + self.command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])} + self.command.execute(self.options, [], self.tool) - options = MockOptions(optimize=True, builder="MOCK SnowLeopard", suffixes="txt", - move_overwritten_baselines_to=["test-mac-leopard"], verbose=True, test="failures/expected/image.html") + # FIXME: change this to use the test- ports. + calls = filter(lambda x: x != ['qmake', '-v'], self.tool.executive.calls) + self.assertTrue(len(calls) == 1) + self.assertTrue(len(calls[0]) == 26) + + def test_rebaseline_expectations_noop(self): + self._zero_out_test_expectations() - oc = OutputCapture() + oc = OutputCapture() + try: oc.capture_output() - try: - logs = '' - command.execute(options, [], tool) - finally: - _, _, logs = oc.restore_output() + self.command.execute(self.options, [], self.tool) + finally: + _, _, logs = oc.restore_output() + self.assertEquals(self.tool.filesystem.written_files, {}) + self.assertEquals(logs, 'Did not find any tests marked Rebaseline.\n') - self.assertTrue("Copying baseline from /test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image-expected.txt to /test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt.\n" in logs) + def disabled_test_overrides_are_included_correctly(self): + # This tests that the any tests marked as REBASELINE in the overrides are found, but + # that the overrides do not get written into the main file. + self._zero_out_test_expectations() - finally: - builders._exact_matches = old_exact_matches + self._write(self.lion_expectations_path, '') + self.lion_port.expectations_dict = lambda: { + self.lion_expectations_path: '', + 'overrides': ('Bug(x) userscripts/another-test.html [ Failure Rebaseline ]\n' + 'Bug(y) userscripts/test.html [ Crash ]\n')} + self._write('/userscripts/another-test.html', '') + + self.assertEquals(self.command._tests_to_rebaseline(self.lion_port), {'userscripts/another-test.html': set(['png', 'txt', 'wav'])}) + self.assertEquals(self._read(self.lion_expectations_path), '') + + +class _FakeOptimizer(BaselineOptimizer): + def read_results_by_directory(self, baseline_name): + if baseline_name.endswith('txt'): + return {'LayoutTests/passes/text.html': '123456', + 'LayoutTests/platform/test-mac-leopard/passes/text.html': 'abcdef'} + return {} + + +class TestAnalyzeBaselines(_BaseTestCase): + command_constructor = AnalyzeBaselines + + def setUp(self): + super(TestAnalyzeBaselines, self).setUp() + self.port = self.tool.port_factory.get('test') + self.tool.port_factory.get = (lambda port_name=None, options=None: self.port) + self.lines = [] + self.command._optimizer_class = _FakeOptimizer + self.command._write = (lambda msg: self.lines.append(msg)) # pylint bug warning about unnecessary lambda? pylint: disable-msg=W0108 + + def test_default(self): + self.command.execute(MockOptions(suffixes='txt', missing=False, platform=None), ['passes/text.html'], self.tool) + self.assertEquals(self.lines, + ['passes/text-expected.txt:', + ' (generic): 123456', + ' test-mac-leopard: abcdef']) + + def test_missing_baselines(self): + self.command.execute(MockOptions(suffixes='png,txt', missing=True, platform=None), ['passes/text.html'], self.tool) + self.assertEquals(self.lines, + ['passes/text-expected.png: (no baselines found)', + 'passes/text-expected.txt:', + ' (generic): 123456', + ' test-mac-leopard: abcdef']) diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py index 817d92058..e57aff119 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py @@ -26,6 +26,8 @@ import BaseHTTPServer import logging import json import os +import sys +import urllib from webkitpy.common.memoized import memoized from webkitpy.tool.servers.reflectionhandler import ReflectionHandler @@ -54,10 +56,13 @@ class GardeningHTTPServer(BaseHTTPServer.HTTPServer): def __init__(self, httpd_port, config): server_name = '' self.tool = config['tool'] + self.options = config['options'] BaseHTTPServer.HTTPServer.__init__(self, (server_name, httpd_port), GardeningHTTPRequestHandler) - def url(self): - return 'file://' + os.path.join(GardeningHTTPRequestHandler.STATIC_FILE_DIRECTORY, 'garden-o-matic.html') + def url(self, args=None): + # We can't use urllib.encode() here because that encodes spaces as plus signs and the buildbots don't decode those properly. + arg_string = ('?' + '&'.join("%s=%s" % (key, urllib.quote(value)) for (key, value) in args.items())) if args else '' + return 'file://' + os.path.join(GardeningHTTPRequestHandler.STATIC_FILE_DIRECTORY, 'garden-o-matic.html' + arg_string) class GardeningHTTPRequestHandler(ReflectionHandler): @@ -75,6 +80,7 @@ class GardeningHTTPRequestHandler(ReflectionHandler): 'TestFailures') allow_cross_origin_requests = True + debug_output = '' def _run_webkit_patch(self, args): return self.server.tool.executive.run_command([self.server.tool.path()] + args, cwd=self.server.tool.scm().checkout_root) @@ -94,13 +100,45 @@ class GardeningHTTPRequestHandler(ReflectionHandler): def ping(self): self._serve_text('pong') + def _run_webkit_patch(self, command, input_string): + PIPE = self.server.tool.executive.PIPE + process = self.server.tool.executive.popen([self.server.tool.path()] + command, cwd=self.server.tool.scm().checkout_root, stdin=PIPE, stdout=PIPE, stderr=PIPE) + process.stdin.write(input_string) + output, error = process.communicate() + return (process.returncode, output, error) + def rebaselineall(self): command = ['rebaseline-json'] + if self.server.options.move_overwritten_baselines: + command.append('--move-overwritten-baselines') + if self.server.options.results_directory: + command.extend(['--results-directory', self.server.options.results_directory]) + if not self.server.options.optimize: + command.append('--no-optimize') + if self.server.options.verbose: + command.append('--verbose') json_input = self.read_entity_body() - _log.debug("rebaselining using '%s'" % json_input) - def error_handler(script_error): - _log.error("error from rebaseline-json: %s, input='%s', output='%s'" % (str(script_error), json_input, script_error.output)) + _log.debug("calling %s, input='%s'", command, json_input) + return_code, output, error = self._run_webkit_patch(command, json_input) + print >> sys.stderr, error + if return_code: + _log.error("rebaseline-json failed: %d, output='%s'" % (return_code, output)) + else: + _log.debug("rebaseline-json succeeded") - self.server.tool.executive.run_command([self.server.tool.path()] + command, input=json_input, cwd=self.server.tool.scm().checkout_root, return_stderr=True, error_handler=error_handler) + # FIXME: propagate error and/or log messages back to the UI. self._serve_text('success') + + def localresult(self): + path = self.query['path'][0] + filesystem = self.server.tool.filesystem + + # Ensure that we're only serving files from inside the results directory. + if not filesystem.isabs(path) and self.server.options.results_directory: + fullpath = filesystem.abspath(filesystem.join(self.server.options.results_directory, path)) + if fullpath.startswith(filesystem.abspath(self.server.options.results_directory)): + self._serve_file(fullpath, headers_only=(self.command == 'HEAD')) + return + + self._send_response(403) diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py index a2f3fabc8..9961648de 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py @@ -101,12 +101,12 @@ class GardeningServerTest(unittest.TestCase): handler.body = body OutputCapture().assert_outputs(self, handler.do_POST, expected_stderr=expected_stderr, expected_stdout=expected_stdout) - def test_rollout(self): + def disabled_test_rollout(self): expected_stderr = "MOCK run_command: ['echo', 'rollout', '--force-clean', '--non-interactive', '2314', 'MOCK rollout reason'], cwd=/mock-checkout\n" expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" self._post_to_path("/rollout?revision=2314&reason=MOCK+rollout+reason", expected_stderr=expected_stderr, expected_stdout=expected_stdout) - def test_rebaselineall(self): + def disabled_test_rebaselineall(self): expected_stderr = "MOCK run_command: ['echo', 'rebaseline-json'], cwd=/mock-checkout, input={\"user-scripts/another-test.html\":{\"%s\": [%s]}}\n" expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" server = MockServer() diff --git a/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py b/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py index 24bb2771a..930870961 100644 --- a/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py +++ b/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py @@ -59,6 +59,9 @@ class ReflectionHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): self._handle_request() + def do_HEAD(self): + self._handle_request() + def read_entity_body(self): length = int(self.headers.getheader('content-length')) return self.rfile.read(length) @@ -116,7 +119,7 @@ class ReflectionHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.end_headers() json.dump(json_object, self.wfile) - def _serve_file(self, file_path, cacheable_seconds=0): + def _serve_file(self, file_path, cacheable_seconds=0, headers_only=False): if not os.path.exists(file_path): self.send_error(404, "File not found") return @@ -136,4 +139,5 @@ class ReflectionHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.send_header("Expires", expires_formatted) self.end_headers() - shutil.copyfileobj(static_file, self.wfile) + if not headers_only: + shutil.copyfileobj(static_file, self.wfile) diff --git a/Tools/TestWebKitAPI/CMakeLists.txt b/Tools/TestWebKitAPI/CMakeLists.txt index c4e427e1d..163edc753 100644 --- a/Tools/TestWebKitAPI/CMakeLists.txt +++ b/Tools/TestWebKitAPI/CMakeLists.txt @@ -84,6 +84,7 @@ ADD_EXECUTABLE(test_wtf ${TESTWEBKITAPI_DIR}/Tests/WTF/Vector.cpp ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorBasic.cpp ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorReverse.cpp + ${TESTWEBKITAPI_DIR}/Tests/WTF/WTFString.cpp ) TARGET_LINK_LIBRARIES(test_wtf ${test_wtf_LIBRARIES}) diff --git a/Tools/TestWebKitAPI/Configurations/Base.xcconfig b/Tools/TestWebKitAPI/Configurations/Base.xcconfig index 412c440d9..1e029d4eb 100644 --- a/Tools/TestWebKitAPI/Configurations/Base.xcconfig +++ b/Tools/TestWebKitAPI/Configurations/Base.xcconfig @@ -21,8 +21,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "CompilerVersion.xcconfig" - +CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; +CLANG_CXX_LIBRARY = libc++; CLANG_WARN_CXX0X_EXTENSIONS = NO; HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu; FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks; @@ -34,6 +34,7 @@ GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_TREAT_WARNINGS_AS_ERRORS = YES +GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES @@ -41,12 +42,6 @@ WARNING_CFLAGS = -Wall -W -Wno-unused-parameter LINKER_DISPLAYS_MANGLED_NAMES = YES; VALID_ARCHS = i386 x86_64; -CLANG_CXX_LIBRARY = $(CLANG_CXX_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -CLANG_CXX_LIBRARY_1060 = libstdc++; -CLANG_CXX_LIBRARY_1070 = libc++; -CLANG_CXX_LIBRARY_1080 = libc++; -CLANG_CXX_LIBRARY_1090 = libc++; - // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants. // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant. DEBUG_DEFINES_debug = ; @@ -54,17 +49,10 @@ DEBUG_DEFINES_normal = NDEBUG; DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT)); -REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME)); -REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx); -REAL_PLATFORM_NAME_iphoneos = iphoneos; -REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator; -REAL_PLATFORM_NAME_macosx = macosx; - TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); TARGETING_SAME_OS_X_VERSION = $(TARGETING_SAME_OS_X_VERSION_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -TARGETING_SAME_OS_X_VERSION_1060_1060 = YES; TARGETING_SAME_OS_X_VERSION_1070_1070 = YES; TARGETING_SAME_OS_X_VERSION_1080_1080 = YES; TARGETING_SAME_OS_X_VERSION_1090_1090 = YES; diff --git a/Tools/TestWebKitAPI/Configurations/CompilerVersion.xcconfig b/Tools/TestWebKitAPI/Configurations/CompilerVersion.xcconfig deleted file mode 100644 index a8c7f75a0..000000000 --- a/Tools/TestWebKitAPI/Configurations/CompilerVersion.xcconfig +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -IS_XCODE_0400 = $(IS_XCODE_0400_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_0400 = YES; - -IS_XCODE_0400_OR_0410 = $(IS_XCODE_0400_OR_0410_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_OR_0410_0400 = YES; -IS_XCODE_0400_OR_0410_0410 = YES; - -// The version of the LLVM Compiler in Xcode 4.0 and earlier have difficulty compiling our code. -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_$(IS_XCODE_0400)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_YES = YES; - -// The version of the LLVM Compiler in Xcode 4.1 and earlier do not generate fast enough code. -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_$(IS_XCODE_0400_OR_0410)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_YES = YES; - -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_YES = NO; - -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_YES = NO; - - -// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0. -// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version -// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and -// XCODE_VERSION_ACTUAL for the full version number. -TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(REAL_PLATFORM_NAME)); -TARGET_GCC_VERSION_iphoneos = LLVM_GCC_42; -TARGET_GCC_VERSION_iphonesimulator = GCC_42; -TARGET_GCC_VERSION_macosx = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); - -TARGET_GCC_VERSION_macosx_1050 = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_MINOR)); -TARGET_GCC_VERSION_macosx_1050_ = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_ACTUAL)); -TARGET_GCC_VERSION_macosx_1050_0310 = GCC_42; -TARGET_GCC_VERSION_macosx_1050_0320 = GCC_42; - -TARGET_GCC_VERSION_macosx_1060 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1070 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Debug = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Release = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Production = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_NON_LLVM_FALLBACK = GCC_42; -TARGET_GCC_VERSION_macosx_1070_NON_LLVM_FALLBACK = LLVM_GCC_42; - -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_YES = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_NO = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)_NON_LLVM_FALLBACK); - -TARGET_GCC_VERSION_macosx_1080 = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_1090 = LLVM_COMPILER; - -GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); -GCC_VERSION_GCC_40 = 4.0; -GCC_VERSION_GCC_42 = 4.2; -GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; -GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0; diff --git a/Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig b/Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig index 54ad20d82..f681015b8 100644 --- a/Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig +++ b/Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig @@ -23,18 +23,11 @@ #include "Base.xcconfig" -ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ARCHS_1050 = $(NATIVE_ARCH); -ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1080 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1090 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS = $(ARCHS_STANDARD_32_64_BIT); ONLY_ACTIVE_ARCH = YES; MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) -MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; -MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; MACOSX_DEPLOYMENT_TARGET_1080 = 10.8; MACOSX_DEPLOYMENT_TARGET_1090 = 10.9; diff --git a/Tools/TestWebKitAPI/GNUmakefile.am b/Tools/TestWebKitAPI/GNUmakefile.am index d294d0629..759ccb9e0 100644 --- a/Tools/TestWebKitAPI/GNUmakefile.am +++ b/Tools/TestWebKitAPI/GNUmakefile.am @@ -24,7 +24,6 @@ Libraries_libTestWebKitAPIMain_la_CPPFLAGS = \ -I$(top_builddir)/DerivedSources/WebKit2/include \ $(global_cppflags) \ $(javascriptcore_cppflags) \ - $(GLIB_CFLAGS) \ $(GTK_CFLAGS) noinst_PROGRAMS += \ @@ -33,17 +32,14 @@ noinst_PROGRAMS += \ Programs_TestWebKitAPI_TestWTF_CPPFLAGS = \ $(Libraries_libTestWebKitAPIMain_la_CPPFLAGS) \ $(GLIB_LIBS) \ - $(CAIRO_CFLAGS) \ - $(LIBSOUP_CFLAGS) + $(CAIRO_CFLAGS) Programs_TestWebKitAPI_TestWTF_LDADD = \ Libraries/libTestWebKitAPIMain.la \ Libraries/libgtest.la \ libWTF.la \ - $(CAIRO_LIBS) \ - $(GLIB_LIBS) \ $(GTK_LIBS) \ - $(LIBSOUP_LIBS) + $(GLIB_LIBS) Programs_TestWebKitAPI_TestWTF_LDFLAGS = \ -no-install \ @@ -77,13 +73,18 @@ Programs_TestWebKitAPI_TestGtk_CPPFLAGS = \ $(Programs_TestWebKitAPI_TestWTF_CPPFLAGS) \ $(webcore_cppflags) \ $(webcoregtk_cppflags) \ - $(CAIRO_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GTK_CFLAGS) \ $(LIBSOUP_CFLAGS) Programs_TestWebKitAPI_TestGtk_LDADD = \ - $(Programs_TestWebKitAPI_TestWTF_LDADD) \ + Libraries/libTestWebKitAPIMain.la \ + Libraries/libgtest.la \ libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ - libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la + libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ + $(GLIB_LIBS) \ + $(GTK_LIBS) \ + $(LIBSOUP_LIBS) Programs_TestWebKitAPI_TestGtk_LDFLAGS = \ $(Programs_TestWebKitAPI_TestWTF_LDFLAGS) @@ -102,12 +103,19 @@ noinst_PROGRAMS += \ Programs_TestWebKitAPI_TestWebKit2_CPPFLAGS = \ $(Programs_TestWebKitAPI_TestWTF_CPPFLAGS) \ - -I$(top_builddir)/DerivedSources/WebKit2/include + -I$(top_builddir)/DerivedSources/WebKit2/include \ + $(GLIB_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBSOUP_CFLAGS) Programs_TestWebKitAPI_TestWebKit2_LDADD = \ - $(Programs_TestWebKitAPI_TestWTF_LDADD) \ + Libraries/libTestWebKitAPIMain.la \ + Libraries/libgtest.la \ libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ - libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la + libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ + $(GLIB_LIBS) \ + $(GTK_LIBS) \ + $(LIBSOUP_LIBS) Programs_TestWebKitAPI_TestWebKit2_LDFLAGS = \ $(Programs_TestWebKitAPI_TestWTF_LDFLAGS) diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj index 973a6d0fa..dc256b47d 100644 --- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj +++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj @@ -183,6 +183,7 @@ F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */; }; F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */; }; F6FDDDD614241C6F004F1729 /* push-state.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F6FDDDD514241C48004F1729 /* push-state.html */; }; + FE217ECD1640A54A0052988B /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE217ECC1640A54A0052988B /* VMInspector.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -395,7 +396,6 @@ BCBD372E125ABBE600D2C29F /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; }; BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameMIMETypePNG.cpp; sourceTree = "<group>"; }; BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FailedLoad.cpp; sourceTree = "<group>"; }; - BCF0F9391381C25B008361AC /* CompilerVersion.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CompilerVersion.xcconfig; sourceTree = "<group>"; }; C01363C713C3997300EF3964 /* StringOperators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringOperators.cpp; path = WTF/StringOperators.cpp; sourceTree = "<group>"; }; C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpacebarScrolling.cpp; sourceTree = "<group>"; }; C02B7853126613AE0026BF0F /* Carbon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Carbon.framework; sourceTree = SDKROOT; }; @@ -439,6 +439,7 @@ F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionNoCache.cpp; sourceTree = "<group>"; }; F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrivateBrowsingPushStateNoHistoryCallback.cpp; sourceTree = "<group>"; }; F6FDDDD514241C48004F1729 /* push-state.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "push-state.html"; sourceTree = "<group>"; }; + FE217ECC1640A54A0052988B /* VMInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMInspector.cpp; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -563,7 +564,6 @@ isa = PBXGroup; children = ( BC90957E12554CF900083756 /* Base.xcconfig */, - BCF0F9391381C25B008361AC /* CompilerVersion.xcconfig */, BC90957F12554CF900083756 /* DebugRelease.xcconfig */, BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */, BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */, @@ -720,6 +720,7 @@ BCB9EB66112366D800A137E0 /* Tests */ = { isa = PBXGroup; children = ( + FE217ECB1640A54A0052988B /* JavaScriptCore */, C08587F913FEC39B001EF4E5 /* TestWebKitAPI */, C07E6CAD13FD67650038B22B /* mac */, 440A1D3614A01000008A66F2 /* WebCore */, @@ -818,6 +819,14 @@ path = mac; sourceTree = "<group>"; }; + FE217ECB1640A54A0052988B /* JavaScriptCore */ = { + isa = PBXGroup; + children = ( + FE217ECC1640A54A0052988B /* VMInspector.cpp */, + ); + path = JavaScriptCore; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1006,6 +1015,7 @@ 2943BE86161DFEB800999E3D /* UserContentTest.mm in Sources */, 4F4D2C0E1626FE2700320FE1 /* MemoryInstrumentationTest.cpp in Sources */, 378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */, + FE217ECD1640A54A0052988B /* VMInspector.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tools/TestWebKitAPI/Tests/JavaScriptCore/VMInspector.cpp b/Tools/TestWebKitAPI/Tests/JavaScriptCore/VMInspector.cpp new file mode 100644 index 000000000..b1c1bacf3 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/JavaScriptCore/VMInspector.cpp @@ -0,0 +1,689 @@ +/* + * Copyright (C) 2012 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include <interpreter/VMInspector.h> +#include <stdarg.h> +#include <stdio.h> + +using namespace JSC; + +// There's not much we can test for the VMInspector::printf() case except to +// make sure it does not crash. Unfortunately, we also don't want all the +// test strings crowding out stdout. So, we forego the printf tests. +// NOTE that the most interesting part of VMInspector::printf() is the +// formatting functionality, and it is are already being tested by the +// fprintf() and sprintf() cases. + + +// The VMInspector::fprintf() test works by printing the string to a temp file, +// and then reading the file content back into a buffer, which we, in turn, +// compare against the expected string. + +TEST(JSC, VMInspectorFprintf) +{ +#if ENABLE(VMINSPECTOR) + char actual[1024]; + char expected[1024]; + const char* format; + const char* expectedLiteral; + FILE* file; + const char* filename = "/tmp/VMInspectorFprintfTest.txt"; + size_t size; + +#define OPEN_FILE(file) \ + do { \ + file = fopen(filename, "w"); \ + } while (false) + +#define READ_AND_CLOSE_FILE(file, actual) \ + do { \ + fclose(file); \ + file = fopen(filename, "r"); \ + fseek(file, 0, SEEK_END); \ + size = ftell(file); \ + rewind(file); \ + fread(actual, 1, size, file); \ + actual[size] = '\0'; \ + fclose(file); \ + } while (false) + + // Testing standard default format specifiers: + // Note: should work just like sprintf. So, we just compare against that. + memset(actual, 'z', sizeof(actual)); + // The compiler warning flags are configured to expect a literal string for + // ::sprintf below. So, use a #define for this one case to keep the + // compiler happy. +#undef LITERAL_FORMAT +#define LITERAL_FORMAT "'%%%%' ==> '%%'\n" + + OPEN_FILE(file); + VMInspector::fprintf(file, LITERAL_FORMAT); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, LITERAL_FORMAT); + +#undef LITERAL_FORMAT + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%c', 'x' ==> '%c'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 'x'); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 'x'); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*c', 8, 'x' ==> '%*c'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 8, 'x'); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 8, 'x'); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%s', \"hello world\" ==> '%s'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, "hello world"); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, "hello world"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*s', 8, \"hello world\" ==> '%*s'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 8, "hello world"); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 8, "hello world"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*s', 8, \"hello\" ==> '%*s'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 8, "hello"); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 8, "hello"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%d', 987654321 ==> '%d'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 987654321); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 987654321); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%u', 4276543210u ==> '%u'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 4276543210u); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 4276543210u); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%u', 0xffffffff ==> '%u'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 0xffffffff); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 0xffffffff); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%x', 0xffffffff ==> '%x'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 0xffffffff); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 0xffffffff); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%p', (void*)0xabcdbabe ==> '%p'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, (void*)0xabcdbabe); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, (void*)0xabcdbabe); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%lu', 1234567890987654321ul ==> '%lu'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 1234567890987654321ul); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 1234567890987654321ul); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%f', 1234.567 ==> '%f'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 1234.567); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%.2f', 1234.567 ==> '%.2f'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 1234.567); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%10.2f', 1234.567 ==> '%10.2f'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 1234.567); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%010.2f', 1234.567 ==> '%010.2f'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 1234.567); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + // Bad / weird formats: + memset(actual, 'z', sizeof(actual)); + format = "'%%5.4', 987654321 ==> '%5.4'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 987654321); + READ_AND_CLOSE_FILE(file, actual); + expectedLiteral = "'%5.4', 987654321 ==> 'ERROR @ \"%5.4' \"\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%5.4' '%%d', 987654321, 4 ==> '%5.4' '%d'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 987654321, 4); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 987654321, 4); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%w' '%%d', 987654321, 6 ==> '%w' '%d'\n"; + OPEN_FILE(file); + VMInspector::fprintf(file, format, 987654321, 6); + READ_AND_CLOSE_FILE(file, actual); + ::sprintf(expected, format, 987654321, 6); + ASSERT_EQ(strcmp(actual, expected), 0); + + + // Testing the %b extension: + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%b', 0 ==> '%b'\n", 0); + READ_AND_CLOSE_FILE(file, actual); + ASSERT_EQ(strcmp(actual, "'%b', 0 ==> 'FALSE'\n"), 0); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%b', 1 ==> '%b'\n", 1); + READ_AND_CLOSE_FILE(file, actual); + ASSERT_EQ(strcmp(actual, "'%b', 1 ==> 'TRUE'\n"), 0); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%b', -123456789 ==> '%b'\n", -123456789); + READ_AND_CLOSE_FILE(file, actual); + ASSERT_EQ(strcmp(actual, "'%b', -123456789 ==> 'TRUE'\n"), 0); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%b', 123456789 ==> '%b'\n", 123456789); + READ_AND_CLOSE_FILE(file, actual); + ASSERT_EQ(strcmp(actual, "'%b', 123456789 ==> 'TRUE'\n"), 0); + + + // Testing the %J<x> extensions: + String str1("Test WTF String"); + String str2(""); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%Js' is %%s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%Js' is %s\n", + &str1, str1.isEmpty() ? "EMPTY" : "NOT EMPTY"); + READ_AND_CLOSE_FILE(file, actual); + expectedLiteral = "'%Js' is %s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'Test WTF String' is NOT EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%Js' is %%s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%Js' is %s\n", + &str2, str2.isEmpty() ? "EMPTY" : "NOT EMPTY"); + READ_AND_CLOSE_FILE(file, actual); + expectedLiteral = "'%Js' is %s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '' is EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%J+s' is %%s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%J+s' is %s\n", + &str1, str1.isEmpty() ? "EMPTY" : "NOT EMPTY"); + READ_AND_CLOSE_FILE(file, actual); + expectedLiteral = "'%J+s' is %s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'WTF::String \"Test WTF String\"' is NOT EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + OPEN_FILE(file); + VMInspector::fprintf(file, "'%%J+s' is %%s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%J+s' is %s\n", + &str2, str2.isEmpty() ? "EMPTY" : "NOT EMPTY"); + READ_AND_CLOSE_FILE(file, actual); + expectedLiteral = "'%J+s' is %s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'WTF::String \"\"' is EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + +#undef OPEN_FILE +#undef READ_AND_CLOSE_FILE + +#endif +} + + +TEST(JSC, VMInspectorSprintf) +{ +#if ENABLE(VMINSPECTOR) + char actual[1024]; + char expected[1024]; + const char* format; + const char* expectedLiteral; + + // Testing standard default format specifiers: + // Note: should work just like sprintf. So, we just compare against that. + memset(actual, 'z', sizeof(actual)); + // The compiler warning flags are configured to expect a literal string for + // ::sprintf below. So, use a #define for this one case to keep the + // compiler happy. +#undef LITERAL_FORMAT +#define LITERAL_FORMAT "'%%%%' ==> '%%'\n" + VMInspector::sprintf(actual, LITERAL_FORMAT); + ::sprintf(expected, LITERAL_FORMAT); +#undef LITERAL_FORMAT + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%c', 'x' ==> '%c'\n"; + VMInspector::sprintf(actual, format, 'x'); + ::sprintf(expected, format, 'x'); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*c', 8, 'x' ==> '%*c'\n"; + VMInspector::sprintf(actual, format, 8, 'x'); + ::sprintf(expected, format, 8, 'x'); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%s', \"hello world\" ==> '%s'\n"; + VMInspector::sprintf(actual, format, "hello world"); + ::sprintf(expected, format, "hello world"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*s', 8, \"hello world\" ==> '%*s'\n"; + VMInspector::sprintf(actual, format, 8, "hello world"); + ::sprintf(expected, format, 8, "hello world"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*s', 8, \"hello\" ==> '%*s'\n"; + VMInspector::sprintf(actual, format, 8, "hello"); + ::sprintf(expected, format, 8, "hello"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%d', 987654321 ==> '%d'\n"; + VMInspector::sprintf(actual, format, 987654321); + ::sprintf(expected, format, 987654321); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%u', 4276543210u ==> '%u'\n"; + VMInspector::sprintf(actual, format, 4276543210u); + ::sprintf(expected, format, 4276543210u); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%u', 0xffffffff ==> '%u'\n"; + VMInspector::sprintf(actual, format, 0xffffffff); + ::sprintf(expected, format, 0xffffffff); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%x', 0xffffffff ==> '%x'\n"; + VMInspector::sprintf(actual, format, 0xffffffff); + ::sprintf(expected, format, 0xffffffff); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%p', (void*)0xabcdbabe ==> '%p'\n"; + VMInspector::sprintf(actual, format, (void*)0xabcdbabe); + ::sprintf(expected, format, (void*)0xabcdbabe); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%lu', 1234567890987654321ul ==> '%lu'\n"; + VMInspector::sprintf(actual, format, 1234567890987654321ul); + ::sprintf(expected, format, 1234567890987654321ul); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%f', 1234.567 ==> '%f'\n"; + VMInspector::sprintf(actual, format, 1234.567); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%.2f', 1234.567 ==> '%.2f'\n"; + VMInspector::sprintf(actual, format, 1234.567); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%10.2f', 1234.567 ==> '%10.2f'\n"; + VMInspector::sprintf(actual, format, 1234.567); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%010.2f', 1234.567 ==> '%010.2f'\n"; + VMInspector::sprintf(actual, format, 1234.567); + ::sprintf(expected, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + // Bad / weird formats: + memset(actual, 'z', sizeof(actual)); + format = "'%%5.4', 987654321 ==> '%5.4'\n"; + VMInspector::sprintf(actual, format, 987654321); + expectedLiteral = "'%5.4', 987654321 ==> 'ERROR @ \"%5.4' \"\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%5.4' '%%d', 987654321, 4 ==> '%5.4' '%d'\n"; + VMInspector::sprintf(actual, format, 987654321, 4); + ::sprintf(expected, format, 987654321, 4); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%w' '%%d', 987654321, 6 ==> '%w' '%d'\n"; + VMInspector::sprintf(actual, format, 987654321, 6); + ::sprintf(expected, format, 987654321, 6); + ASSERT_EQ(strcmp(actual, expected), 0); + + + // Testing the %b extension: + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%b', 0 ==> '%b'\n", 0); + ASSERT_EQ(strcmp(actual, "'%b', 0 ==> 'FALSE'\n"), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%b', 1 ==> '%b'\n", 1); + ASSERT_EQ(strcmp(actual, "'%b', 1 ==> 'TRUE'\n"), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%b', -123456789 ==> '%b'\n", -123456789); + ASSERT_EQ(strcmp(actual, "'%b', -123456789 ==> 'TRUE'\n"), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%b', 123456789 ==> '%b'\n", 123456789); + ASSERT_EQ(strcmp(actual, "'%b', 123456789 ==> 'TRUE'\n"), 0); + + + // Testing the %J<x> extensions: + String str1("Test WTF String"); + String str2(""); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%Js' is %%s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%Js' is %s\n", + &str1, str1.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%Js' is %s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'Test WTF String' is NOT EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%Js' is %%s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%Js' is %s\n", + &str2, str2.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%Js' is %s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '' is EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%J+s' is %%s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%J+s' is %s\n", + &str1, str1.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%J+s' is %s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'WTF::String \"Test WTF String\"' is NOT EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::sprintf(actual, "'%%J+s' is %%s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%J+s' is %s\n", + &str2, str2.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%J+s' is %s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'WTF::String \"\"' is EMPTY\n"; + ASSERT_EQ(strcmp(actual, expectedLiteral), 0); +#endif +} + + +TEST(JSC, VMInspectorSnprintf) +{ +#if ENABLE(VMINSPECTOR) + char actual[1024]; + char expected[1024]; + const char* format; + const char* expectedLiteral; + + size_t size = 1; + while (size <= 100) { + + // Testing standard default format specifiers: + // Note: should work just like snprintf. So, we just compare against that. + memset(actual, 'z', sizeof(actual)); + // The compiler warning flags are configured to expect a literal string for + // ::snprintf below. So, use a #define for this one case to keep the + // compiler happy. +#undef LITERAL_FORMAT +#define LITERAL_FORMAT "'%%%%' ==> '%%'\n" + VMInspector::snprintf(actual, size, LITERAL_FORMAT); + ::snprintf(expected, size, LITERAL_FORMAT); +#undef LITERAL_FORMAT + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%c', 'x' ==> '%c'\n"; + VMInspector::snprintf(actual, size, format, 'x'); + ::snprintf(expected, size, format, 'x'); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*c', 8, 'x' ==> '%*c'\n"; + VMInspector::snprintf(actual, size, format, 8, 'x'); + ::snprintf(expected, size, format, 8, 'x'); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%s', \"hello world\" ==> '%s'\n"; + VMInspector::snprintf(actual, size, format, "hello world"); + ::snprintf(expected, size, format, "hello world"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*s', 8, \"hello world\" ==> '%*s'\n"; + VMInspector::snprintf(actual, size, format, 8, "hello world"); + ::snprintf(expected, size, format, 8, "hello world"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%*s', 8, \"hello\" ==> '%*s'\n"; + VMInspector::snprintf(actual, size, format, 8, "hello"); + ::snprintf(expected, size, format, 8, "hello"); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%d', 987654321 ==> '%d'\n"; + VMInspector::snprintf(actual, size, format, 987654321); + ::snprintf(expected, size, format, 987654321); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%u', 4276543210u ==> '%u'\n"; + VMInspector::snprintf(actual, size, format, 4276543210u); + ::snprintf(expected, size, format, 4276543210u); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%u', 0xffffffff ==> '%u'\n"; + VMInspector::snprintf(actual, size, format, 0xffffffff); + ::snprintf(expected, size, format, 0xffffffff); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%x', 0xffffffff ==> '%x'\n"; + VMInspector::snprintf(actual, size, format, 0xffffffff); + ::snprintf(expected, size, format, 0xffffffff); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%p', (void*)0xabcdbabe ==> '%p'\n"; + VMInspector::snprintf(actual, size, format, (void*)0xabcdbabe); + ::snprintf(expected, size, format, (void*)0xabcdbabe); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%lu', 1234567890987654321ul ==> '%lu'\n"; + VMInspector::snprintf(actual, size, format, 1234567890987654321ul); + ::snprintf(expected, size, format, 1234567890987654321ul); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%f', 1234.567 ==> '%f'\n"; + VMInspector::snprintf(actual, size, format, 1234.567); + ::snprintf(expected, size, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%.2f', 1234.567 ==> '%.2f'\n"; + VMInspector::snprintf(actual, size, format, 1234.567); + ::snprintf(expected, size, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%10.2f', 1234.567 ==> '%10.2f'\n"; + VMInspector::snprintf(actual, size, format, 1234.567); + ::snprintf(expected, size, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%010.2f', 1234.567 ==> '%010.2f'\n"; + VMInspector::snprintf(actual, size, format, 1234.567); + ::snprintf(expected, size, format, 1234.567); + ASSERT_EQ(strcmp(actual, expected), 0); + + // Bad / weird formats: + memset(actual, 'z', sizeof(actual)); + format = "'%%5.4', 987654321 ==> '%5.4'\n"; + VMInspector::snprintf(actual, size, format, 987654321); + expectedLiteral = "'%5.4', 987654321 ==> 'ERROR @ \"%5.4' \"\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%5.4' '%%d', 987654321, 4 ==> '%5.4' '%d'\n"; + VMInspector::snprintf(actual, size, format, 987654321, 4); + ::snprintf(expected, size, format, 987654321, 4); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + format = "'%%w' '%%d', 987654321, 6 ==> '%w' '%d'\n"; + VMInspector::snprintf(actual, size, format, 987654321, 6); + ::snprintf(expected, size, format, 987654321, 6); + ASSERT_EQ(strcmp(actual, expected), 0); + + + // Testing the %b extension: + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%b', 0 ==> '%b'\n", 0); + expectedLiteral = "'%b', 0 ==> 'FALSE'\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%b', 1 ==> '%b'\n", 1); + expectedLiteral = "'%b', 1 ==> 'TRUE'\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%b', -123456789 ==> '%b'\n", -123456789); + expectedLiteral = "'%b', -123456789 ==> 'TRUE'\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%b', 123456789 ==> '%b'\n", 123456789); + expectedLiteral = "'%b', 123456789 ==> 'TRUE'\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + // Testing the %J<x> extensions: + String str1("Test WTF String"); + String str2(""); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%Js' is %%s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%Js' is %s\n", + &str1, str1.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%Js' is %s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'Test WTF String' is NOT EMPTY\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%Js' is %%s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%Js' is %s\n", + &str2, str2.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%Js' is %s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '' is EMPTY\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%J+s' is %%s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%J+s' is %s\n", + &str1, str1.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%J+s' is %s, &str1, str1.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'WTF::String \"Test WTF String\"' is NOT EMPTY\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + memset(actual, 'z', sizeof(actual)); + VMInspector::snprintf(actual, size, "'%%J+s' is %%s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> '%J+s' is %s\n", + &str2, str2.isEmpty() ? "EMPTY" : "NOT EMPTY"); + expectedLiteral = "'%J+s' is %s, &str2, str2.isEmpty()?\"EMPTY\":\"NOT EMPTY\" ==> 'WTF::String \"\"' is EMPTY\n"; + ::snprintf(expected, size, "%s", expectedLiteral); + ASSERT_EQ(strcmp(actual, expected), 0); + + // Test lower sizes more densely, and then space out to larger sizes. + // We're doing this because the lower sizes might be interesting, but + // for expediency, we don't want to test at this fine grain resolution + // for all possible sizes. Hence, we accelerate the rate once we're + // pass the interesting small sizes. + if (size <= 5) + size++; + else + size += 4; + } +#endif +} diff --git a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp index 9a998da03..1ac26a0be 100644 --- a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp +++ b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp @@ -36,11 +36,13 @@ #include <wtf/HashCountedSet.h> #include <wtf/HashMap.h> #include <wtf/HashSet.h> +#include <wtf/ListHashSet.h> #include <wtf/MemoryInstrumentation.h> #include <wtf/MemoryInstrumentationArrayBufferView.h> #include <wtf/MemoryInstrumentationHashCountedSet.h> #include <wtf/MemoryInstrumentationHashMap.h> #include <wtf/MemoryInstrumentationHashSet.h> +#include <wtf/MemoryInstrumentationListHashSet.h> #include <wtf/MemoryInstrumentationString.h> #include <wtf/MemoryInstrumentationVector.h> #include <wtf/RefCounted.h> @@ -79,57 +81,65 @@ using WTF::MemoryObjectType; MemoryObjectType TestType = "TestType"; -class InstrumentationTestHelper : public WTF::MemoryInstrumentation { +class MemoryInstrumentationTestClient : public WTF::MemoryInstrumentationClient { public: - InstrumentationTestHelper() - : MemoryInstrumentation(&m_client) - { } + virtual void countObjectSize(const void*, MemoryObjectType objectType, size_t size) + { + TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size); + if (!result.isNewEntry) + result.iterator->value += size; + } + virtual bool visited(const void* object) { return !m_visitedObjects.add(object).isNewEntry; } + virtual void checkCountedObject(const void*) { } + + size_t visitedObjects() const { return m_visitedObjects.size(); } + size_t totalSize(const MemoryObjectType objectType) const + { + TypeToSizeMap::const_iterator i = m_totalSizes.find(objectType); + return i == m_totalSizes.end() ? 0 : i->value; + } + + size_t reportedSizeForAllTypes() const + { + size_t size = 0; + for (TypeToSizeMap::const_iterator i = m_totalSizes.begin(); i != m_totalSizes.end(); ++i) + size += i->value; + return size; + } + +private: + typedef HashMap<MemoryObjectType, size_t> TypeToSizeMap; + TypeToSizeMap m_totalSizes; + WTF::HashSet<const void*> m_visitedObjects; +}; + +class InstrumentationTestImpl : public WTF::MemoryInstrumentation { +public: + explicit InstrumentationTestImpl(MemoryInstrumentationTestClient* client) + : MemoryInstrumentation(client) + , m_client(client) { } virtual void processDeferredInstrumentedPointers(); virtual void deferInstrumentedPointer(PassOwnPtr<InstrumentedPointerBase>); - size_t visitedObjects() const { return m_client.visitedObjects(); } - size_t reportedSizeForAllTypes() const { return m_client.reportedSizeForAllTypes(); } - size_t totalSize(const MemoryObjectType objectType) const { return m_client.totalSize(objectType); } + size_t visitedObjects() const { return m_client->visitedObjects(); } + size_t reportedSizeForAllTypes() const { return m_client->reportedSizeForAllTypes(); } + size_t totalSize(const MemoryObjectType objectType) const { return m_client->totalSize(objectType); } private: - class Client : public WTF::MemoryInstrumentationClient { - public: - virtual void countObjectSize(const void*, MemoryObjectType objectType, size_t size) - { - TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size); - if (!result.isNewEntry) - result.iterator->value += size; - } - virtual bool visited(const void* object) { return !m_visitedObjects.add(object).isNewEntry; } - virtual void checkCountedObject(const void*) { } - - size_t visitedObjects() const { return m_visitedObjects.size(); } - size_t totalSize(const MemoryObjectType objectType) const - { - TypeToSizeMap::const_iterator i = m_totalSizes.find(objectType); - return i == m_totalSizes.end() ? 0 : i->value; - } - - size_t reportedSizeForAllTypes() const - { - size_t size = 0; - for (TypeToSizeMap::const_iterator i = m_totalSizes.begin(); i != m_totalSizes.end(); ++i) - size += i->value; - return size; - } - - private: - typedef HashMap<MemoryObjectType, size_t> TypeToSizeMap; - TypeToSizeMap m_totalSizes; - WTF::HashSet<const void*> m_visitedObjects; - }; - - Client m_client; + MemoryInstrumentationTestClient* m_client; Vector<OwnPtr<InstrumentedPointerBase> > m_deferredInstrumentedPointers; }; -void InstrumentationTestHelper::processDeferredInstrumentedPointers() +class InstrumentationTestHelper : public InstrumentationTestImpl { +public: + InstrumentationTestHelper() : InstrumentationTestImpl(&m_client) { } + +private: + MemoryInstrumentationTestClient m_client; +}; + +void InstrumentationTestImpl::processDeferredInstrumentedPointers() { while (!m_deferredInstrumentedPointers.isEmpty()) { OwnPtr<InstrumentedPointerBase> pointer = m_deferredInstrumentedPointers.last().release(); @@ -138,7 +148,7 @@ void InstrumentationTestHelper::processDeferredInstrumentedPointers() } } -void InstrumentationTestHelper::deferInstrumentedPointer(PassOwnPtr<InstrumentedPointerBase> pointer) +void InstrumentationTestImpl::deferInstrumentedPointer(PassOwnPtr<InstrumentedPointerBase> pointer) { m_deferredInstrumentedPointers.append(pointer); } @@ -648,6 +658,43 @@ TEST(MemoryInstrumentationTest, hashMapWithInstrumentedPointerKeysAndPointerValu EXPECT_EQ(2u * 2u * count + 1, helper.visitedObjects()); } +TEST(MemoryInstrumentationTest, listHashSetWithInstrumentedType) +{ + InstrumentationTestHelper helper; + + typedef ListHashSet<String, 8> TestSet; + OwnPtr<TestSet> value = adoptPtr(new TestSet()); + size_t count = 10; + for (size_t i = 0; i < count; ++i) + value->add(String::number(i)); + InstrumentedOwner<TestSet* > root(value.get()); + helper.addRootObject(root); + EXPECT_EQ(sizeof(TestSet) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 1 * sizeof(LChar)) * count + + sizeof(WTF::ListHashSetNodeAllocator<String, 8>) + sizeof(WTF::ListHashSetNode<String, 8>) * (count - 8), + helper.reportedSizeForAllTypes()); + EXPECT_EQ(1 + count, helper.visitedObjects()); +} + +TEST(MemoryInstrumentationTest, listHashSetWithInstrumentedTypeAfterValuesRemoval) +{ + InstrumentationTestHelper helper; + + typedef ListHashSet<String, 8> TestSet; + OwnPtr<TestSet> value = adoptPtr(new TestSet()); + size_t count = 20; + for (size_t i = 0; i < count; ++i) + value->add(String::number(i)); + // Remove 10 values, 8 of which were allocated in the internal buffer. + for (size_t i = 0; i < 10; ++i) + value->remove(String::number(i)); + InstrumentedOwner<TestSet* > root(value.get()); + helper.addRootObject(root); + EXPECT_EQ(sizeof(TestSet) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 2 * sizeof(LChar)) * (count - 10) + + sizeof(WTF::ListHashSetNodeAllocator<String, 8>) + sizeof(WTF::ListHashSetNode<String, 8>) * (count - 10), + helper.reportedSizeForAllTypes()); + EXPECT_EQ(1 + (count - 10), helper.visitedObjects()); +} + class InstrumentedConvertibleToInt { public: InstrumentedConvertibleToInt() : m_notInstrumented(0) { } @@ -750,7 +797,6 @@ public: } }; - TEST(MemoryInstrumentationTest, instrumentedWithMultipleAncestors) { InstrumentationTestHelper helper; @@ -760,11 +806,43 @@ TEST(MemoryInstrumentationTest, instrumentedWithMultipleAncestors) Instrumented* ancestorPointer = descendantPointer; InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer); EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer)); + helper.addRootObject(descendantPointerOwner); helper.addRootObject(ancestorPointerOwner); EXPECT_EQ(sizeof(ClassWithTwoAncestors), helper.reportedSizeForAllTypes()); EXPECT_EQ(2u, helper.visitedObjects()); } +class CheckCountedObjectsClient : public MemoryInstrumentationTestClient { +public: + CheckCountedObjectsClient(const void* expectedPointer) : m_expectedPointer(expectedPointer), m_expectedPointerFound(false) { } + virtual void checkCountedObject(const void* pointer) + { + EXPECT_EQ(pointer, m_expectedPointer); + m_expectedPointerFound = true; + } + bool expectedPointerFound() { return m_expectedPointerFound; } + +private: + const void* m_expectedPointer; + bool m_expectedPointerFound; +}; + +TEST(MemoryInstrumentationTest, checkCountedObjectWithMultipleAncestors) +{ + OwnPtr<ClassWithTwoAncestors> instance = adoptPtr(new ClassWithTwoAncestors()); + ClassWithTwoAncestors* descendantPointer = instance.get(); + InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer); + Instrumented* ancestorPointer = descendantPointer; + InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer); + EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer)); + + CheckCountedObjectsClient client(instance.get()); + InstrumentationTestImpl instrumentation(&client); + instrumentation.addRootObject(descendantPointerOwner); + instrumentation.addRootObject(ancestorPointerOwner); + EXPECT_TRUE(client.expectedPointerFound()); +} + } // namespace diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp index 213a655aa..35d64844c 100644 --- a/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp +++ b/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp @@ -26,6 +26,7 @@ #include "config.h" #include <wtf/text/StringImpl.h> +#include <wtf/text/WTFString.h> namespace TestWebKitAPI { @@ -68,4 +69,48 @@ TEST(WTF, StringImplFromLiteralLoop16BitConversion) } } +TEST(WTF, StringImplReplaceWithLiteral) +{ + RefPtr<StringImpl> testStringImpl = StringImpl::createFromLiteral("1224"); + ASSERT_TRUE(testStringImpl->is8Bit()); + + // Cases for 8Bit source. + testStringImpl = testStringImpl->replace('2', "", 0); + ASSERT_TRUE(equal(testStringImpl.get(), "14")); + + testStringImpl = StringImpl::createFromLiteral("1224"); + ASSERT_TRUE(testStringImpl->is8Bit()); + + testStringImpl = testStringImpl->replace('3', "NotFound", 8); + ASSERT_TRUE(equal(testStringImpl.get(), "1224")); + + testStringImpl = testStringImpl->replace('2', "3", 1); + ASSERT_TRUE(equal(testStringImpl.get(), "1334")); + + testStringImpl = StringImpl::createFromLiteral("1224"); + ASSERT_TRUE(testStringImpl->is8Bit()); + testStringImpl = testStringImpl->replace('2', "555", 3); + ASSERT_TRUE(equal(testStringImpl.get(), "15555554")); + + // Cases for 16Bit source. + String testString = String::fromUTF8("résumé"); + ASSERT_FALSE(testString.impl()->is8Bit()); + + testStringImpl = testString.impl()->replace('2', "NotFound", 8); + ASSERT_TRUE(equal(testStringImpl.get(), String::fromUTF8("résumé").impl())); + + testStringImpl = testString.impl()->replace(UChar(0x00E9 /*U+00E9 is 'é'*/), "e", 1); + ASSERT_TRUE(equal(testStringImpl.get(), "resume")); + + testString = String::fromUTF8("résumé"); + ASSERT_FALSE(testString.impl()->is8Bit()); + testStringImpl = testString.impl()->replace(UChar(0x00E9 /*U+00E9 is 'é'*/), "", 0); + ASSERT_TRUE(equal(testStringImpl.get(), "rsum")); + + testString = String::fromUTF8("résumé"); + ASSERT_FALSE(testString.impl()->is8Bit()); + testStringImpl = testString.impl()->replace(UChar(0x00E9 /*U+00E9 is 'é'*/), "555", 3); + ASSERT_TRUE(equal(testStringImpl.get(), "r555sum555")); +} + } // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp b/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp index 155772f48..4a92cd4e8 100644 --- a/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp +++ b/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp @@ -115,7 +115,45 @@ TEST(WTF, StringNumberToStringECMAScriptRegularNumbers) testNumberToStringECMAScript(phi, "1.618033988749895"); } - +TEST(WTF, StringReplaceWithLiteral) +{ + // Cases for 8Bit source. + String testString = "1224"; + ASSERT_TRUE(testString.is8Bit()); + testString.replaceWithLiteral('2', ""); + ASSERT_STREQ("14", testString.utf8().data()); + + testString = "1224"; + ASSERT_TRUE(testString.is8Bit()); + testString.replaceWithLiteral('2', "3"); + ASSERT_STREQ("1334", testString.utf8().data()); + + testString = "1224"; + ASSERT_TRUE(testString.is8Bit()); + testString.replaceWithLiteral('2', "555"); + ASSERT_STREQ("15555554", testString.utf8().data()); + + testString = "1224"; + ASSERT_TRUE(testString.is8Bit()); + testString.replaceWithLiteral('3', "NotFound"); + ASSERT_STREQ("1224", testString.utf8().data()); + + // Cases for 16Bit source. + testString = String::fromUTF8("résumé"); + ASSERT_FALSE(testString.is8Bit()); + testString.replaceWithLiteral(UChar(0x00E9 /*U+00E9 is 'é'*/), "e"); + ASSERT_STREQ("resume", testString.utf8().data()); + + testString = String::fromUTF8("résumé"); + ASSERT_FALSE(testString.is8Bit()); + testString.replaceWithLiteral(UChar(0x00E9 /*U+00E9 is 'é'*/), ""); + ASSERT_STREQ("rsum", testString.utf8().data()); + + testString = String::fromUTF8("résumé"); + ASSERT_FALSE(testString.is8Bit()); + testString.replaceWithLiteral('3', "NotFound"); + ASSERT_STREQ("résumé", testString.utf8().data()); +} } // namespace TestWebKitAPI diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp index 8ca13bc40..7dea31554 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp @@ -49,8 +49,7 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag size_t size = WKDataGetSize(receivedData); const unsigned char* bytes = WKDataGetBytes(receivedData); RetainPtr<CFDataRef> data(AdoptCF, CFDataCreate(0, bytes, size)); - CFPropertyListFormat format = kCFPropertyListXMLFormat_v1_0 | kCFPropertyListBinaryFormat_v1_0; - RetainPtr<CFPropertyListRef> propertyList(AdoptCF, CFPropertyListCreateWithData(0, data.get(), kCFPropertyListImmutable, &format, 0)); + RetainPtr<CFPropertyListRef> propertyList(AdoptCF, CFPropertyListCreateWithData(0, data.get(), kCFPropertyListImmutable, 0, 0)); EXPECT_TRUE(propertyList); // It should be a dictionary. diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp index 671c72943..1058cc1f3 100644 --- a/Tools/TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp +++ b/Tools/TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp @@ -41,14 +41,17 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag EXPECT_EQ(WKDictionaryGetTypeID(), WKGetTypeID(body)); WKDictionaryRef values = static_cast<WKDictionaryRef>(body); - WKStringRef textFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, WKStringCreateWithUTF8CString("textField"))); + WKRetainPtr<WKStringRef> textFieldKey(AdoptWK, WKStringCreateWithUTF8CString("textField")); + WKStringRef textFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, textFieldKey.get())); EXPECT_WK_STREQ("text field", textFieldValueWK); - WKStringRef passwordFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, WKStringCreateWithUTF8CString("passwordField"))); + WKRetainPtr<WKStringRef> passwordFieldKey(AdoptWK, WKStringCreateWithUTF8CString("passwordField")); + WKStringRef passwordFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, passwordFieldKey.get())); EXPECT_WK_STREQ("password field", passwordFieldValueWK); // <input type="hidden"> fields are not sent. - WKStringRef hiddenFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, WKStringCreateWithUTF8CString("hiddenField"))); + WKRetainPtr<WKStringRef> hiddenFieldKey(AdoptWK, WKStringCreateWithUTF8CString("hiddenField")); + WKStringRef hiddenFieldValueWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(values, hiddenFieldKey.get())); EXPECT_NULL(hiddenFieldValueWK); } diff --git a/Tools/WebKitTestRunner/Configurations/Base.xcconfig b/Tools/WebKitTestRunner/Configurations/Base.xcconfig index 512104b17..ef87ffe66 100644 --- a/Tools/WebKitTestRunner/Configurations/Base.xcconfig +++ b/Tools/WebKitTestRunner/Configurations/Base.xcconfig @@ -21,8 +21,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "CompilerVersion.xcconfig" - +CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; +CLANG_CXX_LIBRARY = libc++; CLANG_WARN_CXX0X_EXTENSIONS = NO; HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders ${SRCROOT}/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport; FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks; @@ -34,6 +34,7 @@ GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_TREAT_WARNINGS_AS_ERRORS = YES +GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES @@ -46,22 +47,9 @@ DEBUG_DEFINES_debug = ; DEBUG_DEFINES_normal = NDEBUG; DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT)); -CLANG_CXX_LIBRARY = $(CLANG_CXX_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -CLANG_CXX_LIBRARY_1060 = libstdc++; -CLANG_CXX_LIBRARY_1070 = libc++; -CLANG_CXX_LIBRARY_1080 = libc++; -CLANG_CXX_LIBRARY_1090 = libc++; - -REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME)); -REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx); -REAL_PLATFORM_NAME_iphoneos = iphoneos; -REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator; -REAL_PLATFORM_NAME_macosx = macosx; - TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); TARGETING_SAME_OS_X_VERSION = $(TARGETING_SAME_OS_X_VERSION_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -TARGETING_SAME_OS_X_VERSION_1060_1060 = YES; TARGETING_SAME_OS_X_VERSION_1070_1070 = YES; TARGETING_SAME_OS_X_VERSION_1080_1080 = YES; TARGETING_SAME_OS_X_VERSION_1090_1090 = YES; diff --git a/Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig b/Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig deleted file mode 100644 index a8c7f75a0..000000000 --- a/Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -IS_XCODE_0400 = $(IS_XCODE_0400_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_0400 = YES; - -IS_XCODE_0400_OR_0410 = $(IS_XCODE_0400_OR_0410_$(XCODE_VERSION_MINOR)); -IS_XCODE_0400_OR_0410_0400 = YES; -IS_XCODE_0400_OR_0410_0410 = YES; - -// The version of the LLVM Compiler in Xcode 4.0 and earlier have difficulty compiling our code. -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_$(IS_XCODE_0400)); -LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_YES = YES; - -// The version of the LLVM Compiler in Xcode 4.1 and earlier do not generate fast enough code. -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_$(XCODE_VERSION_MAJOR)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0300 = YES; -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_$(IS_XCODE_0400_OR_0410)); -LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_YES = YES; - -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_YES = NO; - -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS)); -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_ = YES; -LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_YES = NO; - - -// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0. -// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version -// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and -// XCODE_VERSION_ACTUAL for the full version number. -TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(REAL_PLATFORM_NAME)); -TARGET_GCC_VERSION_iphoneos = LLVM_GCC_42; -TARGET_GCC_VERSION_iphonesimulator = GCC_42; -TARGET_GCC_VERSION_macosx = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); - -TARGET_GCC_VERSION_macosx_1050 = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_MINOR)); -TARGET_GCC_VERSION_macosx_1050_ = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_ACTUAL)); -TARGET_GCC_VERSION_macosx_1050_0310 = GCC_42; -TARGET_GCC_VERSION_macosx_1050_0320 = GCC_42; - -TARGET_GCC_VERSION_macosx_1060 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1070 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Debug = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Release = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_AND_1070_Production = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS)); -TARGET_GCC_VERSION_macosx_1060_NON_LLVM_FALLBACK = GCC_42; -TARGET_GCC_VERSION_macosx_1070_NON_LLVM_FALLBACK = LLVM_GCC_42; - -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_YES = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_NO = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)_NON_LLVM_FALLBACK); - -TARGET_GCC_VERSION_macosx_1080 = LLVM_COMPILER; -TARGET_GCC_VERSION_macosx_1090 = LLVM_COMPILER; - -GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); -GCC_VERSION_GCC_40 = 4.0; -GCC_VERSION_GCC_42 = 4.2; -GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; -GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0; diff --git a/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig b/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig index 1f5144554..5b97d1272 100644 --- a/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig +++ b/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig @@ -23,30 +23,21 @@ #include "Base.xcconfig" -ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -ARCHS_1050 = $(NATIVE_ARCH); -ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1080 = $(ARCHS_STANDARD_32_64_BIT); -ARCHS_1090 = $(ARCHS_STANDARD_32_64_BIT); +ARCHS = $(ARCHS_STANDARD_32_64_BIT); ONLY_ACTIVE_ARCH = YES; MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) -MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; -MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; MACOSX_DEPLOYMENT_TARGET_1080 = 10.8; MACOSX_DEPLOYMENT_TARGET_1090 = 10.9; WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(BUILT_PRODUCTS_DIR); -WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(REAL_PLATFORM_NAME)); +WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(PLATFORM_NAME)); WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos = WebKitSystemInterface; WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphonesimulator = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos); WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); -WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1050 = WebKitSystemInterfaceLeopard; -WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1060 = WebKitSystemInterfaceSnowLeopard; WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1070 = WebKitSystemInterfaceLion; WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1080 = WebKitSystemInterfaceMountainLion; WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1090 = WebKitSystemInterfaceMountainLion; diff --git a/Tools/WebKitTestRunner/EventSenderProxy.h b/Tools/WebKitTestRunner/EventSenderProxy.h index ce2c1a612..92fe2d077 100644 --- a/Tools/WebKitTestRunner/EventSenderProxy.h +++ b/Tools/WebKitTestRunner/EventSenderProxy.h @@ -127,7 +127,7 @@ private: #endif #elif PLATFORM(EFL) Deque<WTREvent> m_eventQueue; - unsigned m_mouseButton; + WKEventMouseButton m_mouseButton; #if ENABLE(TOUCH_EVENTS) Eina_List* m_touchPoints; #endif diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl index f9f619981..6dad1b2bd 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl +++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl @@ -184,7 +184,9 @@ interface TestRunner { // Work queue. void queueBackNavigation(in unsigned long howFarBackward); + void queueForwardNavigation(in unsigned long howFarForward); void queueLoad(in DOMString url, in DOMString target); + void queueLoadHTMLString(in DOMString content, in [Optional] DOMString baseURL, in [Optional] DOMString unreachableURL); void queueReload(); void queueLoadingScript(in DOMString script); void queueNonLoadingScript(in DOMString script); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index d64a734f0..9a5e8075c 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -253,6 +253,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false); WKBundleSetAlwaysAcceptCookies(m_bundle, false); WKBundleSetSerialLoadingEnabled(m_bundle, false); + WKBundleSetShadowDOMEnabled(m_bundle, true); WKBundleRemoveAllUserContent(m_bundle, m_pageGroup); @@ -479,7 +480,16 @@ void InjectedBundle::queueBackNavigation(unsigned howFarBackward) WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueBackNavigation")); WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(howFarBackward)); - WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); + WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); +} + +void InjectedBundle::queueForwardNavigation(unsigned howFarForward) +{ + m_useWorkQueue = true; + + WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueForwardNavigation")); + WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(howFarForward)); + WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get()); } void InjectedBundle::queueLoad(WKStringRef url, WKStringRef target) @@ -499,6 +509,30 @@ void InjectedBundle::queueLoad(WKStringRef url, WKStringRef target) WKBundlePostMessage(m_bundle, messageName.get(), loadData.get()); } +void InjectedBundle::queueLoadHTMLString(WKStringRef content, WKStringRef baseURL, WKStringRef unreachableURL) +{ + m_useWorkQueue = true; + + WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueLoadHTMLString")); + + WKRetainPtr<WKMutableDictionaryRef> loadData(AdoptWK, WKMutableDictionaryCreate()); + + WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content")); + WKDictionaryAddItem(loadData.get(), contentKey.get(), content); + + if (baseURL) { + WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL")); + WKDictionaryAddItem(loadData.get(), baseURLKey.get(), baseURL); + } + + if (unreachableURL) { + WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL")); + WKDictionaryAddItem(loadData.get(), unreachableURLKey.get(), unreachableURL); + } + + WKBundlePostMessage(m_bundle, messageName.get(), loadData.get()); +} + void InjectedBundle::queueReload() { m_useWorkQueue = true; diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h index f3d2034ef..41469ec79 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h @@ -102,7 +102,9 @@ public: bool shouldProcessWorkQueue() const; void processWorkQueue(); void queueBackNavigation(unsigned howFarBackward); + void queueForwardNavigation(unsigned howFarForward); void queueLoad(WKStringRef url, WKStringRef target); + void queueLoadHTMLString(WKStringRef content, WKStringRef baseURL = 0, WKStringRef unreachableURL = 0); void queueReload(); void queueLoadingScript(WKStringRef script); void queueNonLoadingScript(WKStringRef script); diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri index a46b9300d..d7305e3ac 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri +++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri @@ -28,7 +28,6 @@ SOURCES += \ Bindings/JSWrapper.cpp \ qt/ActivateFontsQt.cpp \ qt/InjectedBundleQt.cpp \ - qt/QtInitializeTestFonts.cpp \ qt/TestRunnerQt.cpp # Adds the generated sources to SOURCES @@ -46,7 +45,6 @@ HEADERS += \ InjectedBundlePage.h \ TestRunner.h \ TextInputController.h \ - qt/QtInitializeTestFonts.h DESTDIR = $${ROOT_BUILD_DIR}/lib @@ -62,6 +60,7 @@ INCLUDEPATH += \ $$PWD \ $$PWD/.. \ $$PWD/Bindings \ + $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \ $${ROOT_WEBKIT_DIR}/Source/WebCore/testing/js \ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp index 23b5f34f2..a294da7d4 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp @@ -839,6 +839,11 @@ void TestRunner::queueBackNavigation(unsigned howFarBackward) InjectedBundle::shared().queueBackNavigation(howFarBackward); } +void TestRunner::queueForwardNavigation(unsigned howFarForward) +{ + InjectedBundle::shared().queueForwardNavigation(howFarForward); +} + void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { WKRetainPtr<WKURLRef> baseURLWK(AdoptWK, WKBundleFrameCopyURL(WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()))); @@ -848,6 +853,15 @@ void TestRunner::queueLoad(JSStringRef url, JSStringRef target) InjectedBundle::shared().queueLoad(urlStringWK.get(), toWK(target).get()); } +void TestRunner::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL) +{ + WKRetainPtr<WKStringRef> contentWK = toWK(content); + WKRetainPtr<WKStringRef> baseURLWK = baseURL ? toWK(baseURL) : WKRetainPtr<WKStringRef>(); + WKRetainPtr<WKStringRef> unreachableURLWK = unreachableURL ? toWK(unreachableURL) : WKRetainPtr<WKStringRef>(); + + InjectedBundle::shared().queueLoadHTMLString(contentWK.get(), baseURLWK.get(), unreachableURLWK.get()); +} + void TestRunner::queueReload() { InjectedBundle::shared().queueReload(); diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h index f92e34220..48b922c49 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h +++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h @@ -263,7 +263,9 @@ public: // Work queue. void queueBackNavigation(unsigned howFarBackward); + void queueForwardNavigation(unsigned howFarForward); void queueLoad(JSStringRef url, JSStringRef target); + void queueLoadHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL); void queueReload(); void queueLoadingScript(JSStringRef script); void queueNonLoadingScript(JSStringRef script); diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm index c49171a8c..f13dd9dab 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm +++ b/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm @@ -141,6 +141,7 @@ static NSSet *allowedFontFamilySet() @"STFangsong", @"STHeiti", @"STIXGeneral", + @"STIXSizeOneSym", @"STKaiti", @"STSong", @"Symbol", diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm index 46c273f1f..b0cb4e031 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm +++ b/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm @@ -85,8 +85,7 @@ void InjectedBundlePage::platformDidStartProvisionalLoadForFrame(WKBundleFrameRe StringBuilder builder; builder.appendLiteral("CRASHING TEST: "); builder.append(testPath); - RetainPtr<CFStringRef> cfString(AdoptCF, builder.toString().createCFString()); - WKSetCrashReportApplicationSpecificInformation(cfString.get()); + WKSetCrashReportApplicationSpecificInformation(builder.toString().createCFString().get()); } #endif } diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp index 789e2177f..332ffcf02 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp @@ -30,14 +30,14 @@ #include "config.h" #include "ActivateFonts.h" #include "DumpRenderTreeSupportQt.h" -#include "QtInitializeTestFonts.h" +#include "QtTestSupport.h" #include <QCoreApplication> namespace WTR { void activateFonts() { - WebKit::initializeTestFonts(); + WebKit::QtTestSupport::initializeTestFonts(); QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true); } diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp deleted file mode 100644 index fcacf9778..000000000 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "../../../DumpRenderTree/qt/QtInitializeTestFonts.cpp" - diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h deleted file mode 100644 index 87fa87bfa..000000000 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../DumpRenderTree/qt/QtInitializeTestFonts.h" - diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp index f5d149b3d..1671ac73b 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp @@ -29,10 +29,12 @@ #include "ActivateFonts.h" #include "InjectedBundle.h" +#include "QtTestSupport.h" #include <QCoreApplication> #include <QDir> #include <QFontDatabase> #include <QObject> +#include <QtCore/qglobal.h> #include <qwebsettings.h> namespace WTR { @@ -59,13 +61,9 @@ private: void TestRunner::platformInitialize() { - // Make WebKit2 mimic the behaviour of DumpRenderTree, which is incorrect, - // but tests are successfully passed. On the long run, Qt will move to QRawFont, - // which makes the use of QFontDatabase unnecessary. - // See https://bugs.webkit.org/show_bug.cgi?id=53427 - QWebSettings::clearMemoryCaches(); - QFontDatabase::removeAllApplicationFonts(); + WebKit::QtTestSupport::clearMemoryCaches(); activateFonts(); + QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired())); } diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake index 4ab8966d2..1c6947258 100644 --- a/Tools/WebKitTestRunner/PlatformEfl.cmake +++ b/Tools/WebKitTestRunner/PlatformEfl.cmake @@ -25,7 +25,6 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES ${CAIRO_INCLUDE_DIRS} ${ECORE_INCLUDE_DIRS} ${ECORE_EVAS_INCLUDE_DIRS} - ${ECORE_X_INCLUDE_DIRS} ${EINA_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} @@ -35,7 +34,6 @@ LIST(APPEND WebKitTestRunner_LIBRARIES ${CAIRO_LIBRARIES} ${ECORE_LIBRARIES} ${ECORE_EVAS_LIBRARIES} - ${ECORE_X_LIBRARIES} ${EINA_LIBRARIES} ${EVAS_LIBRARIES} ${GLIB_LIBRARIES} @@ -43,6 +41,17 @@ LIST(APPEND WebKitTestRunner_LIBRARIES ${WTF_LIBRARY_NAME} ) +IF (ENABLE_ECORE_X) + LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES + ${ECORE_X_INCLUDE_DIRS} + ) + + LIST(APPEND WebKitTestRunner_LIBRARIES + ${ECORE_X_LIBRARIES} + ${X11_Xext_LIB} + ) +ENDIF () + LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES ${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp diff --git a/Tools/WebKitTestRunner/PlatformWebView.h b/Tools/WebKitTestRunner/PlatformWebView.h index 13859e143..60d2fc1d5 100644 --- a/Tools/WebKitTestRunner/PlatformWebView.h +++ b/Tools/WebKitTestRunner/PlatformWebView.h @@ -64,7 +64,7 @@ namespace WTR { class PlatformWebView { public: - PlatformWebView(WKContextRef, WKPageGroupRef); + PlatformWebView(WKContextRef, WKPageGroupRef, WKDictionaryRef options = 0); ~PlatformWebView(); WKPageRef page(); @@ -88,7 +88,13 @@ public: void makeWebViewFirstResponder(); void setWindowIsKey(bool isKey) { m_windowIsKey = isKey; } bool windowIsKey() const { return m_windowIsKey; } - + +#if PLATFORM(MAC) + bool viewSupportsOptions(WKDictionaryRef) const; +#else + bool viewSupportsOptions(WKDictionaryRef) const { return true; } +#endif + WKRetainPtr<WKImageRef> windowSnapshotImage(); private: diff --git a/Tools/WebKitTestRunner/Target.pri b/Tools/WebKitTestRunner/Target.pri index 120a027ce..39800ab8d 100644 --- a/Tools/WebKitTestRunner/Target.pri +++ b/Tools/WebKitTestRunner/Target.pri @@ -8,7 +8,6 @@ TEMPLATE = app TARGET = WebKitTestRunner HEADERS += \ - $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h \ EventSenderProxy.h \ GeolocationProviderMock.h \ PlatformWebView.h \ @@ -19,7 +18,6 @@ HEADERS += \ WorkQueueManager.h SOURCES += \ - $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp \ qt/main.cpp \ qt/EventSenderProxyQt.cpp \ qt/PlatformWebViewQt.cpp \ @@ -39,10 +37,9 @@ WEBKIT += wtf javascriptcore webkit2 DEFINES += USE_SYSTEM_MALLOC=1 -have?(FONTCONFIG): PKGCONFIG += fontconfig - INCLUDEPATH += \ $$PWD \ + $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \ $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt PREFIX_HEADER = WebKitTestRunnerPrefix.h diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp index e9ef0471d..07ff81bb7 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp @@ -81,6 +81,7 @@ TestController::TestController(int argc, const char* argv[]) , m_printSeparators(false) , m_usingServerMode(false) , m_gcBetweenTests(false) + , m_shouldDumpPixelsForAllTests(false) , m_state(Initial) , m_doneResetting(false) , m_longTimeout(defaultLongTimeout) @@ -95,9 +96,6 @@ TestController::TestController(int argc, const char* argv[]) , m_isGeolocationPermissionAllowed(false) , m_policyDelegateEnabled(false) , m_policyDelegatePermissive(false) -#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) - , m_eventSenderProxy(new EventSenderProxy(this)) -#endif { initialize(argc, argv); controller = this; @@ -283,11 +281,16 @@ void TestController::initialize(int argc, const char* argv[]) m_gcBetweenTests = true; continue; } + if (argument == "--pixel-tests" || argument == "-p") { + m_shouldDumpPixelsForAllTests = true; + continue; + } if (argument == "--print-supported-features") { printSupportedFeatures = true; break; } + // Skip any other arguments that begin with '--'. if (argument.length() >= 2 && argument[0] == '-' && argument[1] == '-') continue; @@ -323,6 +326,18 @@ void TestController::initialize(int argc, const char* argv[]) WKContextSetLocalStorageDirectory(m_context.get(), dumpRenderTreeTempWK.get()); WKContextSetDiskCacheDirectory(m_context.get(), dumpRenderTreeTempWK.get()); WKContextSetCookieStorageDirectory(m_context.get(), dumpRenderTreeTempWK.get()); + + std::string iconDatabaseFileTemp(dumpRenderTreeTemp); + // WebCore::pathByAppendingComponent is not used here because of the namespace, + // which leads us to this ugly #ifdef and file path concatenation. +#if OS(WINDOWS) + const char separator = '\\'; +#else + const char separator = '/'; +#endif + iconDatabaseFileTemp = iconDatabaseFileTemp + separator + "WebpageIcons.db"; + WKRetainPtr<WKStringRef> iconDatabaseFileTempWK = WKStringCreateWithUTF8CString(iconDatabaseFileTemp.c_str()); + WKContextSetIconDatabasePath(m_context.get(), iconDatabaseFileTempWK.get()); } platformInitializeContext(); @@ -343,8 +358,12 @@ void TestController::initialize(int argc, const char* argv[]) if (testPluginDirectory()) WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory()); - m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get())); + createWebViewWithOptions(0); +} +void TestController::createWebViewWithOptions(WKDictionaryRef options) +{ + m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get(), options)); WKPageUIClient pageUIClient = { kWKPageUIClientCurrentVersion, m_mainWebView.get(), @@ -446,6 +465,21 @@ void TestController::initialize(int argc, const char* argv[]) WKPageSetPagePolicyClient(m_mainWebView->page(), &pagePolicyClient); } +void TestController::ensureViewSupportsOptions(WKDictionaryRef options) +{ + if (m_mainWebView && !m_mainWebView->viewSupportsOptions(options)) { + WKPageSetPageUIClient(m_mainWebView->page(), 0); + WKPageSetPageLoaderClient(m_mainWebView->page(), 0); + WKPageSetPagePolicyClient(m_mainWebView->page(), 0); + WKPageClose(m_mainWebView->page()); + + m_mainWebView = nullptr; + + createWebViewWithOptions(options); + resetStateToConsistentValues(); + } +} + bool TestController::resetStateToConsistentValues() { m_state = Resetting; @@ -467,6 +501,11 @@ bool TestController::resetStateToConsistentValues() // FIXME: This function should also ensure that there is only one page open. + // Reset the EventSender for each test. +#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) + m_eventSenderProxy = adoptPtr(new EventSenderProxy(this)); +#endif + // Reset preferences WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get()); WKPreferencesResetTestRunnerOverrides(preferences); @@ -629,7 +668,7 @@ bool TestController::runTest(const char* inputLine) m_state = RunningTest; m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL)); - if (command.shouldDumpPixels) + if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests) m_currentInvocation->setIsPixelTest(command.expectedPixelHash); m_currentInvocation->invoke(); diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h index 7081acdaa..56c3c4702 100644 --- a/Tools/WebKitTestRunner/TestController.h +++ b/Tools/WebKitTestRunner/TestController.h @@ -57,6 +57,8 @@ public: PlatformWebView* mainWebView() { return m_mainWebView.get(); } WKContextRef context() { return m_context.get(); } + void ensureViewSupportsOptions(WKDictionaryRef options); + // Runs the run loop until `done` is true or the timeout elapses. enum TimeoutDuration { ShortTimeout, LongTimeout, NoTimeout }; bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; } @@ -83,6 +85,7 @@ public: private: void initialize(int argc, const char* argv[]); + void createWebViewWithOptions(WKDictionaryRef); void run(); void runTestingServerLoop(); @@ -137,6 +140,7 @@ private: bool m_printSeparators; bool m_usingServerMode; bool m_gcBetweenTests; + bool m_shouldDumpPixelsForAllTests; std::vector<std::string> m_paths; WKRetainPtr<WKStringRef> m_injectedBundlePath; WKRetainPtr<WKStringRef> m_testPluginDirectory; @@ -174,7 +178,9 @@ private: bool m_policyDelegateEnabled; bool m_policyDelegatePermissive; - EventSenderProxy* m_eventSenderProxy; +#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) + OwnPtr<EventSenderProxy> m_eventSenderProxy; +#endif WorkQueueManager m_workQueueManager; }; diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp index fd9423220..1cb56bb71 100644 --- a/Tools/WebKitTestRunner/TestInvocation.cpp +++ b/Tools/WebKitTestRunner/TestInvocation.cpp @@ -143,9 +143,31 @@ static bool shouldOpenWebInspector(const char* pathOrURL) } #endif +#if PLATFORM(MAC) +static bool shouldUseTiledDrawing(const char* pathOrURL) +{ + return strstr(pathOrURL, "tiled-drawing/") || strstr(pathOrURL, "tiled-drawing\\"); +} +#endif + +static void updateTiledDrawingForCurrentTest(const char* pathOrURL) +{ +#if PLATFORM(MAC) + WKRetainPtr<WKMutableDictionaryRef> viewOptions = adoptWK(WKMutableDictionaryCreate()); + WKRetainPtr<WKStringRef> useTiledDrawingKey = adoptWK(WKStringCreateWithUTF8CString("TiledDrawing")); + WKRetainPtr<WKBooleanRef> useTiledDrawingValue = adoptWK(WKBooleanCreate(shouldUseTiledDrawing(pathOrURL))); + WKDictionaryAddItem(viewOptions.get(), useTiledDrawingKey.get(), useTiledDrawingValue.get()); + + TestController::shared().ensureViewSupportsOptions(viewOptions.get()); +#else + UNUSED_PARAM(pathOrURL); +#endif +} + void TestInvocation::invoke() { sizeWebViewForCurrentTest(m_pathOrURL.c_str()); + updateTiledDrawingForCurrentTest(m_pathOrURL.c_str()); WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest")); WKRetainPtr<WKMutableDictionaryRef> beginTestMessageBody = adoptWK(WKMutableDictionaryCreate()); @@ -447,6 +469,13 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName return; } + if (WKStringIsEqualToUTF8CString(messageName, "QueueForwardNavigation")) { + ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID()); + uint64_t stepCount = WKUInt64GetValue(static_cast<WKUInt64Ref>(messageBody)); + TestController::shared().workQueueManager().queueForwardNavigation(stepCount); + return; + } + if (WKStringIsEqualToUTF8CString(messageName, "QueueLoad")) { ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody); @@ -461,6 +490,23 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName return; } + if (WKStringIsEqualToUTF8CString(messageName, "QueueLoadHTMLString")) { + ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); + WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody); + + WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content")); + WKStringRef contentWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, contentKey.get())); + + WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL")); + WKStringRef baseURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, baseURLKey.get())); + + WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL")); + WKStringRef unreachableURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, unreachableURLKey.get())); + + TestController::shared().workQueueManager().queueLoadHTMLString(toWTFString(contentWK), baseURLWK ? toWTFString(baseURLWK) : String(), unreachableURLWK ? toWTFString(unreachableURLWK) : String()); + return; + } + if (WKStringIsEqualToUTF8CString(messageName, "QueueReload")) { TestController::shared().workQueueManager().queueReload(); return; diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj index 75ce94e63..530347b39 100644 --- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj +++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj @@ -570,7 +570,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\n\nexport WebKitTestRunner=\"${SRCROOT}\"\nexport WebCoreScripts=\"${WEBCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ ! $CC ]; then\n case $TARGET_GCC_VERSION in\n (GCC_42)\n export CC=\"`xcrun -find gcc-4.2`\";;\n (LLVM_GCC_42)\n export CC=\"`xcrun -find llvm-gcc-4.2`\";;\n (LLVM_COMPILER)\n export CC=\"`xcrun -find clang`\";;\n esac\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make -f \"${WebKitTestRunner}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n"; + shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\n\nexport WebKitTestRunner=\"${SRCROOT}\"\nexport WebCoreScripts=\"${WEBCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ ! $CC ]; then\n export CC=\"`xcrun -find clang`\"\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make -f \"${WebKitTestRunner}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Tools/WebKitTestRunner/WorkQueueManager.cpp b/Tools/WebKitTestRunner/WorkQueueManager.cpp index 738357908..84792303f 100644 --- a/Tools/WebKitTestRunner/WorkQueueManager.cpp +++ b/Tools/WebKitTestRunner/WorkQueueManager.cpp @@ -87,6 +87,18 @@ public: WKRetainPtr<WKStringRef> m_script; }; +class NavigationItem : public WorkQueueItem { +public: + explicit NavigationItem(int index) : m_index(index) { } + + WorkQueueItem::Type invoke() const + { + return goToItemAtIndex(m_index) ? WorkQueueItem::Loading : WorkQueueItem::NonLoading; + } + + unsigned m_index; +}; + WorkQueueManager::WorkQueueManager() : m_processing(false) { @@ -141,18 +153,39 @@ void WorkQueueManager::queueLoad(const String& url, const String& target) enqueue(new LoadItem(url, target)); } -void WorkQueueManager::queueBackNavigation(unsigned howFarBackward) +void WorkQueueManager::queueLoadHTMLString(const String& content, const String& baseURL, const String& unreachableURL) { - class BackNavigationItem : public WorkQueueItem { + class LoadHTMLStringItem : public WorkQueueItem { public: - explicit BackNavigationItem(unsigned howFarBackward) : m_howFarBackward(howFarBackward) { } + LoadHTMLStringItem(const String& content, const String& baseURL, const String& unreachableURL) + : m_content(AdoptWK, WKStringCreateWithUTF8CString(content.utf8().data())) + , m_baseURL(AdoptWK, WKURLCreateWithUTF8CString(baseURL.utf8().data())) + , m_unreachableURL(AdoptWK, WKURLCreateWithUTF8CString(unreachableURL.utf8().data())) + { + } - WorkQueueItem::Type invoke() const { return goToItemAtIndex(-m_howFarBackward) ? WorkQueueItem::Loading : WorkQueueItem::NonLoading; } + WorkQueueItem::Type invoke() const + { + WKPageLoadAlternateHTMLString(mainPage(), m_content.get(), m_baseURL.get(), m_unreachableURL.get()); + return WorkQueueItem::Loading; + } - unsigned m_howFarBackward; + WKRetainPtr<WKStringRef> m_content; + WKRetainPtr<WKURLRef> m_baseURL; + WKRetainPtr<WKURLRef> m_unreachableURL; }; - enqueue(new BackNavigationItem(howFarBackward)); + enqueue(new LoadHTMLStringItem(content, baseURL, unreachableURL)); +} + +void WorkQueueManager::queueBackNavigation(unsigned howFarBackward) +{ + enqueue(new NavigationItem(-howFarBackward)); +} + +void WorkQueueManager::queueForwardNavigation(unsigned howFarForward) +{ + enqueue(new NavigationItem(howFarForward)); } void WorkQueueManager::queueReload() diff --git a/Tools/WebKitTestRunner/WorkQueueManager.h b/Tools/WebKitTestRunner/WorkQueueManager.h index b9a22dde3..21d5ebb88 100644 --- a/Tools/WebKitTestRunner/WorkQueueManager.h +++ b/Tools/WebKitTestRunner/WorkQueueManager.h @@ -43,7 +43,9 @@ public: bool processWorkQueue(); // Returns 'true' if queue is processed (no new loading is started), returns 'false' otherwise. void queueLoad(const String& url, const String& target); + void queueLoadHTMLString(const String& content, const String& baseURL, const String& unreachableURL); void queueBackNavigation(unsigned howFarBackward); + void queueForwardNavigation(unsigned howFarForward); void queueReload(); void queueLoadingScript(const String& script); void queueNonLoadingScript(const String& script); diff --git a/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp b/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp index fc225e3f4..f2829a96c 100644 --- a/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp +++ b/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp @@ -56,14 +56,6 @@ enum WTREventType { WTREventTypeLeapForward }; -enum WTRMouseButton { - WTRMouseButtonNone = -1, - WTRMouseButtonLeft, - WTRMouseButtonMiddle, - WTRMouseButtonRight, - WTRMouseButtonMiddleDuplicated, -}; - enum EvasMouseButton { EvasMouseButtonNone = 0, EvasMouseButtonLeft, @@ -121,15 +113,14 @@ struct KeyEventInfo : public RefCounted<KeyEventInfo> { static unsigned evasMouseButton(unsigned button) { - if (button == WTRMouseButtonLeft) - return EvasMouseButtonLeft; - if (button == WTRMouseButtonMiddle) + // The common case involves converting from a WKEventMouseButton (which + // starts at -1) to an EvasMouseButton (which a starts at 0). The special + // case for button 3 exists because of fast/events/mouse-click-events.html, + // which tests whether a 4th mouse button behaves as the middle one. + if (button <= kWKEventMouseButtonRightButton) + return button + 1; + if (button == kWKEventMouseButtonRightButton + 1) return EvasMouseButtonMiddle; - if (button == WTRMouseButtonRight) - return EvasMouseButtonRight; - if (button == WTRMouseButtonMiddleDuplicated) - return EvasMouseButtonMiddle; - return EvasMouseButtonNone; } @@ -292,8 +283,8 @@ EventSenderProxy::EventSenderProxy(TestController* testController) , m_leftMouseButtonDown(false) , m_clickCount(0) , m_clickTime(0) - , m_clickButton(WTRMouseButtonNone) - , m_mouseButton(WTRMouseButtonNone) + , m_clickButton(kWKEventMouseButtonNoButton) + , m_mouseButton(kWKEventMouseButtonNoButton) #if ENABLE(TOUCH_EVENTS) , m_touchPoints(0) #endif @@ -371,7 +362,7 @@ void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers) sendOrQueueEvent(WTREvent(WTREventTypeMouseUp, 0, wkModifiers, evasMouseButton(button))); if (m_mouseButton == button) - m_mouseButton = WTRMouseButtonNone; + m_mouseButton = kWKEventMouseButtonNoButton; m_clickPosition = m_position; m_clickTime = ecore_time_get(); @@ -382,12 +373,12 @@ void EventSenderProxy::mouseMoveTo(double x, double y) m_position.x = x; m_position.y = y; - sendOrQueueEvent(WTREvent(WTREventTypeMouseMove, 0, 0, WTRMouseButtonNone)); + sendOrQueueEvent(WTREvent(WTREventTypeMouseMove, 0, 0, kWKEventMouseButtonNoButton)); } void EventSenderProxy::mouseScrollBy(int horizontal, int vertical) { - WTREvent event(WTREventTypeMouseScrollBy, 0, 0, WTRMouseButtonNone); + WTREvent event(WTREventTypeMouseScrollBy, 0, 0, kWKEventMouseButtonNoButton); // We need to invert scrolling values since in EFL negative z value means that // canvas is scrolling down event.horizontal = -horizontal; @@ -403,7 +394,7 @@ void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, boo void EventSenderProxy::leapForward(int milliseconds) { if (m_eventQueue.isEmpty()) - m_eventQueue.append(WTREvent(WTREventTypeLeapForward, milliseconds, 0, WTRMouseButtonNone)); + m_eventQueue.append(WTREvent(WTREventTypeLeapForward, milliseconds, 0, kWKEventMouseButtonNoButton)); m_time += milliseconds / 1000.0; } diff --git a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp index 06187a066..cb957d5d9 100644 --- a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp +++ b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp @@ -30,7 +30,11 @@ namespace WTR { static Ecore_Evas* initEcoreEvas() { - Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0); + const char* engine = 0; +#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X) + engine = "opengl_x11"; +#endif + Ecore_Evas* ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0); if (!ecoreEvas) return 0; @@ -40,7 +44,7 @@ static Ecore_Evas* initEcoreEvas() return ecoreEvas; } -PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup) +PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKDictionaryRef /*options*/) { m_window = initEcoreEvas(); Evas* evas = ecore_evas_get(m_window); @@ -69,6 +73,11 @@ WKPageRef PlatformWebView::page() void PlatformWebView::focus() { + // In a few cases, an iframe might receive focus from JavaScript and Evas is not aware of it at all + // (WebCoreSupport::focusedFrameChanged() does not emit any notification). We then manually remove the + // focus from the view to make the call give focus to evas_object_focus_set(..., true) to be effectful. + if (WKPageGetFocusedFrame(page()) != WKPageGetMainFrame(page())) + evas_object_focus_set(m_view, false); evas_object_focus_set(m_view, true); } diff --git a/Tools/WebKitTestRunner/efl/main.cpp b/Tools/WebKitTestRunner/efl/main.cpp index 70b2a4485..b02ff357d 100644 --- a/Tools/WebKitTestRunner/efl/main.cpp +++ b/Tools/WebKitTestRunner/efl/main.cpp @@ -24,10 +24,24 @@ #include <wtf/Assertions.h> #include <stdlib.h> +#ifdef HAVE_ECORE_X +#include <X11/Xlib.h> +#include <X11/extensions/Xext.h> + +static int dummyExtensionErrorHandler(Display*, _Xconst char*, _Xconst char*) +{ + return 0; +} +#endif + int main(int argc, char** argv) { WTFInstallReportBacktraceOnCrashHook(); +#ifdef HAVE_ECORE_X + XSetExtensionErrorHandler(dummyExtensionErrorHandler); +#endif + if (!ewk_init()) return 1; diff --git a/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp b/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp index 7c7d590e9..cdbaec5b2 100644 --- a/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp +++ b/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp @@ -83,6 +83,10 @@ EventSenderProxy::EventSenderProxy(TestController* testController) { } +EventSenderProxy::~EventSenderProxy() +{ +} + static guint getMouseButtonModifiers(int gdkButton) { if (gdkButton == 1) diff --git a/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp b/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp index f1615d4ac..bbef04ead 100644 --- a/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp +++ b/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp @@ -33,7 +33,7 @@ namespace WTR { -PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup) +PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKDictionaryRef /*options*/) : m_view(WKViewCreate(context, pageGroup)) , m_window(gtk_window_new(GTK_WINDOW_POPUP)) , m_windowIsKey(true) diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm index dfe10745d..ece5b523e 100644 --- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm +++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm @@ -111,6 +111,10 @@ EventSenderProxy::EventSenderProxy(TestController* testController) { } +EventSenderProxy::~EventSenderProxy() +{ +} + void EventSenderProxy::updateClickCountForButton(int button) { if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) { @@ -385,15 +389,11 @@ void EventSenderProxy::mouseScrollBy(int x, int y) RetainPtr<CGEventRef> cgScrollEvent(AdoptCF, CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x)); // CGEvent locations are in global display coordinates. - CGPoint lastGlobalMousePosition = { - m_position.x, - [[NSScreen mainScreen] frame].size.height - m_position.y - }; + CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[NSScreen mainScreen] frame].size.height - m_position.y); CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition); NSEvent *event = [NSEvent eventWithCGEvent:cgScrollEvent.get()]; - NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]; - if (targetView) + if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]) [targetView scrollWheel:event]; } diff --git a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm index db5d1197c..4c7b15f58 100644 --- a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm +++ b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm @@ -25,6 +25,7 @@ #include "config.h" #include "PlatformWebView.h" +#include "TestController.h" #import <WebKit2/WKImageCG.h> #import <WebKit2/WKViewPrivate.h> @@ -37,6 +38,32 @@ @property (nonatomic, assign) WTR::PlatformWebView* platformWebView; @end +@interface TestRunnerWKView : WKView { + BOOL _useTiledDrawing; +} + +- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)context pageGroupRef:(WKPageGroupRef)pageGroup useTiledDrawing:(BOOL)useTiledDrawing; + +@property (nonatomic, assign) BOOL useTiledDrawing; +@end + +@implementation TestRunnerWKView + +@synthesize useTiledDrawing = _useTiledDrawing; + +- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)context pageGroupRef:(WKPageGroupRef)pageGroup useTiledDrawing:(BOOL)useTiledDrawing +{ + _useTiledDrawing = useTiledDrawing; + return [super initWithFrame:frame contextRef:context pageGroupRef:pageGroup]; +} + +- (BOOL)_shouldUseTiledDrawingArea +{ + return _useTiledDrawing; +} + +@end + @implementation WebKitTestRunnerWindow @synthesize platformWebView = _platformWebView; @@ -78,11 +105,14 @@ namespace WTR { -PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) +PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef options) : m_windowIsKey(true) { + WKRetainPtr<WKStringRef> useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString("TiledDrawing")); + bool useTiledDrawing = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useTiledDrawingKey.get()))) : false; + NSRect rect = NSMakeRect(0, 0, 800, 600); - m_view = [[WKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef]; + m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef useTiledDrawing:useTiledDrawing]; NSRect windowRect = NSOffsetRect(rect, -10000, [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000); m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; @@ -168,4 +198,12 @@ WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() return adoptWK(WKImageCreateFromCGImage(windowSnapshotImage.get(), 0)); } +bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const +{ + WKRetainPtr<WKStringRef> useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString("TiledDrawing")); + bool useTiledDrawing = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useTiledDrawingKey.get()))); + + return useTiledDrawing == [(TestRunnerWKView *)m_view useTiledDrawing]; +} + } // namespace WTR diff --git a/Tools/WebKitTestRunner/mac/main.mm b/Tools/WebKitTestRunner/mac/main.mm index 12326a4d3..b5c34f769 100644 --- a/Tools/WebKitTestRunner/mac/main.mm +++ b/Tools/WebKitTestRunner/mac/main.mm @@ -31,6 +31,7 @@ int main(int argc, const char* argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [NSApplication sharedApplication]; + [[NSUserDefaults standardUserDefaults] setVolatileDomain:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"WebKitKerningAndLigaturesEnabledByDefault"] forName:NSArgumentDomain]; { WTR::TestController controller(argc, argv); } diff --git a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp index 7619d3160..e16e3efe0 100644 --- a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp +++ b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp @@ -72,6 +72,10 @@ EventSenderProxy::EventSenderProxy(TestController* testController) isReplayingEvents = false; } +EventSenderProxy::~EventSenderProxy() +{ +} + static Qt::MouseButton getMouseButton(unsigned button) { Qt::MouseButton mouseButton; @@ -246,12 +250,10 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef void EventSenderProxy::updateClickCountForButton(int button) { if (m_time - m_clickTime < QApplication::doubleClickInterval() && m_position == m_clickPosition && button == m_clickButton) { - ++m_clickCount; m_clickTime = m_time; return; } - m_clickCount = 1; m_clickTime = m_time; m_clickPosition = m_position; m_clickButton = button; @@ -267,9 +269,10 @@ void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers) m_mouseButtons |= mouseButton; QPoint mousePos(m_position.x, m_position.y); - QMouseEvent* event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick : QEvent::MouseButtonPress, + QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonPress, mousePos, mousePos, mouseButton, m_mouseButtons, modifiers); + // We aren't generating MouseButtonDblClick events as they aren't used. sendOrQueueEvent(event); } diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index 00177db81..e1cce48a5 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -66,10 +66,8 @@ private Q_SLOTS: setSurfaceType(OpenGLSurface); create(); QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true); - } else { - QQuickWebViewExperimental experimental(m_view); - experimental.setRenderToOffscreenBuffer(true); - } + } else + m_view->experimental()->setRenderToOffscreenBuffer(true); QWindowSystemInterface::handleWindowActivated(this); m_view->page()->setFocus(true); @@ -79,7 +77,7 @@ private: QQuickWebView* m_view; }; -PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) +PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef /*options*/) : m_view(new QQuickWebView(contextRef, pageGroupRef)) , m_window(new WrapperWindow(m_view)) , m_windowIsKey(true) diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp index 31b750681..3c9d311c9 100644 --- a/Tools/WebKitTestRunner/qt/main.cpp +++ b/Tools/WebKitTestRunner/qt/main.cpp @@ -26,7 +26,7 @@ #include "config.h" -#include "QtInitializeTestFonts.h" +#include "QtTestSupport.h" #include "TestController.h" #include "qquickwebview_p.h" @@ -119,7 +119,7 @@ int main(int argc, char** argv) qputenv("QT_WEBKIT_THEME_NAME", "qstyle"); - WebKit::initializeTestFonts(); + WebKit::QtTestSupport::initializeTestFonts(); QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true); QQuickWebViewExperimental::setFlickableViewportEnabled(false); diff --git a/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp b/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp index 2fbcef922..91a03d2a3 100644 --- a/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp +++ b/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp @@ -48,7 +48,7 @@ static void registerWindowClass() RegisterClassExW(&wndClass); } -PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) +PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef /*options*/) : m_windowIsKey(true) { registerWindowClass(); diff --git a/Tools/efl/jhbuild.modules b/Tools/efl/jhbuild.modules index a3c0fd320..55287880d 100644 --- a/Tools/efl/jhbuild.modules +++ b/Tools/efl/jhbuild.modules @@ -162,20 +162,20 @@ </autotools> <autotools id="eina"> - <branch module="releases/eina-1.7.0.tar.gz" version="1.7.0" - checkoutdir="eina-1.7.0" + <branch module="releases/eina-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="eina-1.7.1" repo="download.enlightenment.org" - hash="sha256:6aacededb08aa1090a1beecbf62acf3e2ce0676ac87d21c787c07983f801166f" - md5sum="303b81bbfff684eef0e5be70ba977012"> + hash="sha256:af0b316734ba72d92fa7716005efd380f28677c76f0e0b6a3c5a9b524575a6ce" + md5sum="552c5e9042d9cb3dbdebbc0e211ef30b"> </branch> </autotools> <autotools id="embryo"> - <branch module="releases/embryo-1.7.0.tar.gz" version="1.7.0" - checkoutdir="embryo-1.7.0" + <branch module="releases/embryo-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="embryo-1.7.1" repo="download.enlightenment.org" - hash="sha256:290b452e6cb87f64b11b529c7f67c40192f87a73cc4c5be93a95f17b76f65063" - md5sum="f46bb8ab1699cd7acb8463e50a3ffb4b"> + hash="sha256:043563b8c1a66de117cfaaf76a4d9736e111007ce5c0cdcf2b1d83dd8b4df575" + md5sum="d66a0e91dfc37eeb4c362b2c46bd91ab"> </branch> <dependencies> <dep package="eina"/> @@ -183,20 +183,20 @@ </autotools> <autotools id="evas"> - <branch module="releases/evas-1.7.0.tar.gz" version="1.7.0" - checkoutdir="evas-1.7.0" + <branch module="releases/evas-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="evas-1.7.1" repo="download.enlightenment.org" - hash="sha256:2d7a33d02d2da37647e4c0127fedebe00eeea14560d6c1b6ca9b0cccdae0de84" - md5sum="3359918f8e60c778b861cf1cde02d3a9"> + hash="sha256:57966a16fdb20e94deefe83ec0f990607413f7952f9755ed23ce81aea49b670c" + md5sum="e33c1d270b16e45c2337424aa2faaaa0"> </branch> </autotools> <autotools id="ecore"> - <branch module="releases/ecore-1.7.0.tar.gz" version="1.7.0" - checkoutdir="ecore-1.7.0" + <branch module="releases/ecore-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="ecore-1.7.1" repo="download.enlightenment.org" - hash="sha256:f009e17376b7f3fb6ce6b45648d2a0131a152943b502fa34cc4bd018f67da8bb" - md5sum="cf0b5e980a77dc0d1bdedf2bcc60e862"> + hash="sha256:fb5f547a0a6556b5f0e274b65cfbe42f4eb8371f20d00005cd4f5a78a6b6a5d8" + md5sum="94fd264e478323a1100b3cfff833d28d"> </branch> <dependencies> <dep package="eina"/> @@ -205,11 +205,11 @@ </autotools> <autotools id="eet"> - <branch module="releases/eet-1.7.0.tar.gz" version="1.7.0" - checkoutdir="eet-1.7.0" + <branch module="releases/eet-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="eet-1.7.1" repo="download.enlightenment.org" - hash="sha256:9bca5becaaa5abf4b7ac0f80de68d3b9a8f1abce7eca4175e1ad82953783d209" - md5sum="46e989eb4dddd942b4564299e19d9f64"> + hash="sha256:3e5679c06792f0a1c4b5b158468afbcec3b510c60345055d5964fdbe2abba3eb" + md5sum="2974f892e2be5e2fa08296714e97c407"> </branch> <dependencies> <dep package="libgcrypt"/> @@ -218,11 +218,11 @@ </autotools> <autotools id="edje"> - <branch module="releases/edje-1.7.0.tar.gz" version="1.7.0" - checkoutdir="edje-1.7.0" + <branch module="releases/edje-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="edje-1.7.1" repo="download.enlightenment.org" - hash="sha256:d6df9a7bf11c4605f55a2e7c209210044f8dc4f3332135f6256676d2f937621b" - md5sum="37e15c5d6e7c2676728bda75109b2218"> + hash="sha256:d924d7ade92055a5c83d3c43171982b7f006db9f5c923fb39e0523405ec4534c" + md5sum="766747bc1b8a1755952e275b6058cf30"> </branch> <dependencies> <dep package="eet"/> @@ -233,11 +233,11 @@ </autotools> <autotools id="e_dbus"> - <branch module="releases/e_dbus-1.7.0.tar.gz" version="1.7.0" - checkoutdir="e_dbus-1.7.0" + <branch module="releases/e_dbus-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="e_dbus-1.7.1" repo="download.enlightenment.org" - hash="sha256:6ee303bd0e2f91a6be08433df474377494ba6815441e5e6b79a5d284ead2a768" - md5sum="3d59bfb00763a61976a976be925e1cbf"> + hash="sha256:d3a3e0b81f6bb69d2fc3886c9885dad27ebf14b60c4a0bbd5a2a510b5a5ff2d1" + md5sum="3fa25de2880c2ff9d78d070d4792f570"> </branch> <dependencies> <dep package="ecore"/> @@ -246,11 +246,11 @@ </autotools> <autotools id="eeze"> - <branch module="releases/eeze-1.7.0.tar.gz" version="1.7.0" - checkoutdir="eeze-1.7.0" + <branch module="releases/eeze-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="eeze-1.7.1" repo="download.enlightenment.org" - hash="sha256:7db8709445114d1fe1c3609cf79a06e13a3d584a5a3dfd557642ddc65ac3a202" - md5sum="60a8bb62e3d2cc7dfac14f1cd62343e2"> + hash="sha256:6a696e2fe1ad14983ca7555eed2c50dd39f9a084e04475f0d25fd31d32e3cd58" + md5sum="0e9d008a9ae17de2aea82a34ee62691e"> </branch> <dependencies> <dep package="ecore"/> @@ -259,11 +259,11 @@ </autotools> <autotools id="efreet"> - <branch module="releases/efreet-1.7.0.tar.gz" version="1.7.0" - checkoutdir="efreet-1.7.0" + <branch module="releases/efreet-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="efreet-1.7.1" repo="download.enlightenment.org" - hash="sha256:16a41a03d55febf30f2dd786b51be3e370fc563f3335dd26832e0eaa88516c79" - md5sum="f039197e14288ecef94eeab040cbbdb4"> + hash="sha256:c844ed545f1c9438c73af4e4d037401a653babaab0a4e4b69377a2de49431eea" + md5sum="0fc2b3bf93dc3a9f293c348339163ba3"> </branch> <dependencies> <deb package="ecore"/> @@ -274,11 +274,11 @@ <autotools id="elementary" autogenargs="--disable-web"> - <branch module="releases/elementary-1.7.0.tar.gz" version="1.7.0" - checkoutdir="elementary-1.7.0" + <branch module="releases/elementary-1.7.1.tar.bz2" version="1.7.1" + checkoutdir="elementary-1.7.1" repo="download.enlightenment.org" - hash="sha256:7e7deeb4e3a9bbb9c7b7a89c2efbe269a1a6a44ef380bf91c1066d128163e2d3" - md5sum="45263c5d107981a44d28734c82e9fae1"> + hash="sha256:54dd82ca156f024de91e375ae9f7ad9579cb0d8fb0bcbf9b16e5b4165d5ac483" + md5sum="9f43658594d8e837773c8b6573b654dd"> </branch> <dependencies> <deb package="edje"/> diff --git a/Tools/lldb/lldb_webkit.py b/Tools/lldb/lldb_webkit.py new file mode 100644 index 000000000..37844f89b --- /dev/null +++ b/Tools/lldb/lldb_webkit.py @@ -0,0 +1,192 @@ +# Copyright (C) 2012 Apple. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" + LLDB Support for WebKit Types + + Add the following to your .lldbinit file to add WebKit Type summaries in LLDB and Xcode: + + command script import {Path to WebKit Root}/Tools/lldb/lldb_webkit.py + +""" + +import lldb + + +def __lldb_init_module(debugger, dict): + debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFString_SummaryProvider WTF::String') + debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFStringImpl_SummaryProvider WTF::StringImpl') + debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFAtomicString_SummaryProvider WTF::AtomicString') + debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFVector_SummaryProvider -x "WTF::Vector<.+>$"') + debugger.HandleCommand('type synthetic add -x "WTF::Vector<.+>$" --python-class lldb_webkit.WTFVectorProvider') + + +def WTFString_SummaryProvider(valobj, dict): + provider = WTFStringProvider(valobj, dict) + return "{ length = %d, contents = '%s' }" % (provider.get_length(), provider.to_string()) + + +def WTFStringImpl_SummaryProvider(valobj, dict): + provider = WTFStringImplProvider(valobj, dict) + return "{ length = %d, is8bit = %d, contents = '%s' }" % (provider.get_length(), provider.is_8bit(), provider.to_string()) + + +def WTFAtomicString_SummaryProvider(valobj, dict): + return WTFString_SummaryProvider(valobj.GetChildMemberWithName('m_string'), dict) + + +def WTFVector_SummaryProvider(valobj, dict): + provider = WTFVectorProvider(valobj, dict) + return "{ size = %d, capacity = %d }" % (provider.size, provider.capacity) + +# FIXME: Provide support for the following types: +# def WTFVector_SummaryProvider(valobj, dict): +# def WTFCString_SummaryProvider(valobj, dict): +# def WebCoreKURLGooglePrivate_SummaryProvider(valobj, dict): +# def WebCoreQualifiedName_SummaryProvider(valobj, dict): +# def JSCIdentifier_SummaryProvider(valobj, dict): +# def JSCJSString_SummaryProvider(valobj, dict): + + +def guess_string_length(valobj, error): + if not valobj.GetValue(): + return 0 + + for i in xrange(0, 2048): + if valobj.GetPointeeData(i, 1).GetUnsignedInt16(error, 0) == 0: + return i + + return 256 + + +def ustring_to_string(valobj, error, length=None): + if length is None: + length = guess_string_length(valobj, error) + else: + length = int(length) + + out_string = u"" + for i in xrange(0, length): + char_value = valobj.GetPointeeData(i, 1).GetUnsignedInt16(error, 0) + out_string = out_string + unichr(char_value) + + return out_string.encode('utf-8') + + +def lstring_to_string(valobj, error, length=None): + if length is None: + length = guess_string_length(valobj, error) + else: + length = int(length) + + out_string = u"" + for i in xrange(0, length): + char_value = valobj.GetPointeeData(i, 1).GetUnsignedInt8(error, 0) + out_string = out_string + unichr(char_value) + + return out_string.encode('utf-8') + + +class WTFStringImplProvider: + def __init__(self, valobj, dict): + self.valobj = valobj + + def get_length(self): + return self.valobj.GetChildMemberWithName('m_length').GetValueAsUnsigned(0) + + def get_data8(self): + return self.valobj.GetChildAtIndex(2).GetChildMemberWithName('m_data8') + + def get_data16(self): + return self.valobj.GetChildAtIndex(2).GetChildMemberWithName('m_data16') + + def to_string(self): + error = lldb.SBError() + if self.is_8bit(): + return lstring_to_string(self.get_data8(), error, self.get_length()) + return ustring_to_string(self.get_data16(), error, self.get_length()) + + def is_8bit(self): + # FIXME: find a way to access WTF::StringImpl::s_hashFlag8BitBuffer + return bool(self.valobj.GetChildMemberWithName('m_hashAndFlags').GetValueAsUnsigned(0) \ + & 1 << 6) + + +class WTFStringProvider: + def __init__(self, valobj, dict): + self.valobj = valobj + + def stringimpl(self): + impl_ptr = self.valobj.GetChildMemberWithName('m_impl').GetChildMemberWithName('m_ptr') + return WTFStringImplProvider(impl_ptr, dict) + + def get_length(self): + impl = self.stringimpl() + if not impl: + return 0 + return impl.get_length() + + def to_string(self): + impl = self.stringimpl() + if not impl: + return u"" + return impl.to_string() + + +class WTFVectorProvider: + def __init__(self, valobj, internal_dict): + self.valobj = valobj + self.update() + + def num_children(self): + return self.size + 2 + + def get_child_index(self, name): + if name == "m_size": + return self.size + elif name == "m_buffer": + return self.size + 1 + else: + return int(name.lstrip('[').rstrip(']')) + + def get_child_at_index(self, index): + if index == self.size: + return self.valobj.GetChildMemberWithName("m_size") + elif index == self.size + 1: + return self.vector_buffer + elif index < self.size: + offset = index * self.data_size + child = self.buffer.CreateChildAtOffset('[' + str(index) + ']', offset, self.data_type) + return child + else: + return None + + def update(self): + self.vector_buffer = self.valobj.GetChildMemberWithName('m_buffer') + self.buffer = self.vector_buffer.GetChildMemberWithName('m_buffer') + self.size = self.valobj.GetChildMemberWithName('m_size').GetValueAsUnsigned(0) + self.capacity = self.vector_buffer.GetChildMemberWithName('m_capacity').GetValueAsUnsigned(0) + self.data_type = self.buffer.GetType().GetPointeeType() + self.data_size = self.data_type.GetByteSize() + + def has_children(self): + return True diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf index a827f0edc..39eec9bb5 100644 --- a/Tools/qmake/mkspecs/features/default_pre.prf +++ b/Tools/qmake/mkspecs/features/default_pre.prf @@ -115,5 +115,5 @@ isEmpty(SQLITE3SRCDIR) { FLEX = flex win32: FLEX = win_flex -EXEEXT = -win32: EXEEXT = .exe +BIN_EXTENSION = +win32: BIN_EXTENSION = .exe diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf index d7f0301d6..bc285a28e 100644 --- a/Tools/qmake/mkspecs/features/features.prf +++ b/Tools/qmake/mkspecs/features/features.prf @@ -127,6 +127,7 @@ defineTest(detectFeatures) { # GraphicsSurface requires GraphicsContext3D and hence use_3d_graphics use?(3d_graphics) { mac: WEBKIT_CONFIG += use_graphics_surface + win32:contains(QT_CONFIG, opengles2): WEBKIT_CONFIG += use_graphics_surface linux-*:contains(WEBKIT_CONFIG, have_glx):contains(WEBKIT_CONFIG, have_xcomposite):contains(WEBKIT_CONFIG, have_xrender): WEBKIT_CONFIG += use_graphics_surface } diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri index 33cc0409f..1272ece02 100644 --- a/Tools/qmake/mkspecs/features/features.pri +++ b/Tools/qmake/mkspecs/features/features.pri @@ -88,6 +88,7 @@ FEATURE_DEFAULTS = \ ENABLE_PAGE_VISIBILITY_API=1 \ ENABLE_PROGRESS_ELEMENT=1 \ ENABLE_QUOTA=0 \ + ENABLE_RESOLUTION_MEDIA_QUERY=1 \ ENABLE_REQUEST_ANIMATION_FRAME=1 \ ENABLE_SCRIPTED_SPEECH=0 \ ENABLE_SHADOW_DOM=0 \ @@ -103,7 +104,6 @@ FEATURE_DEFAULTS = \ ENABLE_TOUCH_ADJUSTMENT=1 \ ENABLE_TOUCH_EVENTS=1 \ ENABLE_TOUCH_ICON_LOADING=0 \ - ENABLE_UNDO_MANAGER=0 \ ENABLE_VIBRATION=0 \ ENABLE_VIDEO=0 \ ENABLE_VIDEO_TRACK=0 \ @@ -112,4 +112,5 @@ FEATURE_DEFAULTS = \ ENABLE_WEB_SOCKETS=1 \ ENABLE_WEB_TIMING=1 \ ENABLE_WORKERS=1 \ + ENABLE_XHR_TIMEOUT = 0 \ ENABLE_XSLT=0 \ |
