diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
| commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
| tree | f6256640b6c46d7da221435803cae65326817ba2 /Tools | |
| parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
| download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz | |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Tools')
170 files changed, 5107 insertions, 3397 deletions
diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/config.json b/Tools/BuildSlaveSupport/build.webkit.org-config/config.json index c4f98ae69..d6f12ccfe 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/config.json +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/config.json @@ -51,7 +51,7 @@ { "name": "szeged-windows-1", "platform": "qt-win"}, { "name": "szeged-windows-2", "platform": "qt-win"}, - { "name": "indt-snowleopard", "platform": "qt-mac"}, + { "name": "indt-mountainlion", "platform": "qt-mac"}, { "name": "google-windows-1", "platform": "chromium-win" }, { "name": "google-windows-2", "platform": "chromium-win" }, @@ -233,9 +233,9 @@ "slavenames": ["szeged-windows-2"] }, { - "name": "Qt SnowLeopard Release", "type": "Build", "builddir": "qt-snowleopard-release", + "name": "Qt Mountain Lion Release", "type": "Build", "builddir": "qt-mountainlion-release", "platform": "qt-mac", "configuration": "release", "architectures": ["x86_64"], - "slavenames": ["indt-snowleopard"] + "slavenames": ["indt-mountainlion"] }, { "name": "Chromium Win Release", "type": "Build", "builddir": "chromium-win-release", @@ -326,7 +326,7 @@ "builderNames": ["GTK Linux 32-bit Release", "GTK Linux 64-bit Release", "GTK Linux 64-bit Debug", "Qt Linux Release", "Qt Linux Release minimal", "Qt Linux 64-bit Release (Perf)", "Qt Linux 64-bit Release (WebKit2 Perf)", "Qt Linux ARMv7 Release", - "Qt Windows 32-bit Release", "Qt Windows 32-bit Debug", "Qt SnowLeopard Release", + "Qt Windows 32-bit Release", "Qt Windows 32-bit Debug", "Qt Mountain Lion Release", "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release", "Chromium Android Release", "EFL Linux 64-bit Release", "EFL Linux 64-bit Debug", "EFL Linux 32-bit Release (Build)", "EFL Linux 64-bit Debug WK2", diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg index 546844b38..363e8921a 100644 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg @@ -107,6 +107,7 @@ class ConfigureBuild(buildstep.BuildStep): self.setProperty("configuration", self.configuration) self.setProperty("architecture", self.architecture) self.setProperty("buildOnly", self.buildOnly) + self.setProperty("shouldAbortEarly", True) self.finished(SUCCESS) return defer.succeed(None) @@ -298,9 +299,7 @@ class RunWebKitTests(shell.Test): "--build-number", WithProperties("%(buildnumber)s"), "--master-name", "webkit.org", "--test-results-server", "test-results.appspot.com", - WithProperties("--%(configuration)s"), - "--exit-after-n-crashes-or-timeouts", "20", - "--exit-after-n-failures", "500"] + WithProperties("--%(configuration)s")] def __init__(self, buildJSCTool=True, *args, **kwargs): self.buildJSCTool = buildJSCTool @@ -309,9 +308,13 @@ class RunWebKitTests(shell.Test): def start(self): platform = self.getProperty('platform') + shouldAbortEarly = self.getProperty('shouldAbortEarly') appendCustomBuildFlags(self, platform, self.getProperty('fullPlatform')) if platform.startswith('mac'): self.setCommand(self.command + ['--no-build']) + if shouldAbortEarly: + self.setCommand(self.command + ["--exit-after-n-crashes-or-timeouts", "20", "--exit-after-n-failures", "500"]) + if platform == "win": rootArgument = ['--root=' + os.path.join("WebKitBuild", self.getProperty('configuration'), "bin")] self.setCommand(self.command + ['--no-build']) @@ -351,7 +354,7 @@ class RunWebKitTests(shell.Test): expressions = [ ('flakes', re.compile(r'[Uu]nexpected flakiness.+:?\s*\((\d+)\)')), ('new passes', re.compile(r'Expected to .+, but passed:\s+\((\d+)\)')), - ('missing results', re.compile(r'(no expected results found|missing results)\s*:\s+\((\d+)\)')), + ('missing results', re.compile(r'(?:no expected results found|missing results)\s*:\s+\((\d+)\)')), ('failures', re.compile(r'Regressions: [Uu]nexpected.+:?\s*\((\d+)\)')), ] testFailures = {} @@ -596,6 +599,7 @@ class RunWebKitLeakTests(RunWebKitTests): class RunWebKit2Tests(RunWebKitTests): def start(self): + self.setProperty("shouldAbortEarly", False) self.setCommand(self.command + ["--webkit-test-runner"]) return RunWebKitTests.start(self) diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py b/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py index 813ff22d6..857344005 100755 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py @@ -5,6 +5,10 @@ import os import StringIO import unittest +# Show DepricationWarnings come from buildbot - it isn't default with Python 2.7 or newer. +# See https://bugs.webkit.org/show_bug.cgi?id=90161 for details. +import warnings +warnings.simplefilter('default') class BuildBotConfigLoader(object): def _add_webkitpy_to_sys_path(self): diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html b/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html index 0180eab0c..467f24016 100755 --- a/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html +++ b/Tools/BuildSlaveSupport/build.webkit.org-config/templates/root.html @@ -24,6 +24,7 @@ <li><a href="results">Test Results</a></li> <li><a href="LeaksViewer">Leaks Viewer</a></li> <li><a href="TestFailures">Test Failures</a></li> + <li><a href="http://webkit-perf.appspot.com/">Perf-o-matic</a> (external website) results submitted by <a href="http://build.webkit.org/waterfall?show=Apple%20Lion%20Release%20%28Perf%29&show=Chromium%20Linux%20Release%20%28Perf%29&show=Chromium%20Mac%20Release%20%28Perf%29&show=Chromium%20Win%20Release%20%28Perf%29&show=Qt%20Linux%2064-bit%20Release%20%28Perf%29&show=Qt%20Linux%2064-bit%20Release%20%28WebKit2%20Perf%29">performance bots</a></li> </ul> </body> </html> diff --git a/Tools/BuildSlaveSupport/built-product-archive b/Tools/BuildSlaveSupport/built-product-archive index ac9ae3d50..6c4c8eede 100644 --- a/Tools/BuildSlaveSupport/built-product-archive +++ b/Tools/BuildSlaveSupport/built-product-archive @@ -145,7 +145,7 @@ def archiveBuiltProduct(configuration, platform, fullPlatform): if platform == 'qt' or platform == 'efl': neededDirectories = ["bin", "lib"] elif platform == 'gtk': - neededDirectories = ["Programs", ".libs", "Libraries"] + neededDirectories = ["Programs", ".libs", "Libraries", "TestNetscapePlugin"] for dirname in neededDirectories: fromDir = os.path.join(configurationBuildDirectory, dirname, ".") diff --git a/Tools/CLWrapper/CLWrapper.vcproj b/Tools/CLWrapper/CLWrapper.vcproj index 844d72a7c..3563692b3 100644 --- a/Tools/CLWrapper/CLWrapper.vcproj +++ b/Tools/CLWrapper/CLWrapper.vcproj @@ -60,6 +60,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" OutputFile="$(OutDir)\cl.exe" LinkIncremental="2" GenerateDebugInformation="true" @@ -134,6 +135,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" OutputFile="$(OutDir)\cl.exe" LinkIncremental="1" GenerateDebugInformation="true" diff --git a/Tools/ChangeLog b/Tools/ChangeLog index f8a5d2e64..a3cb05bd9 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,1309 @@ +2012-08-21 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed build fix for newer Qt 5: The meaning of private_includes changed to be fully + self-contained. The module name is not appended automatically anymore. + + * qmake/qt_webkit.pri: + +2012-08-20 Xianzhu Wang <wangxianzhu@chromium.org> + + [Chromium-Android] Add stop_when_done parameter to ChromiumAndroidDriver.run_test() + https://bugs.webkit.org/show_bug.cgi?id=94558 + + Reviewed by Dirk Pranke. + + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidDriver.run_test): + +2012-08-20 Ryosuke Niwa <rniwa@webkit.org> + + Cleanup TestExpectationParser.parse + https://bugs.webkit.org/show_bug.cgi?id=94545 + + Reviewed by Dirk Pranke. + + Refactor TestExpectations to simplify the code. + + * Scripts/webkitpy/layout_tests/models/test_expectations.py: + (TestExpectationParser.parse): Merged _tokenize_list. + (TestExpectationParser._parse_line): Removed the call to _check_modifiers_against_expectations + since the check is now done in _parser_modifiers. + (TestExpectationParser._parse_modifiers): Merged _check_modifiers_against_expectations. + (TestExpectationParser._tokenize_line): Renamed from _tokenize. + (TestExpectationParser._split_space_separated): No longer calls lower() on all modifiers. + This is done on a local variable in _parse_modifiers, preserving the original case. + (TestExpectations.remove_rebaselined_tests.without_rebaseline_modifier): Check the existence + of 'rebaseline' against parsed modifiers. + * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: + (TestExpectationParserTests._tokenize): + (TestExpectationParserTests.test_tokenize_valid_with_comment): Preserves case. + (TestExpectationParserTests.test_tokenize_valid_with_multiple_modifiers): Ditto. + (TestExpectationSerializerTests._tokenize): + (TestExpectationSerializerTests.assert_list_round_trip): Call parse since _tokenize_list has + been merged into parse. + * Scripts/webkitpy/tool/commands/queries_unittest.py: + (PrintExpectationsTest.test_csv): Preserves the case. + +2012-08-20 Gustavo Noronha Silva <gns@gnome.org> + + [jhbuild] EFL now runs jhbuild update for every build + https://bugs.webkit.org/show_bug.cgi?id=94267 + + Reviewed by Martin Robinson. + + Try to fix WinCE build by returning the empty string instead of + env when no jhbuild infrastructure is found. + + * Scripts/webkitdirs.pm: + (jhbuildWrapperPrefixIfNeeded): + +2012-08-20 Benjamin Poulain <benjamin@webkit.org> + + Add a watcher for WTF changes + + Unreviewed. + + Add myself as a watcher for changes in WTF. + + * Scripts/webkitpy/common/config/watchlist: + +2012-08-20 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [EFL] Move jhbuild dependencies based on SVN to tarballs + https://bugs.webkit.org/show_bug.cgi?id=90374 + + Reviewed by Kenneth Rohde Christiansen. + + Moved all the dependencies based on SVN to tarballs taken from a + equivalent snapshot from the official git mirror. This will make + update-webkitefl not dependent on network connection after the first + run. The bots will not fail if EFL SVN server in unreachable. + The reason why git mirror is not used directly is to minimize the + total size of source code we need to download. + + * efl/jhbuild.modules: + +2012-08-20 Simon Fraser <simon.fraser@apple.com> + + Lots of "error, test and reference image have different properties" in pixel test output + https://bugs.webkit.org/show_bug.cgi?id=92578 + + Reviewed by Dirk Pranke. + + Improve ImageDiff's error reporting when test result image and expected image + differ in their properties. + + * DumpRenderTree/cg/ImageDiffCG.cpp: + +2012-08-20 Nate Chapin <japhet@chromium.org> + + Unsafe vsprintf usage in TestNetscapePlugin + https://bugs.webkit.org/show_bug.cgi?id=94522 + + Reviewed by Adam Barth. + + * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp: + (pluginLogWithArguments): Using vsnprintf instead of vsprintf to ensure we don't overflow + the message buffer. + (testDocumentOpen): + (testWindowOpen): + +2012-08-20 George Staikos <staikos@webkit.org> + + [BlackBerry] Enable XHR Response BLOB + https://bugs.webkit.org/show_bug.cgi?id=94525 + + Reviewed by Rob Buis. + + Turn on the XHR response blob feature for the BlackBerry port. + + * Scripts/webkitperl/FeatureList.pm: Add the feature and enable it. + +2012-08-20 Dirk Pranke <dpranke@chromium.org> + + Fix change for timeout detection to not crash if we have no output :) + https://bugs.webkit.org/show_bug.cgi?id=94505 + + Unreviewed, build fix. + + * Scripts/webkitpy/layout_tests/port/driver.py: + (Driver.run_test): + +2012-08-20 Dirk Pranke <dpranke@chromium.org> + + temporarily disable ImageDiff on WK2 ports for ref tests + https://bugs.webkit.org/show_bug.cgi?id=94517 + + Reviewed by Brady Eidson. + + ImageDiff appears to be unable to handle the pngs returned from + WebKitTestRunner, so we disable checking images by default + for ref tests on wk2 ports (unless pixel tests is explicitly enabled). + + * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py: + (SingleTestRunner._compare_output_with_reference): + +2012-08-20 Dirk Pranke <dpranke@chromium.org> + + Add missing FIXME: to previous change. + https://bugs.webkit.org/show_bug.cgi?id=94505 + + Reviewed by Ojan Vafai. + + * Scripts/webkitpy/layout_tests/port/driver.py: + (Driver.run_test): + +2012-08-20 Dirk Pranke <dpranke@chromium.org> + + Intermittenly, many WebKit2 tests have results from the wrong test compared to the test just run, giving false failures. + https://bugs.webkit.org/show_bug.cgi?id=94505 + + Reviewed by Ojan Vafai. + + It looks like if the webprocess times out, WTR may tell NRWT + that the test completed, but not properly reset its internal + state, and then return stale output for subsequent tests. + + This patch modifies NRWT temporarily to check for + "Timed out waiting for final message from web process" in stdout + and treat that as a timeout (and thus kill WTR); this seems + to solve the cascade of failures, but of course there's probably + still a bug in WTR that needs to be fixed. + + * Scripts/webkitpy/layout_tests/port/driver.py: + (Driver.run_test): + +2012-08-20 Dirk Pranke <dpranke@chromium.org> + + NRWT reports unexpected EOF + https://bugs.webkit.org/show_bug.cgi?id=94387 + + Reviewed by Adam Barth. + + Stop logging "Unexpected EOF" when we are reading the last few + bytes from stdout/stderr after stopping the subprocess. + + * Scripts/webkitpy/layout_tests/port/server_process.py: + (ServerProcess._wait_for_data_and_update_buffers_using_select): + (ServerProcess.stop): + +2012-08-20 Brady Eidson <beidson@apple.com> + + Temporarily disable the 20+ crash and 500+ failure options on WK2 bots. + https://bugs.webkit.org/show_bug.cgi?id=94506 + + Reviewed by Dirk Pranke. + + When running WK2 tests, don't add the "abort early" command line options. + + * BuildSlaveSupport/build.webkit.org-config/master.cfg: + (ConfigureBuild.start): + (RunWebKitTests): + (RunWebKitTests.start): + (RunWebKit2Tests.start): + +2012-08-19 Stephanie Lewis <slewis@apple.com> + + Add mountain lion to build config. + https://bugs.webkit.org/show_bug.cgi?id=94441 + + Reviewed by Adam Barth. + + Add Mountain Lion to the build trigger configurations. + + * Scripts/webkitpy/common/config/build.py: + (_should_file_trigger_build): + * Scripts/webkitpy/common/config/build_unittest.py: + (ShouldBuildTest): + (ShouldBuildTest.test_should_build): + +2012-08-17 Kiran Muppala <cmuppala@apple.com> + + Add self to webkit contributors list + https://bugs.webkit.org/show_bug.cgi?id=94409 + + Reviewed by Dirk Pranke. + + Add name, email and irc handle to webkit contributors list. + + * Scripts/webkitpy/common/config/committers.py: + +2012-08-17 Ryosuke Niwa <rniwa@webkit.org> + + Perfalizer should differentiate results with and without the patch + https://bugs.webkit.org/show_bug.cgi?id=94399 + + Reviewed by Dirk Pranke. + + Add "with 12345" and "without 12345" descriptions in results JSON so that graphs in + the results page are labled accordingly. + + Also use _build_without_patch when building without a patch so that we get the right error message. + + * Scripts/webkitpy/tool/commands/perfalizer.py: + (PerfalizerTask.run): + (PerfalizerTask._run_perf_test): + * Scripts/webkitpy/tool/commands/perfalizer_unittest.py: + (PerfalizerTaskTest._create_and_run_perfalizer.run_perf_test): + +2012-08-17 Dirk Pranke <dpranke@chromium.org> + + nrwt: don't fail tests if ImageDiff fails on the wk2 ports + https://bugs.webkit.org/show_bug.cgi?id=94396 + + Reviewed by Ryosuke Niwa. + + It appears that WTR is generating PNGs that ImageDiff doesn't + like, and so we're getting lots of "can not get ImageDiff" + errors (see bug 81962). The change in r124581 made this a test + failure, and this is causing the WK2 bots to frequently abort + with 500+ failures. + + This change makes ImageDiff errors not be test failures just for + WK2 for now until we can better triage what's going on. + + * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py: + (SingleTestRunner._compare_image): + +2012-08-17 James Robinson <jamesr@chromium.org> + + [chromium] Add a style check for #include "cc/..." in chromium files + https://bugs.webkit.org/show_bug.cgi?id=94382 + + Reviewed by Adam Barth. + + Adds a style check to make sure new chromium code follows the correct convention for including cc files. + + * Scripts/webkitpy/style/checkers/cpp.py: + (check_include_line): + * Scripts/webkitpy/style/checkers/cpp_unittest.py: + (OrderOfIncludesTest.test_check_cc_includes): + +2012-08-17 Ojan Vafai <ojan@chromium.org> + + Delete some dead code from the flakiness dashboard + https://bugs.webkit.org/show_bug.cgi?id=94380 + + Reviewed by Dirk Pranke. + + This code became dead in one of the refactors of how we handle BuilderGroups. + There's no bug here, it's just dead code. + * TestResultServer/static-dashboards/builders.js: + (requestBuilderList): + (loadBuildersList): + +2012-08-17 Jochen Eisinger <jochen@chromium.org> + + [chromium] Add content shell bots to the flakiness dashboard + https://bugs.webkit.org/show_bug.cgi?id=94369 + + Reviewed by Ojan Vafai. + + The bots are named $OS (Content Shell). + + * TestResultServer/static-dashboards/builders.js: + (isChromiumWebkitTipOfTreeTestRunner): + * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js: + +2012-08-17 Shadi Khalek <shadi@chromium.org> + + Add AV perf layout tests to webkit flakiness dashboard + https://bugs.webkit.org/show_bug.cgi?id=94255 + + Reviewed by Ojan Vafai. + + Added missing mappings to LEGACY_BUILDER_MASTERS_TO_GROUPS. + The isChromiumDepsAVTestRunner() filter does not work on current builder names. + It assumes the new names they are getting renamed to (AV Linux, AV Win7). + + * TestResultServer/static-dashboards/builders.js: + (isChromiumTipOfTreeAVTestRunner): + (loadBuildersList): + +2012-08-17 Milian Wolff <milian.wolff@kdab.com> + + [Qt] QtWebKit fails to build with OpenGL support on QNX + https://bugs.webkit.org/show_bug.cgi?id=93278 + + Reviewed by Noam Rosenthal. + + Change the order in which we define WTF_USE_3D_GRAPHICS and ENABLE_WEBGL. + First, we now defined WTF_USE_3D_GRAPHICS=1, but only if QT_CONFIG + contains opengl. Furthermore, we disable this feature on win32-* as usual, + but now also disable it on QNX. + + Then, we set ENABLE_WEBGL=1 but only if we previously set WTF_USE_3D_GRAPHICS=1. + + * qmake/mkspecs/features/features.prf: + +2012-08-16 Gustavo Noronha Silva <gns@gnome.org> + + [jhbuild] EFL now runs jhbuild update for every build + https://bugs.webkit.org/show_bug.cgi?id=94267 + + Reviewed by Dirk Pranke. + + This change makes EFL's approach to jhbuild more in line with the one + used by WebKitGTK+. update-webkitefl-libs will only be called by build- + webkit if --update-efl is given explicitly. The EWS bot will do that + from now on. + + * Scripts/webkitdirs.pm: + (jhbuildWrapperPrefixIfNeeded): return jhbuild wrapper only if the + Dependencies directory exists also for EFL + (generateBuildSystemFromCMakeProject): no longer run update-webkitefl-libs + (buildCMakeProjectOrExit): build update-webkitefl-libs if --update-efl is + given + * Scripts/webkitpy/common/config/ports.py: + (EflPort.build_webkit_command): make EWS bots pass --update-efl to build-webkit + * Scripts/webkitpy/common/config/ports_unittest.py: + (DeprecatedPortTest.test_efl_port): add unit testing for EFL port + +2012-08-16 Kent Tamura <tkent@chromium.org> + + Add forms-bugs@chromium.org as a contributor. + + * Scripts/webkitpy/common/config/committers.py: + +2012-08-16 Gustavo Noronha Silva <gns@gnome.org> + + Unreviewed warning fix, sys.argv is a python construct. + + * Scripts/update-webkitefl-libs: + +2012-08-16 Dirk Pranke <dpranke@chromium.org> + + NRWT cutting off the output from LayoutTest run under Valgrind + https://bugs.webkit.org/show_bug.cgi?id=94011 + + Reviewed by Ojan Vafai. + + Make NRWT work with valgrind again ... I needed to rework the + driver infrastructure so that we could get the stderr written + between a test completing and a process being stopped and + associate it with the DriverOutput for the test; this meant that + run_test() needed to stop the driver at the end of the test + directly if/when appropriate. This also entailed reworking + run_test() so that we would gather stderr and stdout + consistently regardless of whether this was a normal test, or + stop_when_done, or a crash or timeout. + + Also, I had to rework the process_stop_time() (and renamed it to + driver_stop_timeout) so that it would be longer if --time-out-ms + was long as well (so that valgrind would get enough time to + run), and I reworked driver.stop(kill_directly=True) to just + driver.stop(timeout=0.0). + + Lastly, adding the new stop_when_done parameter entailed + touching a lot of test mock functions :(. + + This change appeared to be well-covered by existing tests. + + * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py: + (Worker._run_test): + (Worker._run_test_with_timeout): + (Worker._run_test_in_another_thread): + (Worker._run_test_in_another_thread.SingleTestThread.run): + (Worker._run_test_in_this_thread): + (Worker._run_single_test): + * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py: + (run_single_test): + (SingleTestRunner.__init__): + (SingleTestRunner._run_compare_test): + (SingleTestRunner._run_rebaseline): + (SingleTestRunner._run_reftest): + * Scripts/webkitpy/layout_tests/port/base.py: + (Port.driver_stop_timeout): + (Port.variable.default_configuration): + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidPort.driver_stop_timeout): + (ChromiumAndroidDriver.stop): + * Scripts/webkitpy/layout_tests/port/driver.py: + (Driver.run_test): + (Driver.stop): + (DriverProxy.run_test): + * Scripts/webkitpy/layout_tests/port/driver_unittest.py: + (DriverTest.test_check_for_driver_crash.FakeServerProcess.stop): + * Scripts/webkitpy/layout_tests/port/server_process.py: + (ServerProcess.write): + (ServerProcess._wait_for_data_and_update_buffers_using_select): + (ServerProcess.stop): + (ServerProcess.kill): + (ServerProcess): + (ServerProcess._kill): + * Scripts/webkitpy/layout_tests/port/server_process_unittest.py: + (TrivialMockPort.__init__): + (MockProc.wait): + (TestServerProcess.test_basic): + * Scripts/webkitpy/layout_tests/port/test.py: + (TestDriver.run_test): + * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: + (get_tests_run.RecordingTestDriver.run_test): + * Scripts/webkitpy/performance_tests/perftest.py: + (PerfTest.run_single): + * Scripts/webkitpy/performance_tests/perftest_unittest.py: + (TestPageLoadingPerfTest.MockDriver.run_test): + (TestReplayPerfTest.ReplayTestPort.__init__.ReplayTestDriver.run_test): + (TestReplayPerfTest.test_run_single.run_test): + (TestReplayPerfTest.test_run_single_fails_when_output_has_error.run_test): + (TestReplayPerfTest.test_prepare.run_test): + * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py: + (MainTest.TestDriver.run_test): + +2012-08-16 Roger Fong <roger_fong@apple.com> + + Typo in old-run-webkit-tests script from https://bugs.webkit.org/show_bug.cgi?id=93904. + https://bugs.webkit.org/show_bug.cgi?id=94228 + + Reviewed by Tim Horton. + + I previously made the change but made a typo that causes the script not ignore mismatch ref tests. + + * Scripts/old-run-webkit-tests: + (isUsedInReftest): + +2012-08-16 Peter Beverloo <peter@chromium.org> + + [Chromium] Pass the --strip-binary argument to the apk test generator + https://bugs.webkit.org/show_bug.cgi?id=94224 + + Reviewed by Adam Barth. + + The native test generator currently relies on the $STRIP environment + variable to be available, which it shouldn't do. Instead, pass it as an + argument to the script. The $STRIP variable is being deprecated. + + * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: + * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp: + +2012-08-16 Xiaobo Wang <xbwang@torchmobile.com.cn> + + [BlackBerry] Update format of JS console message to keep consistent with other ports. + https://bugs.webkit.org/show_bug.cgi?id=94058 + + Reviewed by Yong Li. + Reviewed internally by George Staikos. + + 1. Remove line number if it's zero. + 2. Print only file name for "file://" URL. + + * DumpRenderTree/blackberry/DumpRenderTree.cpp: + (BlackBerry::WebKit::DumpRenderTree::addMessageToConsole): + +2012-08-16 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Make DRT results more reliable on X11 + + Reviewed by Jocelyn Turcotte. + + Disable desktop setting awareness, to prevent QApplication on X11 from reading palette settings from + the running desktop environment. + + * DumpRenderTree/qt/main.cpp: + (main): + +2012-08-16 Pierre Rossi <pierre.rossi@gmail.com> + + [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code + https://bugs.webkit.org/show_bug.cgi?id=93960 + + Reviewed by Simon Hausmann. + + Following the removal of Qt 4 support from trunk in r124879. + + * qmake/mkspecs/features/features.prf: + +2012-08-16 Taiju Tsuiki <tzik@chromium.org> + + Add deleteFileSystem support to DumpRenderTree for chromium + https://bugs.webkit.org/show_bug.cgi?id=94071 + + Reviewed by Kent Tamura. + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::deleteFileSystem): Added + * DumpRenderTree/chromium/WebViewHost.h: + (WebViewHost): + +2012-08-15 Ryosuke Niwa <rniwa@webkit.org> + + Rename LayoutTestController to TestRunner in WebKitTestRunner + https://bugs.webkit.org/show_bug.cgi?id=93942 + + Reviewed by Simon Fraser. + + Renamed the class and relevant files. + + * WebKitTestRunner/CMakeLists.txt: + * WebKitTestRunner/DerivedSources.make: + * WebKitTestRunner/GNUmakefile.am: + * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Removed. + * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Copied from Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl. + * WebKitTestRunner/InjectedBundle/DerivedSources.pri: + * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: + (WTR::InjectedBundle::didReceiveMessage): + (WTR::InjectedBundle::beginTesting): + * WebKitTestRunner/InjectedBundle/InjectedBundle.h: + (WTR::InjectedBundle::testRunner): + (InjectedBundle): + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: + * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Removed. + * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Removed. + * WebKitTestRunner/InjectedBundle/Target.pri: + * WebKitTestRunner/InjectedBundle/TestRunner.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp. + * WebKitTestRunner/InjectedBundle/TestRunner.h: Copied from Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h. + (TestRunner): + * WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp: Removed. + * WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp. + (WTR::waitToDumpWatchdogTimerCallback): + (WTR::TestRunner::platformInitialize): + (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer): + (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): + (WTR::TestRunner::pathToLocalResource): + (WTR::TestRunner::platformName): + * WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp: Removed. + * WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp. + (WTR::waitToDumpWatchdogTimerCallback): + (WTR::TestRunner::platformInitialize): + (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer): + (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): + (WTR::TestRunner::pathToLocalResource): + (WTR::TestRunner::platformName): + * WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm: Removed. + * WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm: Copied from Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm. + (WTR::TestRunner::platformInitialize): + (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer): + (WTR::waitUntilDoneWatchdogTimerFired): + (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): + (WTR::TestRunner::pathToLocalResource): + (WTR::TestRunner::platformName): + * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp: Removed. + * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp. + (WTR::WatchdogTimerHelper::timerFired): + (WTR::TestRunner::platformInitialize): + (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer): + (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): + (WTR::TestRunner::pathToLocalResource): + (WTR::TestRunner::platformName): + * WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp: Removed. + * WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp. + (WTR::TestRunner::platformInitialize): + (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer): + (WTR::waitToDumpWatchdogTimerFired): + (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): + (WTR::TestRunner::pathToLocalResource): + (WTR::TestRunner::platformName): + * WebKitTestRunner/PlatformEfl.cmake: + * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: + * WebKitTestRunner/win/InjectedBundle.vcproj: + +2012-08-15 Xianzhu Wang <wangxianzhu@chromium.org> + + [Chromium-Android] DumpRenderTree timeouts before NRWT timeouts + https://bugs.webkit.org/show_bug.cgi?id=94155 + + Reviewed by Dirk Pranke. + + * Scripts/webkitpy/layout_tests/port/chromium_android.py: + (ChromiumAndroidPort.create_driver): Force no_timeout=True + +2012-08-15 Ryosuke Niwa <rniwa@webkit.org> + + Add a hyperlink to perf-o-matic from build.webkit.org/root.html + https://bugs.webkit.org/show_bug.cgi?id=93749 + + Reviewed by Csaba Osztrogonác. + + Added the hyperlink to webkit-perf.appspot.com. Also added hyperlinks to the waterfall display + of performance tests. + + * BuildSlaveSupport/build.webkit.org-config/templates/root.html: + +2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> + + [css3-text] Add CSS3 Text decoration compile flag + https://bugs.webkit.org/show_bug.cgi?id=93863 + + Reviewed by Julien Chaffraix. + + This patch handles the compile flag implementation, which will come disabled by + default, thus not exposing the CSS3 text decoration features to the web, unless + when explicitly enabling it with "--css3-text-decoration" build parameter. + + * Scripts/webkitperl/FeatureList.pm: + * qmake/mkspecs/features/features.pri: + +2012-08-15 Beth Dakin <bdakin@apple.com> + + https://bugs.webkit.org/show_bug.cgi?id=93693 + [WK2] REGRESSION(125091): pixel results don't sow scrollbars + anymore + + Reviewed by Sam Weinig. + + Use new API WKBundlePageCreateSnapshotWithOptions(). + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: + (WTR::InjectedBundlePage::dump): + +2012-08-15 Alexey Proskuryakov <ap@apple.com> + + Add rfong to Bugzilla CC "contributor" list. + + * Scripts/webkitpy/common/config/committers.py: + +2012-08-15 Scott Graham <scottmg@chromium.org> + + Rename window.internals.fastMallocStatistics to mallocStatistics + https://bugs.webkit.org/show_bug.cgi?id=94033 + + Reviewed by Adam Barth. + + * GNUmakefile.am: + * Scripts/webkitpy/performance_tests/perftest.py: + (PerfTest): + * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py: + (test_run_memory_test): + +2012-08-15 Peter Beverloo <peter@chromium.org> + + Fix a warning in TestWebKitAPI's MediaTime test-suite + https://bugs.webkit.org/show_bug.cgi?id=94096 + + Reviewed by Adam Barth. + + This warning is visible when building the file with certain GCC versions, + including the one used by Chromium for Android. The warning is visible in + the cr-android build bot output: + + MediaTime.cpp:152: warning: this decimal constant is unsigned only in ISO C90 + + * TestWebKitAPI/Tests/WTF/MediaTime.cpp: + (TestWebKitAPI::TEST): + +2012-08-15 Kevin Funk <kevin.funk@kdab.com> + + Fix the 'git log' call in VCSUtils.pm for Windows + https://bugs.webkit.org/show_bug.cgi?id=94113 + + Reviewed by Kenneth Rohde Christiansen. + + Failed because of invalid enquoting characters. + + * Scripts/VCSUtils.pm: + +2012-08-14 Gustavo Noronha Silva <gns@gnome.org> + + [jhbuild] move md5sum checking to update-webkit-libs-jhbuild + https://bugs.webkit.org/show_bug.cgi?id=93208 + + Reviewed by Martin Robinson. + + This change makes the md5sum check and saving be done by the script + that performs the dependencies update. build-webkit no longer prefixes + calls to commands with jhbuild-wrapper if jhbuild has not been + bootstrapped by the developer and --update-gtk is not given. + + * Scripts/update-webkit-libs-jhbuild: + (getMD5HashForFile): moved from webkitdirs. + (jhbuildConfigurationChanged): ditto. + (saveJhbuildMd5): ditto. + (cleanJhbuild): ditto, and changed to run jhbuild clean before removing + jhbuild. + * Scripts/webkitdirs.pm: + (runAutogenForAutotoolsProjectIfNecessary): use jhbuildWrapperPrefixIfNeeded. + (buildAutotoolsProject): ditto. + (jhbuildWrapperPrefixIfNeeded): add a code branch for GTK+. + (generateBuildSystemFromCMakeProject): call update-webkitefl-libs + unconditionally for EFL. + * jhbuild/jhbuild-wrapper: + (update_webkit_libs_jhbuild): removed, jhbuild-wrapper no longer runs the + update script itself + (ensure_jhbuild): remove update call. + +2012-08-15 Christophe Dumez <christophe.dumez@intel.com> + + [WK2] Add support for Web Intents MessagePorts + https://bugs.webkit.org/show_bug.cgi?id=89072 + + Reviewed by Kenneth Rohde Christiansen. + + Use WKBundleIntent instead of WebIntentData in + WebKitTestRunner. WTR now prints the number of + MessagePorts in received Web intents as + expected by the following layout tests: + webintents/web-intents-invoke-port.html + webintents/web-intents-obj-constructor.html + + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: + (WTR::InjectedBundlePage::didReceiveIntentForFrame): + * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: + (WTR::LayoutTestController::deliverWebIntent): + +2012-08-14 Ryosuke Niwa <rniwa@webkit.org> + + Build fix after r125516. Revert the erroneous rename since we need to keep exposing + layoutTestController in Chromium port as explained r124785. + + * DumpRenderTree/chromium/TestShell.cpp: + (TestShell::bindJSObjectsToWindow): + +2012-08-14 Dan Bernstein <mitz@apple.com> + + fast/events/overflow-scroll-fake-mouse-move.html and fast/events/frame-scroll-fake-mouse-move.html are failing in WebKit1 + https://bugs.webkit.org/show_bug.cgi?id=94045 + + Reviewed by Geoff Garen. + + * DumpRenderTree/mac/DumpRenderTreeWindow.mm: + (-[DumpRenderTreeWindow _hasKeyAppearance]): Added. Returns [self isKeyWindow]. This is + needed now that WebView uses -_hasKeyAppearance instead of -isKeyWindow. + +2012-08-14 Alexey Proskuryakov <ap@apple.com> + + [WK2] Fix some typos in MiniBrowser + https://bugs.webkit.org/show_bug.cgi?id=94047 + + Reviewed by Jon Honeycutt. + + * MiniBrowser/mac/AppDelegate.m: + (didReceiveMessageFromInjectedBundle): (-[BrowserAppDelegate init]): + * MiniBrowser/mac/WebBundle/WebBundleMain.m: + (didReceiveMessage): + (WKBundleInitialize): + +2012-08-14 Roger Fong <roger_fong@apple.com> + + old-run-webkit-tests should skip all file extensions for ref tests, not just .html. + https://bugs.webkit.org/show_bug.cgi?id=93904 + + Reviewed by Tim Horton. + + old-run-webkit-tests ref test only skipped .html test. + They need to skip .html, .shtml, .xml, .xhtml, .pl, .htm, .php, .svg, .mht. + + * Scripts/old-run-webkit-tests: + (isUsedInReftest): Skip all extensions for ref tests. + +2012-08-14 Lauro Neto <lauro.neto@openbossa.org> + + Convert signals/slots to Q_* macros. + + [Qt] Use Q_SLOTS and Q_SIGNALS instead of slots and signals + https://bugs.webkit.org/show_bug.cgi?id=93996 + + Reviewed by Kenneth Rohde Christiansen. + + Change usage of keyword-conflicting 'signals' and 'slots' for + Q_SIGNALS and Q_SLOTS macro. + + * DumpRenderTree/qt/DumpRenderTreeQt.h: + (NetworkAccessManager): + (WebPage): + * DumpRenderTree/qt/EventSenderQt.h: + (EventSender): + * DumpRenderTree/qt/GCControllerQt.h: + (GCController): + * DumpRenderTree/qt/TestRunnerQt.h: + (TestRunner): + * DumpRenderTree/qt/TextInputControllerQt.h: + (TextInputController): + * MiniBrowser/qt/BrowserWindow.h: + (BrowserWindow): + * MiniBrowser/qt/MiniBrowserApplication.h: + (WindowOptions): + * MiniBrowser/qt/UrlLoader.h: + (UrlLoader): + * QtTestBrowser/cookiejar.h: + (TestBrowserCookieJar): + * QtTestBrowser/fpstimer.h: + (FpsTimer): + * QtTestBrowser/launcherwindow.h: + (LauncherWindow): + * QtTestBrowser/locationedit.h: + (LocationEdit): + * QtTestBrowser/mainwindow.h: + (MainWindow): + * QtTestBrowser/urlloader.h: + (UrlLoader): + * QtTestBrowser/webinspector.h: + (WebInspector): + * QtTestBrowser/webpage.h: + (WebPage): + * QtTestBrowser/webview.h: + (WebViewGraphicsBased): + * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp: + (WatchdogTimerHelper): + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WrapperWindow): + * WebKitTestRunner/qt/main.cpp: + (Launcher): + +2012-08-14 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks + https://bugs.webkit.org/show_bug.cgi?id=42332 + + Reviewed by Kenneth Rohde Christiansen. + + Added Resource Callbacks logging. Several aux dumping functions are added. + + * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: + (WTR::isFileScheme): + (WTR): + (WTR::pathSuitableForTestResult): + (WTR::urlSuitableForTestResult): + (WTR::InjectedBundlePage::resetAfterTest): + (WTR::dumpRequestDescriptionSuitableForTestResult): + (WTR::dumpResponseDescriptionSuitableForTestResult): + (WTR::dumpErrorDescriptionSuitableForTestResult): + (WTR::InjectedBundlePage::didInitiateLoadForResource): + (WTR::InjectedBundlePage::willSendRequestForFrame): + (WTR::InjectedBundlePage::didReceiveResponseForResource): + (WTR::InjectedBundlePage::didFinishLoadForResource): + (WTR::InjectedBundlePage::didFailLoadForResource): + * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: + (WTR::LayoutTestController::LayoutTestController): + * WebKitTestRunner/InjectedBundle/LayoutTestController.h: + (WTR::LayoutTestController::dumpResourceLoadCallbacks): + (WTR::LayoutTestController::shouldDumpResourceLoadCallbacks): + (LayoutTestController): + +2012-08-14 Alexis Menard <alexis.menard@openbossa.org> + + Update INdT build bot to Mountain Lion. + https://bugs.webkit.org/show_bug.cgi?id=93963 + + Reviewed by Csaba Osztrogonác. + + We updated the machine as well as the OS as the Qt port is now running + on top of Qt5. + + * BuildSlaveSupport/build.webkit.org-config/config.json: + +2012-08-14 Peter Beverloo <peter@chromium.org> + + [Chromium] Remove unneeded build logic for Android + https://bugs.webkit.org/show_bug.cgi?id=93962 + + Reviewed by Dimitri Glazkov. + + The Android SDK and NDK have been checked in to the Chromium tree, which + allows WebKit to leverage those as well. They will already be pulled in + through a DEPS change made last week, and by not setting the ANDROID_NDK_ROOT + environment variable, the envsetup.sh will set the project files up + appropriately for us. + + * Scripts/webkitdirs.pm: + +2012-08-14 Sergio Villar Senin <svillar@igalia.com> + + [WK2] [GTK] Plugin tests failing in WK2 bot + https://bugs.webkit.org/show_bug.cgi?id=93954 + + Reviewed by Carlos Garcia Campos. + + Plugin tests are failing in the WK2 bot because we aren't exporting + the Netscape plugin when creating the product archive. + + * BuildSlaveSupport/built-product-archive: added TestNetscapePlugin + to the list of directories to export. + (archiveBuiltProduct): + +2012-08-14 Peter Beverloo <peter@chromium.org> + + [Chromium] Fix apk generation for the Android platform + https://bugs.webkit.org/show_bug.cgi?id=93841 + + Unreviewed build fix. + + APK generation was broken as the configuration file assumed compilation + would only occur in the Chromium tree. Pass the path to Chromium's source + base directory as a property to ant. + + * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: + * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp: + +2012-08-14 Sergio Villar Senin <svillar@igalia.com> + + [GTK] REGRESSION (r122428) WebKit2APITests/TestWebKitFindController fails "next" test + https://bugs.webkit.org/show_bug.cgi?id=91083 + + Reviewed by Carlos Garcia Campos. + + Unskipped a couple of API tests that should work fine from now on. + + * Scripts/run-gtk-tests: + (TestRunner): + +2012-08-14 Kristóf Kosztyó <kkristof@inf.u-szeged.hu> + + [NRWT] Compare results between different platforms + https://bugs.webkit.org/show_bug.cgi?id=90555 + + Reviewed by Dirk Pranke. + + * Scripts/webkitpy/layout_tests/port/base.py: + (Port.baseline_search_path): + (Port): + (Port.compare_baseline): + * Scripts/webkitpy/layout_tests/run_webkit_tests.py: + (parse_args): + +2012-08-13 Ryosuke Niwa <rniwa@webkit.org> + + Rename LayoutTestController to TestRunner in DumpRenderTree + https://bugs.webkit.org/show_bug.cgi?id=93758 + + Reviewed by Tony Chang. + + Renamed LayoutTestController to TestRunner. For Chromium port, it's renamed to DRTTestRunner + since it already has TestRunner class shared between DumpRenderTree and content_shell. + + * DumpRenderTree/DumpRenderTree.h: + * DumpRenderTree/PixelDumpSupport.cpp: + * DumpRenderTree/StorageTrackerDelegate.h: + * DumpRenderTree/StorageTrackerDelegate.mm: + * DumpRenderTree/TestRunner.cpp: + * DumpRenderTree/TestRunner.h: + * DumpRenderTree/blackberry/DumpRenderTree.cpp: + * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: + * DumpRenderTree/chromium/DRTTestRunner.cpp: + * DumpRenderTree/chromium/DRTTestRunner.h: + * DumpRenderTree/chromium/DumpRenderTree.cpp: + * DumpRenderTree/chromium/NotificationPresenter.h: + * DumpRenderTree/chromium/TestShell.cpp: + * DumpRenderTree/chromium/TestShell.h: + * DumpRenderTree/chromium/WebPermissions.cpp: + * DumpRenderTree/chromium/WebPermissions.h: + * DumpRenderTree/chromium/WebViewHost.cpp: + * DumpRenderTree/chromium/WebViewHost.h: + * DumpRenderTree/efl/DumpRenderTree.cpp: + * DumpRenderTree/efl/DumpRenderTreeChrome.cpp: + * DumpRenderTree/efl/DumpRenderTreeView.cpp: + * DumpRenderTree/efl/EditingCallbacks.cpp: + * DumpRenderTree/efl/TestRunnerEfl.cpp: + * DumpRenderTree/gtk/DumpRenderTree.cpp: + * DumpRenderTree/gtk/EditingCallbacks.cpp: + * DumpRenderTree/gtk/TestRunnerGtk.cpp: + * DumpRenderTree/mac/DumpRenderTree.mm: + * DumpRenderTree/mac/DumpRenderTreeWindow.mm: + * DumpRenderTree/mac/EditingDelegate.mm: + * DumpRenderTree/mac/FrameLoadDelegate.mm: + * DumpRenderTree/mac/HistoryDelegate.mm: + * DumpRenderTree/mac/PixelDumpSupportMac.mm: + * DumpRenderTree/mac/PolicyDelegate.h: + * DumpRenderTree/mac/PolicyDelegate.mm: + * DumpRenderTree/mac/ResourceLoadDelegate.mm: + * DumpRenderTree/mac/TestRunnerMac.mm: + * DumpRenderTree/mac/UIDelegate.mm: + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + * DumpRenderTree/qt/DumpRenderTreeQt.h: + * DumpRenderTree/qt/TestRunnerQt.cpp: + * DumpRenderTree/qt/TestRunnerQt.h: + * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp: + * DumpRenderTree/win/DumpRenderTree.cpp: + * DumpRenderTree/win/EditingDelegate.cpp: + * DumpRenderTree/win/FrameLoadDelegate.cpp: + * DumpRenderTree/win/HistoryDelegate.cpp: + * DumpRenderTree/win/PolicyDelegate.h: + * DumpRenderTree/win/ResourceLoadDelegate.cpp: + * DumpRenderTree/win/TestRunnerWin.cpp: + * DumpRenderTree/win/UIDelegate.cpp: + * DumpRenderTree/wx/DumpRenderTreeWx.cpp: + * DumpRenderTree/wx/TestRunnerWx.cpp: + +2012-08-14 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> + + [GTK] String returned by g_path_get_dirname() must be freed + https://bugs.webkit.org/show_bug.cgi?id=93885 + + Reviewed by Philippe Normand. + + Fix a memory leak in GTK's DRT code. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (pathFromSoupURI): Free the string returned by g_path_get_dirname(). + +2012-08-14 Zan Dobersek <zandobersek@gmail.com> + + Unreviewed GTK build fix after r125508. + + Do the renaming in GNUmakefile.am as well, LayoutTestController -> TestRunner. + + * GNUmakefile.am: + +2012-08-13 Ryosuke Niwa <rniwa@webkit.org> + + Rename files that declare and define LayoutTestController in DumpRenderTree + https://bugs.webkit.org/show_bug.cgi?id=93899 + + Reviewed by Tony Chang. + + Renamed files and fixed style errors. + + * DumpRenderTree/DumpRenderTree.gypi: + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/LayoutTestController.cpp: Removed. + * DumpRenderTree/LayoutTestController.h: Removed. + * DumpRenderTree/PixelDumpSupport.cpp: + * DumpRenderTree/StorageTrackerDelegate.mm: + * DumpRenderTree/TestRunner.cpp: Copied from Tools/DumpRenderTree/LayoutTestController.cpp. + * DumpRenderTree/TestRunner.h: Copied from Tools/DumpRenderTree/LayoutTestController.h. + (LayoutTestController): + * DumpRenderTree/blackberry/DumpRenderTree.cpp: + * DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp: Removed. + * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: Copied from Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp. + * DumpRenderTree/chromium/DRTTestRunner.cpp: Copied from Tools/DumpRenderTree/chromium/LayoutTestController.cpp. + * DumpRenderTree/chromium/DRTTestRunner.h: Copied from Tools/DumpRenderTree/chromium/LayoutTestController.h. + * DumpRenderTree/chromium/LayoutTestController.cpp: Removed. + * DumpRenderTree/chromium/LayoutTestController.h: Removed. + * DumpRenderTree/chromium/TestShell.cpp: + * DumpRenderTree/chromium/TestShell.h: + * DumpRenderTree/chromium/WebPermissions.cpp: + * DumpRenderTree/chromium/WebViewHost.cpp: + * DumpRenderTree/efl/CMakeLists.txt: + * DumpRenderTree/efl/DumpRenderTree.cpp: + * DumpRenderTree/efl/DumpRenderTreeChrome.cpp: + * DumpRenderTree/efl/DumpRenderTreeView.cpp: + * DumpRenderTree/efl/EditingCallbacks.cpp: + * DumpRenderTree/efl/LayoutTestControllerEfl.cpp: Removed. + * DumpRenderTree/efl/TestRunnerEfl.cpp: Copied from Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp. + * DumpRenderTree/gtk/DumpRenderTree.cpp: + * DumpRenderTree/gtk/EditingCallbacks.cpp: + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Removed. + * DumpRenderTree/gtk/TestRunnerGtk.cpp: Copied from Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp. + * DumpRenderTree/mac/DumpRenderTree.mm: + * DumpRenderTree/mac/DumpRenderTreeWindow.mm: + * DumpRenderTree/mac/EditingDelegate.mm: + * DumpRenderTree/mac/FrameLoadDelegate.mm: + * DumpRenderTree/mac/HistoryDelegate.mm: + * DumpRenderTree/mac/LayoutTestControllerMac.mm: Removed. + * DumpRenderTree/mac/PixelDumpSupportMac.mm: + * DumpRenderTree/mac/PolicyDelegate.mm: + * DumpRenderTree/mac/ResourceLoadDelegate.mm: + * DumpRenderTree/mac/TestRunnerMac.mm: Copied from Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm. + * DumpRenderTree/mac/UIDelegate.mm: + * DumpRenderTree/qt/DumpRenderTree.pro: + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Removed. + * DumpRenderTree/qt/LayoutTestControllerQt.h: Removed. + * DumpRenderTree/qt/TestRunnerQt.cpp: Copied from Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp. + * DumpRenderTree/qt/TestRunnerQt.h: Copied from Tools/DumpRenderTree/qt/LayoutTestControllerQt.h. + (WebCore): + (LayoutTestController): + (LayoutTestController::setCloseRemainingWindowsWhenComplete): + (LayoutTestController::dumpSelectionRect): + (LayoutTestController::setCallCloseOnWebViews): + (LayoutTestController::addDisallowedURL): + (LayoutTestController::abortModal): + * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp: + * DumpRenderTree/win/DumpRenderTree.cpp: + * DumpRenderTree/win/DumpRenderTree.vcproj: + * DumpRenderTree/win/EditingDelegate.cpp: + * DumpRenderTree/win/FrameLoadDelegate.cpp: + * DumpRenderTree/win/HistoryDelegate.cpp: + * DumpRenderTree/win/LayoutTestControllerWin.cpp: Removed. + * DumpRenderTree/win/PolicyDelegate.cpp: + * DumpRenderTree/win/ResourceLoadDelegate.cpp: + * DumpRenderTree/win/TestRunnerWin.cpp: Copied from Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp. + (LayoutTestController::setUserStyleSheetEnabled): + (resolveCygwinPath): + * DumpRenderTree/win/UIDelegate.cpp: + * DumpRenderTree/wscript: + * DumpRenderTree/wx/DumpRenderTreeWx.cpp: + * DumpRenderTree/wx/LayoutTestControllerWx.cpp: Removed. + * DumpRenderTree/wx/TestRunnerWx.cpp: Copied from Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp. + +2012-08-13 Alex Christensen <alex.christensen@flexsim.com> + + Windows 64 bit compliance + https://bugs.webkit.org/show_bug.cgi?id=93275 + + Reviewed by Brent Fulgham. + + Fixed a few compile and link problems for Win64 + + * WinLauncher/WinLauncher.cpp: + * win/DLLLauncher/DLLLauncherMain.cpp: + +2012-08-13 MORITA Hajime <morrita@google.com> + + Unreviewed update for webcomponents-bugzilla address. + + * Scripts/webkitpy/common/config/committers.py: + +2012-08-11 Raphael Kubo da Costa <rakuco@webkit.org> + + [CMake] Rewrite FindLibSoup2.cmake. + https://bugs.webkit.org/show_bug.cgi?id=93191 + + Reviewed by Rob Buis. + + * DumpRenderTree/efl/CMakeLists.txt: Use LIBSOUP_FOO instead of + LIBSOUP24_FOO, and do not use LIBSOUP24_LDFLAGS, as it is not + needed anymore. + * EWebLauncher/CMakeLists.txt: Ditto. + * MiniBrowser/efl/CMakeLists.txt: Ditto. + * TestWebKitAPI/PlatformEfl.cmake: Ditto. + * WebKitTestRunner/CMakeLists.txt: Ditto. + * WebKitTestRunner/PlatformEfl.cmake: Ditto. + +2012-08-13 Brady Eidson <beidson@apple.com> + + With asynchronous plug-in initialization, WebProcess and PluginProcess can deadlock + <rdar://problem/12062125> and https://bugs.webkit.org/show_bug.cgi?id=93894 + + Reviewed by Alexey Proskuryakov. + + Add a test that calls out to NPP_Evaluate for some JS inside of NPP_New. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp: Added. + (EvaluteJSWithinNPP_New): + (EvaluteJSWithinNPP_New::EvaluteJSWithinNPP_New): + (EvaluteJSWithinNPP_New::NPP_New): + +2012-08-13 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r125422. + http://trac.webkit.org/changeset/125422 + https://bugs.webkit.org/show_bug.cgi?id=93902 + + Broke the Android canary build (Requested by fmalita on + #webkit). + + * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: + * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp: + +2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org> + + [CMake] Remove glib-related Find modules and write single new one instead. + https://bugs.webkit.org/show_bug.cgi?id=93786 + + Reviewed by Rob Buis. + + * DumpRenderTree/efl/CMakeLists.txt: Use GLIB_* instead of Glib_*. + * EWebLauncher/CMakeLists.txt: Ditto. + * MiniBrowser/efl/CMakeLists.txt: Ditto. + * WebKitTestRunner/PlatformEfl.cmake: Ditto. + +2012-08-13 Peter Beverloo <peter@chromium.org> + + [Chromium] Fix apk generation for the Android platform + https://bugs.webkit.org/show_bug.cgi?id=93841 + + Reviewed by Dimitri Glazkov. + + APK generation was broken as the configuration file assumed compilation + would only occur in the Chromium tree. Pass the path to Chromium's source + base directory as a property to ant. + + * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: + * TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp: + +2012-08-13 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [WK2] [WTR] InjectedBundlePage::didFailLoadForResource invokes wrong callback + https://bugs.webkit.org/show_bug.cgi?id=93825 + + Reviewed by Antonio Gomes. + + Corrected from didFinishLoadForResource() invoke to didFailLoadForResource() invoke. + + * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: + (WTR::InjectedBundlePage::didFailLoadForResource): + +2012-08-13 Kwang Yul Seo <skyul@company100.net> + + [Qt] Add gprof.prf to build WebKit with gprof enabled + https://bugs.webkit.org/show_bug.cgi?id=90283 + + Reviewed by Eric Seidel. + + * qmake/mkspecs/features/functions.prf: + gprof does not support profiling a shared library. + To profile WebKit, applications must link QtWebKit statically. + + * qmake/mkspecs/features/gprof.prf: Added. + Add -pg option to both QMAKE_CXXFLAGS and QMAKE_LFLAGS. + +2012-08-13 KwangYong Choi <ky0.choi@samsung.com> + + [TestNetscapePlugin][X11] Additional key up event handler routine is required + https://bugs.webkit.org/show_bug.cgi?id=91357 + + Reviewed by Eric Seidel. + + Fixed key up event handler routine to pass http/tests/plugins/plugin-document- + has-focus.html on X11 architecture. The test can not be done without this patch. + All other ports implemented it already. + + * DumpRenderTree/TestNetscapePlugIn/main.cpp: + (handleEventX11): Modified key up event handler for X11 + +2012-08-13 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2] Replace Skipped list by TestExpectations + https://bugs.webkit.org/show_bug.cgi?id=93796 + + Reviewed by Kenneth Rohde Christiansen. + + Enable cascaded TestExpectations for EFL port so + that we can use TestExpectations in WK2-EFL. + + * Scripts/webkitpy/layout_tests/port/efl.py: + (EflPort._search_paths): + (EflPort): + (EflPort.expectations_files): + +2012-08-13 Peter Gal <galpeter@inf.u-szeged.hu> + + REGRESSION(r125153): It broke the 'Unexpected no expected results' case + https://bugs.webkit.org/show_bug.cgi?id=93789 + + Reviewed by Csaba Osztrogonác. + + Fix the regex, so the text won't be a capturing group. + + * BuildSlaveSupport/build.webkit.org-config/master.cfg: + (RunWebKitTests._parseNewRunWebKitTestsOutput): + +2012-08-12 MORITA Hajime <morrita@google.com> + + Unreviewed, added a proxy address to contributors_who_are_not_committers. + + * Scripts/webkitpy/common/config/committers.py: + +2012-08-12 Loïc Yhuel <loic.yhuel@softathome.com> + + [Qt] Make it possible to build without QtTest/QtPrintSupport + https://bugs.webkit.org/show_bug.cgi?id=93492 + + Reviewed by Tor Arne Vestbø. + + * DumpRenderTree/qt/DumpRenderTree.pro: Optional printsupport + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebCore): + (WebCore::DumpRenderTree::dryRunPrint): Does nothing if no printsupport + * QtTestBrowser/QtTestBrowser.pro: Optional printsupport + * QtTestBrowser/launcherwindow.cpp: + (LauncherWindow::createChrome): No print menu if no printsupport + (LauncherWindow::print): Does nothing if no printsupport + * QtTestBrowser/launcherwindow.h: + * Tools.pro: Disable DRT/WTR if QtTest not present + * qmake/mkspecs/features/default_pre.prf: printsupport no more mandatory + * qmake/mkspecs/features/features.prf: Qt module availability tests + +2012-08-12 Csaba Osztrogonác <ossy@webkit.org> + + master.cfg unittest cleanup: Show DeprecationWarnings with python >= 2.7 too + https://bugs.webkit.org/show_bug.cgi?id=90161 + + Reviewed by Eric Seidel. + + * BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: + 2012-08-12 Simon Hausmann <simon.hausmann@nokia.com> [Qt] Unreviewed trivial build fix: Newer Qt versions don't implicitly include qwindowsysteminterface.h diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp index f04708322..8277ce35f 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp +++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp @@ -464,6 +464,13 @@ '<(PRODUCT_DIR)/lib.java/chromium_net.jar', '<(PRODUCT_DIR)/lib.java/chromium_media.jar', ], + 'conditions': [ + ['inside_chromium_build==1', { + 'ant_build_to_chromium_src': '<(ant_build_out)/../../', + }, { + 'ant_build_to_chromium_src': '<(chromium_src_dir)', + }], + ], }, # Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi. # Not including it because gyp include doesn't support variable in path or under @@ -488,6 +495,7 @@ '"<@(input_jars_paths)"', '--output', '<(PRODUCT_DIR)/DumpRenderTree_apk', + '--strip-binary=<(android_strip)', '--ant-args', '-DANDROID_SDK=<(android_sdk)', '--ant-args', @@ -500,6 +508,8 @@ '-DANDROID_TOOLCHAIN=<(android_toolchain)', '--ant-args', '-DPRODUCT_DIR=<(ant_build_out)', + '--ant-args', + '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)', '--sdk-build=<(sdk_build)', '--app_abi', '<(android_app_abi)', diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi index 996c83d87..cfc478ec9 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gypi +++ b/Tools/DumpRenderTree/DumpRenderTree.gypi @@ -6,8 +6,8 @@ 'chromium/DRTDevToolsClient.cpp', 'chromium/DRTDevToolsClient.h', 'chromium/DumpRenderTree.cpp', - 'chromium/LayoutTestController.cpp', - 'chromium/LayoutTestController.h', + 'chromium/DRTTestRunner.cpp', + 'chromium/DRTTestRunner.h', 'chromium/MockGrammarCheck.cpp', 'chromium/MockGrammarCheck.h', 'chromium/MockSpellCheck.cpp', diff --git a/Tools/DumpRenderTree/DumpRenderTree.h b/Tools/DumpRenderTree/DumpRenderTree.h index 18d8cda0e..4c6a47210 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.h +++ b/Tools/DumpRenderTree/DumpRenderTree.h @@ -55,12 +55,12 @@ std::wstring urlSuitableForTestResult(const std::wstring& url); #endif -class LayoutTestController; +class TestRunner; extern volatile bool done; // FIXME: This is a bad abstraction. We should insted pass this to other controller objects which need access to it. -extern RefPtr<LayoutTestController> gLayoutTestController; +extern RefPtr<TestRunner> gTestRunner; void dump(); void displayWebView(); diff --git a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj index b7904f6e3..c2ac67940 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj +++ b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ 515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */; }; 5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; }; 5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; }; + 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */; }; 53CBB832134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */; }; 53CBB833134E42F3001CE6A4 /* CyclicRedundancyCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */; }; 5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */ = {isa = PBXBuildFile; fileRef = AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */; }; @@ -105,8 +106,8 @@ AE8259F308D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; AE8259F408D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; B5A752A208AF5D1F00138E45 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; }; - BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* LayoutTestController.cpp */; }; - BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* LayoutTestController.h */; }; + BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* TestRunner.cpp */; }; + BC0131DB0C9772010087317D /* TestRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* TestRunner.h */; }; 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 */; }; @@ -116,7 +117,7 @@ BC9D90250C97472E0099A4A3 /* WorkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9D90220C97472E0099A4A3 /* WorkQueue.h */; }; BC9D90260C97472E0099A4A3 /* WorkQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */; }; BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B210C9B014B00114369 /* GCControllerMac.mm */; }; - BCA18B240C9B014B00114369 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */; }; + BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B220C9B014B00114369 /* TestRunnerMac.mm */; }; BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */; }; BCA18B310C9B01B400114369 /* ObjCController.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA18B2F0C9B01B400114369 /* ObjCController.h */; }; BCA18B320C9B01B400114369 /* ObjCController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B300C9B01B400114369 /* ObjCController.m */; }; @@ -283,6 +284,7 @@ 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableObjectOverridesAllProperties.cpp; sourceTree = "<group>"; }; 5185F69E10714A57007AA393 /* HistoryDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryDelegate.h; path = mac/HistoryDelegate.h; sourceTree = "<group>"; }; 5185F69F10714A57007AA393 /* HistoryDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = HistoryDelegate.mm; path = mac/HistoryDelegate.mm; sourceTree = "<group>"; }; + 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EvaluateJSWithinNPP_New.cpp; path = TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp; sourceTree = SOURCE_ROOT; }; 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CyclicRedundancyCheck.cpp; sourceTree = "<group>"; }; 53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicRedundancyCheck.h; sourceTree = "<group>"; }; 5DE8AE4313A2C15800D6A37D /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -308,8 +310,8 @@ AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; B5A7526708AF4A4A00138E45 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; }; B5A752A108AF5D1F00138E45 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; }; - BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; }; - BC0131D90C9772010087317D /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; }; + 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>"; }; 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>"; }; @@ -320,7 +322,7 @@ 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>"; }; BCA18B210C9B014B00114369 /* GCControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = GCControllerMac.mm; path = mac/GCControllerMac.mm; sourceTree = "<group>"; }; - BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; }; + BCA18B220C9B014B00114369 /* TestRunnerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerMac.mm; path = mac/TestRunnerMac.mm; sourceTree = "<group>"; }; BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = WorkQueueItemMac.mm; path = mac/WorkQueueItemMac.mm; sourceTree = "<group>"; }; BCA18B2F0C9B01B400114369 /* ObjCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ObjCController.h; path = mac/ObjCController.h; sourceTree = "<group>"; }; BCA18B300C9B01B400114369 /* ObjCController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ObjCController.m; path = mac/ObjCController.m; sourceTree = "<group>"; }; @@ -498,9 +500,9 @@ BCF6C64F0C98E9C000AC063E /* GCController.cpp */, 14770FE00A22ADF7009342EE /* GCController.h */, BCA18B210C9B014B00114369 /* GCControllerMac.mm */, - BC0131D80C9772010087317D /* LayoutTestController.cpp */, - BC0131D90C9772010087317D /* LayoutTestController.h */, - BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */, + BC0131D80C9772010087317D /* TestRunner.cpp */, + BC0131D90C9772010087317D /* TestRunner.h */, + BCA18B220C9B014B00114369 /* TestRunnerMac.mm */, E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */, E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */, BCA18B6D0C9B08DB00114369 /* NavigationController.h */, @@ -541,6 +543,7 @@ 1A31EB3613466AC100017372 /* mac */, 1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */, C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */, + 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */, 4AD6A11313C8124000EA9737 /* FormValue.cpp */, 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */, 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */, @@ -713,7 +716,7 @@ BCA18B630C9B08C200114369 /* FrameLoadDelegate.h in Headers */, 14770FE20A22ADF7009342EE /* GCController.h in Headers */, BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */, - BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */, + BC0131DB0C9772010087317D /* TestRunner.h in Headers */, BCA18B710C9B08DB00114369 /* NavigationController.h in Headers */, BCA18B310C9B01B400114369 /* ObjCController.h in Headers */, BCA18B7D0C9B08F100114369 /* ObjCPlugin.h in Headers */, @@ -906,6 +909,7 @@ 1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */, 515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */, 5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */, + 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -939,8 +943,8 @@ BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */, BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */, BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */, - BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */, - BCA18B240C9B014B00114369 /* LayoutTestControllerMac.mm in Sources */, + BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */, + BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */, BCA18B720C9B08DB00114369 /* NavigationController.m in Sources */, BCA18B320C9B01B400114369 /* ObjCController.m in Sources */, BCA18B7E0C9B08F100114369 /* ObjCPlugin.m in Sources */, diff --git a/Tools/DumpRenderTree/PixelDumpSupport.cpp b/Tools/DumpRenderTree/PixelDumpSupport.cpp index 1d53d589b..165291174 100644 --- a/Tools/DumpRenderTree/PixelDumpSupport.cpp +++ b/Tools/DumpRenderTree/PixelDumpSupport.cpp @@ -31,7 +31,7 @@ #include "CyclicRedundancyCheck.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <cstdio> #include <wtf/Assertions.h> #include <wtf/RefPtr.h> @@ -49,11 +49,11 @@ void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash) { RefPtr<BitmapContext> context; #if PLATFORM(MAC) - if (gLayoutTestController->isPrinting()) + if (gTestRunner->isPrinting()) context = createPagedBitmapContext(); else #endif - context = createBitmapContextFromWebView(gLayoutTestController->testOnscreen(), gLayoutTestController->testRepaint(), gLayoutTestController->testRepaintSweepHorizontally(), gLayoutTestController->dumpSelectionRect()); + context = createBitmapContextFromWebView(gTestRunner->testOnscreen(), gTestRunner->testRepaint(), gTestRunner->testRepaintSweepHorizontally(), gTestRunner->dumpSelectionRect()); ASSERT(context); // Compute the hash of the bitmap context pixels diff --git a/Tools/DumpRenderTree/StorageTrackerDelegate.h b/Tools/DumpRenderTree/StorageTrackerDelegate.h index e025a4476..73032ef59 100644 --- a/Tools/DumpRenderTree/StorageTrackerDelegate.h +++ b/Tools/DumpRenderTree/StorageTrackerDelegate.h @@ -23,15 +23,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -class LayoutTestController; +class TestRunner; @interface StorageTrackerDelegate : NSObject { unsigned numberOfNotificationsToLog; - LayoutTestController* controllerToNotifyDone; + TestRunner* controllerToNotifyDone; } -- (void)logNotifications:(unsigned)number controller:(LayoutTestController*)controller; +- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller; - (void)originModified:(NSNotification *)notification; -- (void)setControllerToNotifyDone:(LayoutTestController*)controller; +- (void)setControllerToNotifyDone:(TestRunner*)controller; @end diff --git a/Tools/DumpRenderTree/StorageTrackerDelegate.mm b/Tools/DumpRenderTree/StorageTrackerDelegate.mm index 343880ba1..121fa1753 100644 --- a/Tools/DumpRenderTree/StorageTrackerDelegate.mm +++ b/Tools/DumpRenderTree/StorageTrackerDelegate.mm @@ -26,7 +26,7 @@ #import "config.h" #import "StorageTrackerDelegate.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebStorageManagerPrivate.h> @@ -43,7 +43,7 @@ return self; } -- (void)logNotifications:(unsigned)number controller:(LayoutTestController*)controller +- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller { controllerToNotifyDone = controller; @@ -73,7 +73,7 @@ [super dealloc]; } -- (void)setControllerToNotifyDone:(LayoutTestController*)controller +- (void)setControllerToNotifyDone:(TestRunner*)controller { controllerToNotifyDone = controller; } diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp index 05f3a8c21..75631842f 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp @@ -60,23 +60,13 @@ static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, cons browser->releaseobject(consoleObject); } -// Helper function which takes in the plugin window object for logging to the console object. This function supports variable -// arguments. -static void pluginLogWithWindowObjectVariableArgs(NPObject* windowObject, NPP instance, const char* format, ...) -{ - va_list args; - va_start(args, format); - char message[2048] = "PLUGIN: "; - vsprintf(message + strlen(message), format, args); - va_end(args); - - pluginLogWithWindowObject(windowObject, instance, message); -} - void pluginLogWithArguments(NPP instance, const char* format, va_list args) { - char message[2048] = "PLUGIN: "; - vsprintf(message + strlen(message), format, args); + const size_t messageBufferSize = 2048; + char message[messageBufferSize] = "PLUGIN: "; + int messageLength = sizeof("PLUGIN: ") - 1; + messageLength += vsnprintf(message + messageLength, messageBufferSize - 1 - messageLength, format, args); + message[messageLength] = '\0'; NPObject* windowObject = 0; NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject); @@ -936,7 +926,7 @@ bool testDocumentOpen(NPP npp) return false; } - pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS"); + pluginLogWithWindowObject(windowObject, npp, "PLUGIN: DOCUMENT OPEN SUCCESS"); notifyTestCompletion(npp, result.value.objectValue); browser->releaseobject(result.value.objectValue); browser->releaseobject(windowObject); @@ -968,7 +958,7 @@ bool testWindowOpen(NPP npp) return false; } - pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS"); + pluginLogWithWindowObject(windowObject, npp, "PLUGIN: WINDOW OPEN SUCCESS"); notifyTestCompletion(npp, result.value.objectValue); browser->releaseobject(result.value.objectValue); browser->releaseobject(windowObject); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp new file mode 100644 index 000000000..c066db59f --- /dev/null +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp @@ -0,0 +1,56 @@ +/* + * 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" + +#include "PluginObject.h" + +using namespace std; + +// Executing JS within NPP_New when initializing asynchronously should not be able to deadlock with the WebProcess + +class EvaluteJSWithinNPP_New : public PluginTest { +public: + EvaluteJSWithinNPP_New(NPP, const string& identifier); + +private: + virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *); + +}; + +EvaluteJSWithinNPP_New::EvaluteJSWithinNPP_New(NPP npp, const string& identifier) + : PluginTest(npp, identifier) +{ +} + +NPError EvaluteJSWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) +{ + // Give the WebProcess enough time to be deadlocked waiting for the PluginProcess. + usleep(15000); + executeScript("var theLocation = window.location;"); + return NPERR_NO_ERROR; +} + +static PluginTest::Register<EvaluteJSWithinNPP_New> registrar("evalute-js-within-npp-new"); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp index fd92bfdac..97a4cf389 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp @@ -671,6 +671,11 @@ static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event) // FIXME: extract key code if (obj->eventLogging) pluginLog(instance, "keyUp '%c'", keyEventToChar(&event->xkey)); + if (obj->testKeyboardFocusForPlugins) { + obj->eventLogging = false; + obj->testKeyboardFocusForPlugins = FALSE; + executeScript(obj, "testRunner.notifyDone();"); + } break; case GraphicsExpose: if (obj->eventLogging) diff --git a/Tools/DumpRenderTree/LayoutTestController.cpp b/Tools/DumpRenderTree/TestRunner.cpp index 2bd2c9a09..229bf0680 100644 --- a/Tools/DumpRenderTree/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/TestRunner.cpp @@ -28,7 +28,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "WorkQueue.h" #include "WorkQueueItem.h" @@ -44,7 +44,7 @@ #include <wtf/OwnArrayPtr.h> #include <wtf/RefPtr.h> -LayoutTestController::LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash) +TestRunner::TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash) : m_disallowIncreaseForApplicationCacheQuota(false) , m_dumpApplicationCacheDelegateCallbacks(false) , m_dumpAsAudio(false) @@ -100,37 +100,37 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con { } -PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL, const std::string& expectedPixelHash) +PassRefPtr<TestRunner> TestRunner::create(const std::string& testPathOrURL, const std::string& expectedPixelHash) { - return adoptRef(new LayoutTestController(testPathOrURL, expectedPixelHash)); + return adoptRef(new TestRunner(testPathOrURL, expectedPixelHash)); } // Static Functions static JSValueRef disallowIncreaseForApplicationCacheQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDisallowIncreaseForApplicationCacheQuota(true); return JSValueMakeUndefined(context); } static JSValueRef dumpApplicationCacheDelegateCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpApplicationCacheDelegateCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpAsPDF(true); return JSValueMakeUndefined(context); } static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpAsText(true); // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode. @@ -141,119 +141,119 @@ static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function, static JSValueRef dumpBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpBackForwardList(true); return JSValueMakeUndefined(context); } static JSValueRef dumpChildFramesAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpChildFramesAsText(true); return JSValueMakeUndefined(context); } static JSValueRef dumpChildFrameScrollPositionsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpChildFrameScrollPositions(true); return JSValueMakeUndefined(context); } static JSValueRef dumpDatabaseCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpDatabaseCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpDOMAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpDOMAsWebArchive(true); return JSValueMakeUndefined(context); } static JSValueRef dumpEditingCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpEditingCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpFrameLoadCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpProgressFinishedCallbackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpProgressFinishedCallback(true); return JSValueMakeUndefined(context); } static JSValueRef dumpUserGestureInFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpUserGestureInFrameLoadCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpResourceLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpResourceLoadCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpResourceResponseMIMETypesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpResourceResponseMIMETypes(true); return JSValueMakeUndefined(context); } static JSValueRef dumpSelectionRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpSelectionRect(true); return JSValueMakeUndefined(context); } static JSValueRef dumpSourceAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpSourceAsWebArchive(true); return JSValueMakeUndefined(context); } static JSValueRef dumpStatusCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpStatusCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpTitleChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpTitleChanges(true); return JSValueMakeUndefined(context); } static JSValueRef dumpIconChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpIconChanges(true); return JSValueMakeUndefined(context); } static JSValueRef dumpWillCacheResponseCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpWillCacheResponse(true); return JSValueMakeUndefined(context); } @@ -263,7 +263,7 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> localPath(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); @@ -276,7 +276,7 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpVisitedLinksCallback(true); controller->removeAllVisitedLinks(); return JSValueMakeUndefined(context); @@ -284,7 +284,7 @@ static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRe static JSValueRef repaintSweepHorizontallyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTestRepaintSweepHorizontally(true); return JSValueMakeUndefined(context); } @@ -294,14 +294,14 @@ static JSValueRef setCallCloseOnWebViewsCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCallCloseOnWebViews(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } static JSValueRef setCanOpenWindowsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCanOpenWindows(true); return JSValueMakeUndefined(context); } @@ -311,7 +311,7 @@ static JSValueRef setCloseRemainingWindowsWhenCompleteCallback(JSContextRef cont if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCloseRemainingWindowsWhenComplete(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } @@ -328,7 +328,7 @@ static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef OwnArrayPtr<char> encodedAudioDataBuffer = adoptArrayPtr(new char[maxLength + 1]); JSStringGetUTF8CString(encodedAudioData.get(), encodedAudioDataBuffer.get(), maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setEncodedAudioData(encodedAudioDataBuffer.get()); controller->setDumpAsAudio(true); @@ -337,14 +337,14 @@ static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef static JSValueRef testOnscreenCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTestOnscreen(true); return JSValueMakeUndefined(context); } static JSValueRef testRepaintCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTestRepaint(true); return JSValueMakeUndefined(context); } @@ -358,7 +358,7 @@ static JSValueRef addDisallowedURLCallback(JSContextRef context, JSObjectRef fun JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addDisallowedURL(url.get()); return JSValueMakeUndefined(context); @@ -383,7 +383,7 @@ static JSValueRef addURLToRedirectCallback(JSContextRef context, JSObjectRef fun OwnArrayPtr<char> destinationBuffer = adoptArrayPtr(new char[maxLength + 1]); JSStringGetUTF8CString(destination.get(), destinationBuffer.get(), maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addURLToRedirect(originBuffer.get(), destinationBuffer.get()); return JSValueMakeUndefined(context); @@ -392,7 +392,7 @@ static JSValueRef addURLToRedirectCallback(JSContextRef context, JSObjectRef fun static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->callShouldCloseOnWebView()); } @@ -400,7 +400,7 @@ static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjec static JSValueRef clearAllApplicationCachesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearAllApplicationCaches(); return JSValueMakeUndefined(context); @@ -414,7 +414,7 @@ static JSValueRef clearApplicationCacheForOriginCallback(JSContextRef context, J JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearApplicationCacheForOrigin(originURL.get()); return JSValueMakeUndefined(context); @@ -428,21 +428,21 @@ static JSValueRef applicationCacheDiskUsageForOriginCallback(JSContextRef contex JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->applicationCacheDiskUsageForOrigin(originURL.get())); } static JSValueRef originsWithApplicationCacheCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return controller->originsWithApplicationCache(context); } static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearAllDatabases(); return JSValueMakeUndefined(context); @@ -450,7 +450,7 @@ static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef fu static JSValueRef syncLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->syncLocalStorage(); @@ -459,7 +459,7 @@ static JSValueRef syncLocalStorageCallback(JSContextRef context, JSObjectRef fun static JSValueRef observeStorageTrackerNotificationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); @@ -475,7 +475,7 @@ static JSValueRef observeStorageTrackerNotificationsCallback(JSContextRef contex static JSValueRef deleteAllLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->deleteAllLocalStorage(); return JSValueMakeUndefined(context); @@ -483,7 +483,7 @@ static JSValueRef deleteAllLocalStorageCallback(JSContextRef context, JSObjectRe static JSValueRef deleteLocalStorageForOriginCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); @@ -498,7 +498,7 @@ static JSValueRef deleteLocalStorageForOriginCallback(JSContextRef context, JSOb static JSValueRef localStorageDiskUsageForOriginCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); @@ -511,14 +511,14 @@ static JSValueRef localStorageDiskUsageForOriginCallback(JSContextRef context, J static JSValueRef originsWithLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return controller->originsWithLocalStorage(context); } static JSValueRef clearBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearBackForwardList(); return JSValueMakeUndefined(context); @@ -527,7 +527,7 @@ static JSValueRef clearBackForwardListCallback(JSContextRef context, JSObjectRef static JSValueRef clearPersistentUserStyleSheetCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearPersistentUserStyleSheet(); return JSValueMakeUndefined(context); @@ -542,7 +542,7 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> decodedHostName(Adopt, controller->copyDecodedHostName(name.get())); return JSValueMakeString(context, decodedHostName.get()); } @@ -550,7 +550,7 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation, needs windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->disableImageLoading(); return JSValueMakeUndefined(context); @@ -559,7 +559,7 @@ static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation, needs windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->dispatchPendingLoadRequests(); return JSValueMakeUndefined(context); @@ -568,7 +568,7 @@ static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSOb static JSValueRef displayCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->display(); return JSValueMakeUndefined(context); @@ -577,8 +577,8 @@ static JSValueRef displayCallback(JSContextRef context, JSObjectRef function, JS static JSValueRef displayInvalidatedRegionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); - // LayoutTestController::display() only renders the invalidated region so + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); + // TestRunner::display() only renders the invalidated region so // we can just use that. controller->display(); @@ -594,7 +594,7 @@ static JSValueRef encodeHostNameCallback(JSContextRef context, JSObjectRef funct JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> encodedHostName(Adopt, controller->copyEncodedHostName(name.get())); return JSValueMakeString(context, encodedHostName.get()); } @@ -618,7 +618,7 @@ static JSValueRef execCommandCallback(JSContextRef context, JSObjectRef function value.adopt(JSStringCreateWithUTF8CString("")); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->execCommand(name.get(), value.get()); return JSValueMakeUndefined(context); @@ -636,13 +636,13 @@ static JSValueRef findStringCallback(JSContextRef context, JSObjectRef function, JSObjectRef options = JSValueToObject(context, arguments[1], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->findString(context, target.get(), options)); } static JSValueRef goBackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->goBack(); return JSValueMakeUndefined(context); @@ -654,7 +654,7 @@ static JSValueRef grantDesktopNotificationPermissionCallback(JSContextRef contex if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->grantDesktopNotificationPermission(JSValueToStringCopy(context, arguments[0], NULL)); @@ -671,7 +671,7 @@ static JSValueRef isCommandEnabledCallback(JSContextRef context, JSObjectRef fun JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->isCommandEnabled(name.get())); } @@ -686,7 +686,7 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->overridePreference(key.get(), value.get()); return JSValueMakeUndefined(context); @@ -695,7 +695,7 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f static JSValueRef keepWebHistoryCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->keepWebHistory(); return JSValueMakeUndefined(context); @@ -707,14 +707,14 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context return JSValueMakeUndefined(context); // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return controller->computedStyleIncludingVisitedInfo(context, arguments[0]); } static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeString(context, controller->layerTreeAsText().get()); } @@ -722,15 +722,15 @@ static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, { // Has mac & windows implementation // May be able to be made platform independant by using shared WorkQueue - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->notifyDone(); return JSValueMakeUndefined(context); } static bool parsePageParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, float& pageWidthInPixels, float& pageHeightInPixels) { - pageWidthInPixels = LayoutTestController::maxViewWidth; - pageHeightInPixels = LayoutTestController::maxViewHeight; + pageWidthInPixels = TestRunner::maxViewWidth; + pageHeightInPixels = TestRunner::maxViewHeight; switch (argumentCount) { case 2: pageWidthInPixels = static_cast<float>(JSValueToNumber(context, arguments[0], exception)); @@ -828,13 +828,13 @@ static JSValueRef numberOfPagesCallback(JSContextRef context, JSObjectRef functi if (!parsePageParameters(context, argumentCount, arguments, exception, pageWidthInPixels, pageHeightInPixels)) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->numberOfPages(pageWidthInPixels, pageHeightInPixels)); } static JSValueRef numberOfPendingGeolocationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->numberOfPendingGeolocationPermissionRequests()); } @@ -845,7 +845,7 @@ static JSValueRef pagePropertyCallback(JSContextRef context, JSObjectRef functio if (!parsePagePropertyParameters(context, argumentCount, arguments, exception, propertyName, pageNumber)) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSValueRef value = JSValueMakeString(context, controller->pageProperty(propertyName, pageNumber).get()); delete[] propertyName; @@ -860,7 +860,7 @@ static JSValueRef pageSizeAndMarginsInPixelsCallback(JSContextRef context, JSObj if (!parsePageNumberSizeMarings(context, argumentCount, arguments, exception, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft)) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeString(context, controller->pageSizeAndMarginsInPixels(pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).get()); } @@ -874,7 +874,7 @@ static JSValueRef queueBackNavigationCallback(JSContextRef context, JSObjectRef double howFarBackDouble = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueBackNavigation(static_cast<int>(howFarBackDouble)); return JSValueMakeUndefined(context); @@ -890,7 +890,7 @@ static JSValueRef queueForwardNavigationCallback(JSContextRef context, JSObjectR double howFarForwardDouble = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueForwardNavigation(static_cast<int>(howFarForwardDouble)); return JSValueMakeUndefined(context); @@ -913,7 +913,7 @@ static JSValueRef queueLoadCallback(JSContextRef context, JSObjectRef function, } else target.adopt(JSStringCreateWithUTF8CString("")); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueLoad(url.get(), target.get()); return JSValueMakeUndefined(context); @@ -935,7 +935,7 @@ static JSValueRef queueLoadHTMLStringCallback(JSContextRef context, JSObjectRef } else baseURL.adopt(JSStringCreateWithUTF8CString("")); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount >= 3) { JSRetainPtr<JSStringRef> unreachableURL; @@ -954,7 +954,7 @@ static JSValueRef queueReloadCallback(JSContextRef context, JSObjectRef function // Has mac & windows implementation // May be able to be made platform independant by using shared WorkQueue - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueReload(); return JSValueMakeUndefined(context); @@ -970,7 +970,7 @@ static JSValueRef queueLoadingScriptCallback(JSContextRef context, JSObjectRef f JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueLoadingScript(script.get()); return JSValueMakeUndefined(context); @@ -986,7 +986,7 @@ static JSValueRef queueNonLoadingScriptCallback(JSContextRef context, JSObjectRe JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueNonLoadingScript(script.get()); return JSValueMakeUndefined(context); @@ -998,7 +998,7 @@ static JSValueRef setAcceptsEditingCallback(JSContextRef context, JSObjectRef fu if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAcceptsEditing(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1010,7 +1010,7 @@ static JSValueRef setAlwaysAcceptCookiesCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAlwaysAcceptCookies(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1022,7 +1022,7 @@ static JSValueRef setAppCacheMaximumSizeCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double size = JSValueToNumber(context, arguments[0], NULL); if (!isnan(size)) @@ -1037,7 +1037,7 @@ static JSValueRef setApplicationCacheOriginQuotaCallback(JSContextRef context, J if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double size = JSValueToNumber(context, arguments[0], NULL); if (!isnan(size)) @@ -1059,7 +1059,7 @@ static JSValueRef setAuthenticationPasswordCallback(JSContextRef context, JSObje char* passwordBuffer = new char[maxLength + 1]; JSStringGetUTF8CString(password.get(), passwordBuffer, maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAuthenticationPassword(passwordBuffer); delete[] passwordBuffer; @@ -1079,7 +1079,7 @@ static JSValueRef setAuthenticationUsernameCallback(JSContextRef context, JSObje char* usernameBuffer = new char[maxLength + 1]; JSStringGetUTF8CString(username.get(), usernameBuffer, maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAuthenticationUsername(usernameBuffer); delete[] usernameBuffer; @@ -1092,7 +1092,7 @@ static JSValueRef setAuthorAndUserStylesEnabledCallback(JSContextRef context, JS if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAuthorAndUserStylesEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1103,7 +1103,7 @@ static JSValueRef setAutofilledCallback(JSContextRef context, JSObjectRef functi if (argumentCount != 2 || !arguments[0]) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAutofilled(context, arguments[0], JSValueToBoolean(context, arguments[1])); return JSValueMakeUndefined(context); @@ -1118,7 +1118,7 @@ static JSValueRef setCacheModelCallback(JSContextRef context, JSObjectRef functi int cacheModel = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCacheModel(cacheModel); return JSValueMakeUndefined(context); @@ -1134,7 +1134,7 @@ static JSValueRef setCustomPolicyDelegateCallback(JSContextRef context, JSObject if (argumentCount >= 2) permissive = JSValueToBoolean(context, arguments[1]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]), permissive); return JSValueMakeUndefined(context); @@ -1146,7 +1146,7 @@ static JSValueRef setDatabaseQuotaCallback(JSContextRef context, JSObjectRef fun if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double quota = JSValueToNumber(context, arguments[0], NULL); if (!isnan(quota)) @@ -1161,7 +1161,7 @@ static JSValueRef setDeferMainResourceDataLoadCallback(JSContextRef context, JSO if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDeferMainResourceDataLoad(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1172,7 +1172,7 @@ static JSValueRef setDefersLoadingCallback(JSContextRef context, JSObjectRef fun if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDefersLoading(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1183,7 +1183,7 @@ static JSValueRef setUseDeferredFrameLoadingCallback(JSContextRef context, JSObj if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUseDeferredFrameLoading(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1195,7 +1195,7 @@ static JSValueRef setDomainRelaxationForbiddenForURLSchemeCallback(JSContextRef if (argumentCount < 2) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); bool forbidden = JSValueToBoolean(context, arguments[0]); JSRetainPtr<JSStringRef> scheme(Adopt, JSValueToStringCopy(context, arguments[1], 0)); @@ -1219,7 +1219,7 @@ static JSValueRef setMockDeviceOrientationCallback(JSContextRef context, JSObjec double gamma = JSValueToNumber(context, arguments[5], exception); ASSERT(!*exception); - LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); return JSValueMakeUndefined(context); @@ -1230,7 +1230,7 @@ static JSValueRef setMockGeolocationPositionCallback(JSContextRef context, JSObj if (argumentCount < 3) return JSValueMakeUndefined(context); - LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockGeolocationPosition(JSValueToNumber(context, arguments[0], NULL), // latitude JSValueToNumber(context, arguments[1], NULL), // longitude JSValueToNumber(context, arguments[2], NULL)); // accuracy @@ -1247,7 +1247,7 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject JSRetainPtr<JSStringRef> message(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockGeolocationError(code, message.get()); return JSValueMakeUndefined(context); @@ -1266,7 +1266,7 @@ static JSValueRef addMockSpeechInputResultCallback(JSContextRef context, JSObjec JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addMockSpeechInputResult(result.get(), confidence, language.get()); return JSValueMakeUndefined(context); @@ -1279,7 +1279,7 @@ static JSValueRef setMockSpeechInputDumpRectCallback(JSContextRef context, JSObj bool dumpRect = JSValueToBoolean(context, arguments[0]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockSpeechInputDumpRect(dumpRect); return JSValueMakeUndefined(context); @@ -1291,7 +1291,7 @@ static JSValueRef setNewWindowsCopyBackForwardListCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setNewWindowsCopyBackForwardList(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1303,7 +1303,7 @@ static JSValueRef setGeolocationPermissionCallback(JSContextRef context, JSObjec if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setGeolocationPermission(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1315,7 +1315,7 @@ static JSValueRef setHandlesAuthenticationChallengesCallback(JSContextRef contex if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setHandlesAuthenticationChallenges(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1326,7 +1326,7 @@ static JSValueRef setPOSIXLocaleCallback(JSContextRef context, JSObjectRef funct if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> locale(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); controller->setPOSIXLocale(locale.get()); @@ -1340,7 +1340,7 @@ static JSValueRef setIconDatabaseEnabledCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setIconDatabaseEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1352,7 +1352,7 @@ static JSValueRef setMainFrameIsFirstResponderCallback(JSContextRef context, JSO if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMainFrameIsFirstResponder(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1367,7 +1367,7 @@ static JSValueRef setPersistentUserStyleSheetLocationCallback(JSContextRef conte JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPersistentUserStyleSheetLocation(path.get()); return JSValueMakeUndefined(context); @@ -1379,7 +1379,7 @@ static JSValueRef setPrivateBrowsingEnabledCallback(JSContextRef context, JSObje if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPrivateBrowsingEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1391,7 +1391,7 @@ static JSValueRef setJavaScriptCanAccessClipboardCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setJavaScriptCanAccessClipboard(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1403,7 +1403,7 @@ static JSValueRef setXSSAuditorEnabledCallback(JSContextRef context, JSObjectRef if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setXSSAuditorEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1415,7 +1415,7 @@ static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSOb if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setSpatialNavigationEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1423,7 +1423,7 @@ static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSOb static JSValueRef setPrintingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setIsPrinting(true); return JSValueMakeUndefined(context); } @@ -1435,7 +1435,7 @@ static JSValueRef setFrameFlatteningEnabledCallback(JSContextRef context, JSObje if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setFrameFlatteningEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1447,7 +1447,7 @@ static JSValueRef setAllowUniversalAccessFromFileURLsCallback(JSContextRef conte if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAllowUniversalAccessFromFileURLs(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1459,7 +1459,7 @@ static JSValueRef setAllowFileAccessFromFileURLsCallback(JSContextRef context, J if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAllowFileAccessFromFileURLs(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1471,7 +1471,7 @@ static JSValueRef setTabKeyCyclesThroughElementsCallback(JSContextRef context, J if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTabKeyCyclesThroughElements(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1483,7 +1483,7 @@ static JSValueRef setUseDashboardCompatibilityModeCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUseDashboardCompatibilityMode(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1495,7 +1495,7 @@ static JSValueRef setUserStyleSheetEnabledCallback(JSContextRef context, JSObjec if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUserStyleSheetEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1510,7 +1510,7 @@ static JSValueRef setUserStyleSheetLocationCallback(JSContextRef context, JSObje JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUserStyleSheetLocation(path.get()); return JSValueMakeUndefined(context); @@ -1525,7 +1525,7 @@ static JSValueRef setValueForUserCallback(JSContextRef context, JSObjectRef func JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setValueForUser(context, arguments[0], value.get()); return JSValueMakeUndefined(context); @@ -1540,7 +1540,7 @@ static JSValueRef setViewModeMediaFeatureCallback(JSContextRef context, JSObject JSRetainPtr<JSStringRef> mode(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setViewModeMediaFeature(mode.get()); return JSValueMakeUndefined(context); @@ -1559,7 +1559,7 @@ static JSValueRef setWillSendRequestClearHeaderCallback(JSContextRef context, JS OwnArrayPtr<char> headerBuffer = adoptArrayPtr(new char[maxLength + 1]); JSStringGetUTF8CString(header.get(), headerBuffer.get(), maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWillSendRequestClearHeader(headerBuffer.get()); return JSValueMakeUndefined(context); @@ -1571,7 +1571,7 @@ static JSValueRef setWillSendRequestReturnsNullCallback(JSContextRef context, JS if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWillSendRequestReturnsNull(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1583,7 +1583,7 @@ static JSValueRef setWillSendRequestReturnsNullOnRedirectCallback(JSContextRef c if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWillSendRequestReturnsNullOnRedirect(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1595,7 +1595,7 @@ static JSValueRef setWindowIsKeyCallback(JSContextRef context, JSObjectRef funct if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWindowIsKey(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1604,7 +1604,7 @@ static JSValueRef setWindowIsKeyCallback(JSContextRef context, JSObjectRef funct static JSValueRef waitUntilDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWaitToDump(true); return JSValueMakeUndefined(context); @@ -1613,7 +1613,7 @@ static JSValueRef waitUntilDoneCallback(JSContextRef context, JSObjectRef functi static JSValueRef windowCountCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); int windows = controller->windowCount(); return JSValueMakeNumber(context, windows); } @@ -1624,7 +1624,7 @@ static JSValueRef setPopupBlockingEnabledCallback(JSContextRef context, JSObject if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPopupBlockingEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1636,7 +1636,7 @@ static JSValueRef setPluginsEnabledCallback(JSContextRef context, JSObjectRef fu if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPluginsEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1655,7 +1655,7 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu char* visibilityBuffer = new char[maxLength + 1]; JSStringGetUTF8CString(visibility.get(), visibilityBuffer, maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPageVisibility(visibilityBuffer); delete[] visibilityBuffer; @@ -1664,7 +1664,7 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu static JSValueRef resetPageVisibilityCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->resetPageVisibility(); return JSValueMakeUndefined(context); } @@ -1674,7 +1674,7 @@ static JSValueRef setSmartInsertDeleteEnabledCallback(JSContextRef context, JSOb if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setSmartInsertDeleteEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } @@ -1684,7 +1684,7 @@ static JSValueRef setAutomaticLinkDetectionEnabledCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAutomaticLinkDetectionEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } @@ -1694,14 +1694,14 @@ static JSValueRef setSelectTrailingWhitespaceEnabledCallback(JSContextRef contex if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setSelectTrailingWhitespaceEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } static JSValueRef setStopProvisionalFrameLoadsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setStopProvisionalFrameLoads(true); return JSValueMakeUndefined(context); } @@ -1711,28 +1711,28 @@ static JSValueRef setAsynchronousSpellCheckingEnabledCallback(JSContextRef conte if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAsynchronousSpellCheckingEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } static JSValueRef showWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->showWebInspector(); return JSValueMakeUndefined(context); } static JSValueRef closeWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->closeWebInspector(); return JSValueMakeUndefined(context); } static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double callId = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception)); @@ -1744,7 +1744,7 @@ static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectR static JSValueRef evaluateScriptInIsolatedWorldCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double worldID = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception)); @@ -1756,7 +1756,7 @@ static JSValueRef evaluateScriptInIsolatedWorldCallback(JSContextRef context, JS static JSValueRef evaluateScriptInIsolatedWorldAndReturnValueCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double worldID = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception)); @@ -1768,7 +1768,7 @@ static JSValueRef evaluateScriptInIsolatedWorldAndReturnValueCallback(JSContextR static JSValueRef elementDoesAutoCompleteForElementWithIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); @@ -1789,7 +1789,7 @@ static JSValueRef pauseAnimationAtTimeOnElementWithIdCallback(JSContextRef conte JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->pauseAnimationAtTimeOnElementWithId(animationName.get(), time, elementId.get())); } @@ -1805,7 +1805,7 @@ static JSValueRef pauseTransitionAtTimeOnElementWithIdCallback(JSContextRef cont JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->pauseTransitionAtTimeOnElementWithId(propertyName.get(), time, elementId.get())); } @@ -1814,13 +1814,13 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec if (argumentCount != 0) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->numberOfActiveAnimations()); } static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->waitForPolicyDelegate(); return JSValueMakeUndefined(context); } @@ -1838,7 +1838,7 @@ static JSValueRef addOriginAccessWhitelistEntryCallback(JSContextRef context, JS ASSERT(!*exception); bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains); return JSValueMakeUndefined(context); } @@ -1856,7 +1856,7 @@ static JSValueRef removeOriginAccessWhitelistEntryCallback(JSContextRef context, ASSERT(!*exception); bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->removeOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains); return JSValueMakeUndefined(context); } @@ -1871,7 +1871,7 @@ static JSValueRef setScrollbarPolicyCallback(JSContextRef context, JSObjectRef, JSRetainPtr<JSStringRef> policy(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setScrollbarPolicy(orientation.get(), policy.get()); return JSValueMakeUndefined(context); } @@ -1886,7 +1886,7 @@ static JSValueRef addUserScriptCallback(JSContextRef context, JSObjectRef, JSObj bool runAtStart = JSValueToBoolean(context, arguments[1]); bool allFrames = JSValueToBoolean(context, arguments[2]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addUserScript(source.get(), runAtStart, allFrames); return JSValueMakeUndefined(context); } @@ -1900,7 +1900,7 @@ static JSValueRef addUserStyleSheetCallback(JSContextRef context, JSObjectRef, J ASSERT(!*exception); bool allFrames = JSValueToBoolean(context, arguments[1]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addUserStyleSheet(source.get(), allFrames); return JSValueMakeUndefined(context); } @@ -1911,7 +1911,7 @@ static JSValueRef setShouldPaintBrokenImageCallback(JSContextRef context, JSObje if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setShouldPaintBrokenImage(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1928,14 +1928,14 @@ static JSValueRef apiTestNewWindowDataLoadBaseURLCallback(JSContextRef context, JSRetainPtr<JSStringRef> baseURL(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->apiTestNewWindowDataLoadBaseURL(utf8Data.get(), baseURL.get()); return JSValueMakeUndefined(context); } static JSValueRef apiTestGoToCurrentBackForwardItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->apiTestGoToCurrentBackForwardItem(); return JSValueMakeUndefined(context); } @@ -1946,7 +1946,7 @@ static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef f if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWebViewEditable(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1961,7 +1961,7 @@ static JSValueRef sendWebIntentResponseCallback(JSContextRef context, JSObjectRe } else response.adopt(JSStringCreateWithUTF8CString(0)); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->sendWebIntentResponse(response.get()); return JSValueMakeUndefined(context); @@ -1979,7 +1979,7 @@ static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef fun JSRetainPtr<JSStringRef> data(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->deliverWebIntent(action.get(), type.get(), data.get()); return JSValueMakeUndefined(context); @@ -1987,14 +1987,14 @@ static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef fun static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->abortModal(); return JSValueMakeUndefined(context); } static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); return JSValueMakeString(context, controller->markerTextForListItem(context, arguments[0]).get()); @@ -2013,7 +2013,7 @@ static JSValueRef authenticateSessionCallback(JSContextRef context, JSObjectRef, JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->authenticateSession(url.get(), username.get(), password.get()); return JSValueMakeUndefined(context); } @@ -2024,13 +2024,13 @@ static JSValueRef setSerializeHTTPLoadsCallback(JSContextRef context, JSObjectRe if (argumentCount == 1) serialize = JSValueToBoolean(context, arguments[0]); - LayoutTestController::setSerializeHTTPLoads(serialize); + TestRunner::setSerializeHTTPLoads(serialize); return JSValueMakeUndefined(context); } static JSValueRef setShouldStayOnPageAfterHandlingBeforeUnloadCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount == 1) controller->setShouldStayOnPageAfterHandlingBeforeUnload(JSValueToBoolean(context, arguments[0])); @@ -2040,7 +2040,7 @@ static JSValueRef setShouldStayOnPageAfterHandlingBeforeUnloadCallback(JSContext static JSValueRef addChromeInputFieldCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addChromeInputField(); // the first argument is a callback that is called once the input field has been added if (argumentCount == 1) @@ -2050,7 +2050,7 @@ static JSValueRef addChromeInputFieldCallback(JSContextRef context, JSObjectRef, static JSValueRef removeChromeInputFieldCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->removeChromeInputField(); // the first argument is a callback that is called once the input field has been added if (argumentCount == 1) @@ -2060,7 +2060,7 @@ static JSValueRef removeChromeInputFieldCallback(JSContextRef context, JSObjectR static JSValueRef focusWebViewCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->focusWebView(); // the first argument is a callback that is called once the input field has been added if (argumentCount == 1) @@ -2076,7 +2076,7 @@ static JSValueRef setBackingScaleFactorCallback(JSContextRef context, JSObjectRe double backingScaleFactor = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setBackingScaleFactor(backingScaleFactor); // The second argument is a callback that is called once the backing scale factor has been set. @@ -2093,26 +2093,26 @@ static JSValueRef preciseTimeCallback(JSContextRef context, JSObjectRef, JSObjec static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->globalFlag()); } static JSValueRef getWebHistoryItemCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->webHistoryItemCount()); } static JSValueRef getWorkerThreadCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->workerThreadCount()); } #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WIN) static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> platformName(controller->platformName()); if (!platformName.get()) return JSValueMakeUndefined(context); @@ -2122,28 +2122,28 @@ static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef this static JSValueRef getTitleTextDirectionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> titleDirection(Adopt, JSStringCreateWithUTF8CString(controller->titleTextDirection().c_str())); return JSValueMakeString(context, titleDirection.get()); } static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setGlobalFlag(JSValueToBoolean(context, value)); return true; } static JSValueRef ignoreDesktopNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->ignoreDesktopNotificationPermissionRequests(); return JSValueMakeUndefined(context); } static JSValueRef simulateDesktopNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception)); controller->simulateDesktopNotificationClick(title.get()); return JSValueMakeUndefined(context); @@ -2157,7 +2157,7 @@ static JSValueRef setMinimumTimerIntervalCallback(JSContextRef context, JSObject double minimum = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMinimumTimerInterval(minimum); return JSValueMakeUndefined(context); @@ -2167,7 +2167,7 @@ static JSValueRef setTextDirectionCallback(JSContextRef context, JSObjectRef fun { if (argumentCount == 1) { JSRetainPtr<JSStringRef> direction(Adopt, JSValueToStringCopy(context, arguments[0], exception)); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTextDirection(direction.get()); } @@ -2179,7 +2179,7 @@ static JSValueRef setHasCustomFullScreenBehaviorCallback(JSContextRef context, J { if (argumentCount == 1) { bool hasCustomBehavior = JSValueToBoolean(context, arguments[0]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setHasCustomFullScreenBehavior(hasCustomBehavior); } @@ -2194,21 +2194,21 @@ static JSValueRef setStorageDatabaseIdleIntervalCallback(JSContextRef context, J double interval = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setStorageDatabaseIdleInterval(interval); return JSValueMakeUndefined(context); } -static void layoutTestControllerObjectFinalize(JSObjectRef object) +static void testRunnerObjectFinalize(JSObjectRef object) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(object)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(object)); controller->deref(); } // Object Creation -void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) +void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { JSRetainPtr<JSStringRef> testRunnerStr(Adopt, JSStringCreateWithUTF8CString("testRunner")); ref(); @@ -2221,19 +2221,19 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi JSObjectSetProperty(context, windowObject, testRunnerStr.get(), layoutTestContollerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } -JSClassRef LayoutTestController::getJSClass() +JSClassRef TestRunner::getJSClass() { - static JSStaticValue* staticValues = LayoutTestController::staticValues(); - static JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions(); + static JSStaticValue* staticValues = TestRunner::staticValues(); + static JSStaticFunction* staticFunctions = TestRunner::staticFunctions(); static JSClassDefinition classDefinition = { - 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions, - 0, layoutTestControllerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, kJSClassAttributeNone, "TestRunner", 0, staticValues, staticFunctions, + 0, testRunnerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; return JSClassCreate(&classDefinition); } -JSStaticValue* LayoutTestController::staticValues() +JSStaticValue* TestRunner::staticValues() { static JSStaticValue staticValues[] = { { "globalFlag", getGlobalFlagCallback, setGlobalFlagCallback, kJSPropertyAttributeNone }, @@ -2248,7 +2248,7 @@ JSStaticValue* LayoutTestController::staticValues() return staticValues; } -JSStaticFunction* LayoutTestController::staticFunctions() +JSStaticFunction* TestRunner::staticFunctions() { static JSStaticFunction staticFunctions[] = { { "abortModal", abortModalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -2423,47 +2423,47 @@ JSStaticFunction* LayoutTestController::staticFunctions() return staticFunctions; } -void LayoutTestController::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL) +void TestRunner::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL) { WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL)); } -void LayoutTestController::queueLoadAlternateHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL) +void TestRunner::queueLoadAlternateHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL) { WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, unreachableURL)); } -void LayoutTestController::queueBackNavigation(int howFarBack) +void TestRunner::queueBackNavigation(int howFarBack) { WorkQueue::shared()->queue(new BackItem(howFarBack)); } -void LayoutTestController::queueForwardNavigation(int howFarForward) +void TestRunner::queueForwardNavigation(int howFarForward) { WorkQueue::shared()->queue(new ForwardItem(howFarForward)); } -void LayoutTestController::queueLoadingScript(JSStringRef script) +void TestRunner::queueLoadingScript(JSStringRef script) { WorkQueue::shared()->queue(new LoadingScriptItem(script)); } -void LayoutTestController::queueNonLoadingScript(JSStringRef script) +void TestRunner::queueNonLoadingScript(JSStringRef script) { WorkQueue::shared()->queue(new NonLoadingScriptItem(script)); } -void LayoutTestController::queueReload() +void TestRunner::queueReload() { WorkQueue::shared()->queue(new ReloadItem); } -void LayoutTestController::grantDesktopNotificationPermission(JSStringRef origin) +void TestRunner::grantDesktopNotificationPermission(JSStringRef origin) { m_desktopNotificationAllowedOrigins.push_back(JSStringRetain(origin)); } -bool LayoutTestController::checkDesktopNotificationPermission(JSStringRef origin) +bool TestRunner::checkDesktopNotificationPermission(JSStringRef origin) { std::vector<JSStringRef>::iterator i; for (i = m_desktopNotificationAllowedOrigins.begin(); @@ -2475,12 +2475,12 @@ bool LayoutTestController::checkDesktopNotificationPermission(JSStringRef origin return false; } -void LayoutTestController::ignoreDesktopNotificationPermissionRequests() +void TestRunner::ignoreDesktopNotificationPermissionRequests() { m_areDesktopNotificationPermissionRequestsIgnored = false; } -void LayoutTestController::waitToDumpWatchdogTimerFired() +void TestRunner::waitToDumpWatchdogTimerFired() { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; fprintf(stderr, "%s", message); @@ -2488,33 +2488,33 @@ void LayoutTestController::waitToDumpWatchdogTimerFired() notifyDone(); } -void LayoutTestController::setGeolocationPermissionCommon(bool allow) +void TestRunner::setGeolocationPermissionCommon(bool allow) { m_isGeolocationPermissionSet = true; m_geolocationPermission = allow; } -void LayoutTestController::setPOSIXLocale(JSStringRef locale) +void TestRunner::setPOSIXLocale(JSStringRef locale) { char localeBuf[32]; JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf)); setlocale(LC_ALL, localeBuf); } -void LayoutTestController::addURLToRedirect(std::string origin, std::string destination) +void TestRunner::addURLToRedirect(std::string origin, std::string destination) { m_URLsToRedirect[origin] = destination; } -const std::string& LayoutTestController::redirectionDestinationForURL(std::string origin) +const std::string& TestRunner::redirectionDestinationForURL(std::string origin) { return m_URLsToRedirect[origin]; } -void LayoutTestController::setShouldPaintBrokenImage(bool shouldPaintBrokenImage) +void TestRunner::setShouldPaintBrokenImage(bool shouldPaintBrokenImage) { m_shouldPaintBrokenImage = shouldPaintBrokenImage; } -const unsigned LayoutTestController::maxViewWidth = 800; -const unsigned LayoutTestController::maxViewHeight = 600; +const unsigned TestRunner::maxViewWidth = 800; +const unsigned TestRunner::maxViewHeight = 600; diff --git a/Tools/DumpRenderTree/LayoutTestController.h b/Tools/DumpRenderTree/TestRunner.h index 3072c7fc9..885b1de72 100644 --- a/Tools/DumpRenderTree/LayoutTestController.h +++ b/Tools/DumpRenderTree/TestRunner.h @@ -26,8 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayoutTestController_h -#define LayoutTestController_h +#ifndef TestRunner_h +#define TestRunner_h #include <JavaScriptCore/JSObjectRef.h> #include <JavaScriptCore/JSRetainPtr.h> @@ -38,12 +38,12 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -class LayoutTestController : public RefCounted<LayoutTestController> { +class TestRunner : public RefCounted<TestRunner> { public: - static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL, const std::string& expectedPixelHash); - ~LayoutTestController(); + static PassRefPtr<TestRunner> create(const std::string& testPathOrURL, const std::string& expectedPixelHash); + ~TestRunner(); - void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception); + void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception); void addDisallowedURL(JSStringRef url); void addURLToRedirect(std::string origin, std::string destination); @@ -86,11 +86,11 @@ public: void queueReload(); void removeAllVisitedLinks(); void sendWebIntentResponse(JSStringRef response); - void setAcceptsEditing(bool acceptsEditing); + void setAcceptsEditing(bool); void setAllowUniversalAccessFromFileURLs(bool); void setAllowFileAccessFromFileURLs(bool); void setAppCacheMaximumSize(unsigned long long quota); - void setApplicationCacheOriginQuota(unsigned long long quota); + void setApplicationCacheOriginQuota(unsigned long long); void setAuthorAndUserStylesEnabled(bool); void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled); void setCacheModel(int); @@ -98,7 +98,7 @@ public: void setDatabaseQuota(unsigned long long quota); void setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme); void setDefersLoading(bool); - void setIconDatabaseEnabled(bool iconDatabaseEnabled); + void setIconDatabaseEnabled(bool); void setJavaScriptCanAccessClipboard(bool flag); void setAutomaticLinkDetectionEnabled(bool flag); void setMainFrameIsFirstResponder(bool flag); @@ -108,20 +108,20 @@ public: void addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language); void setMockSpeechInputDumpRect(bool flag); void setPersistentUserStyleSheetLocation(JSStringRef path); - void setPluginsEnabled(bool flag); - void setPopupBlockingEnabled(bool flag); - void setPrivateBrowsingEnabled(bool flag); - void setSelectTrailingWhitespaceEnabled(bool flag); - void setSmartInsertDeleteEnabled(bool flag); - void setTabKeyCyclesThroughElements(bool cycles); + void setPluginsEnabled(bool); + void setPopupBlockingEnabled(bool); + void setPrivateBrowsingEnabled(bool); + void setSelectTrailingWhitespaceEnabled(bool); + void setSmartInsertDeleteEnabled(bool); + void setTabKeyCyclesThroughElements(bool); void setUseDashboardCompatibilityMode(bool flag); void setUserStyleSheetEnabled(bool flag); void setUserStyleSheetLocation(JSStringRef path); void setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value); - void setViewModeMediaFeature(JSStringRef mode); + void setViewModeMediaFeature(JSStringRef); void setXSSAuditorEnabled(bool flag); - void setFrameFlatteningEnabled(bool enable); - void setSpatialNavigationEnabled(bool enable); + void setFrameFlatteningEnabled(bool); + void setSpatialNavigationEnabled(bool); void setScrollbarPolicy(JSStringRef orientation, JSStringRef policy); void startSpeechInput(JSContextRef inputElement); void setPageVisibility(const char*); @@ -244,7 +244,7 @@ public: void setTestRepaintSweepHorizontally(bool testRepaintSweepHorizontally) { m_testRepaintSweepHorizontally = testRepaintSweepHorizontally; } bool waitToDump() const { return m_waitToDump; } - void setWaitToDump(bool waitToDump); + void setWaitToDump(bool); void waitToDumpWatchdogTimerFired(); const std::set<std::string>& willSendRequestClearHeaders() const { return m_willSendRequestClearHeaders; } @@ -257,10 +257,10 @@ public: void setWillSendRequestReturnsNullOnRedirect(bool returnsNull) { m_willSendRequestReturnsNullOnRedirect = returnsNull; } bool windowIsKey() const { return m_windowIsKey; } - void setWindowIsKey(bool windowIsKey); + void setWindowIsKey(bool); bool alwaysAcceptCookies() const { return m_alwaysAcceptCookies; } - void setAlwaysAcceptCookies(bool alwaysAcceptCookies); + void setAlwaysAcceptCookies(bool); bool handlesAuthenticationChallenges() const { return m_handlesAuthenticationChallenges; } void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; } @@ -320,13 +320,13 @@ public: void setBackingScaleFactor(double); - void setPOSIXLocale(JSStringRef locale); + void setPOSIXLocale(JSStringRef); void setWebViewEditable(bool); void abortModal(); - static void setSerializeHTTPLoads(bool serialize); + static void setSerializeHTTPLoads(bool); // The following API test functions should probably be moved to platform-specific // unit tests outside of DRT once they exist. @@ -338,7 +338,7 @@ public: JSRetainPtr<JSStringRef> layerTreeAsText() const; - JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const; + JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef, JSValueRef nodeObject) const; JSValueRef originsWithLocalStorage(JSContextRef); void deleteAllLocalStorage(); @@ -366,7 +366,7 @@ public: void setStorageDatabaseIdleInterval(double); private: - LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); + TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash); void setGeolocationPermissionCommon(bool allow); @@ -423,7 +423,7 @@ private: std::string m_authenticationUsername; std::string m_authenticationPassword; std::string m_testPathOrURL; - std::string m_expectedPixelHash; // empty string if no hash + std::string m_expectedPixelHash; // empty string if no hash std::string m_titleTextDirection; std::set<std::string> m_willSendRequestClearHeaders; @@ -441,4 +441,4 @@ private: static JSStaticFunction* staticFunctions(); }; -#endif // LayoutTestController_h +#endif // TestRunner_h diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp index 11f390e3b..b778771ce 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp @@ -41,7 +41,6 @@ #include "HistoryItem.h" #include "IntSize.h" #include "JSDOMBinding.h" -#include "LayoutTestController.h" #include "NotImplemented.h" #include "OwnArrayPtr.h" #include "Page.h" @@ -53,6 +52,7 @@ #include "ScriptController.h" #include "SecurityOrigin.h" #include "Settings.h" +#include "TestRunner.h" #include "TextAffinity.h" #include "Timer.h" #include "Vector.h" @@ -72,7 +72,7 @@ volatile bool testDone; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; WebCore::Frame* mainFrame = 0; WebCore::Frame* topLoadingFrame = 0; @@ -181,7 +181,7 @@ void DumpRenderTree::runTest(const String& url) mainFrame->loader()->stopForUserCancel(); resetToConsistentStateBeforeTesting(); if (shouldLogFrameLoadDelegates(url)) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); String stdoutFile = m_resultsDir + *m_currentTest + ".dump"; String stderrFile = m_resultsDir + *m_currentTest + ".stderr"; @@ -241,11 +241,11 @@ void DumpRenderTree::runRemainingTests() void DumpRenderTree::resetToConsistentStateBeforeTesting() { if (isHTTPTest(m_currentTest->utf8().data())) - gLayoutTestController = LayoutTestController::create(String(httpPrefixURL + *m_currentTest).utf8().data(), ""); + gTestRunner = TestRunner::create(String(httpPrefixURL + *m_currentTest).utf8().data(), ""); else - gLayoutTestController = LayoutTestController::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), ""); + gTestRunner = TestRunner::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), ""); - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); DumpRenderTreeSupport::resetGeolocationMock(m_page); @@ -361,7 +361,7 @@ String DumpRenderTree::dumpFramesAsText(WebCore::Frame* frame) s += documentElement->innerText() + "\n"; - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { WebCore::FrameTree* tree = frame->tree(); for (WebCore::Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling()) s += dumpFramesAsText(child); @@ -488,17 +488,17 @@ void DumpRenderTree::dump() String resultMimeType = "text/plain"; String responseMimeType = mainFrame->loader()->documentLoader()->responseMIMEType(); - bool dumpAsText = gLayoutTestController->dumpAsText() || responseMimeType == "text/plain"; + bool dumpAsText = gTestRunner->dumpAsText() || responseMimeType == "text/plain"; String data = dumpAsText ? dumpFramesAsText(mainFrame) : renderTreeDump(); - if (gLayoutTestController->dumpBackForwardList()) + if (gTestRunner->dumpBackForwardList()) data += dumpBackForwardListForWebView(); String result = "Content-Type: " + resultMimeType + "\n" + data; dumpToFile(result); - if (m_dumpPixels && !dumpAsText && gLayoutTestController->generatePixelResults()) - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + if (m_dumpPixels && !dumpAsText && gTestRunner->generatePixelResults()) + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); String crashFile = dumpFile + ".crash"; unlink(crashFile.utf8().data()); @@ -518,7 +518,7 @@ void DumpRenderTree::setWaitToDumpWatchdog(double interval) void DumpRenderTree::waitToDumpWatchdogTimerFired(WebCore::Timer<DumpRenderTree>*) { - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); } void DumpRenderTree::processWork(WebCore::Timer<DumpRenderTree>*) @@ -526,7 +526,7 @@ void DumpRenderTree::processWork(WebCore::Timer<DumpRenderTree>*) if (topLoadingFrame) return; - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); } @@ -537,7 +537,7 @@ void DumpRenderTree::locationChangeForFrame(WebCore::Frame* frame) topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue - if (gLayoutTestController->waitToDump()) + if (gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -549,16 +549,16 @@ void DumpRenderTree::locationChangeForFrame(WebCore::Frame* frame) // FrameLoadClient delegates. void DumpRenderTree::didStartProvisionalLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didStartProvisionalLoadForFrame\n", drtFrameDescription(frame).utf8().data()); - if (!testDone && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) printf("Frame with user gesture \"%s\" - in didStartProvisionalLoadForFrame\n", WebCore::ScriptController::processingUserGesture() ? "true" : "false"); if (!topLoadingFrame && !testDone) topLoadingFrame = frame; - if (!testDone && gLayoutTestController->stopProvisionalFrameLoads()) { + if (!testDone && gTestRunner->stopProvisionalFrameLoads()) { printf("%s - stopping load in didStartProvisionalLoadForFrame callback\n", drtFrameDescription(frame).utf8().data()); frame->loader()->stopForUserCancel(); } @@ -566,15 +566,15 @@ void DumpRenderTree::didStartProvisionalLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didCommitLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didCommitLoadForFrame\n", drtFrameDescription(frame).utf8().data()); - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); } void DumpRenderTree::didFailProvisionalLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailProvisionalLoadWithError\n", drtFrameDescription(frame).utf8().data()); locationChangeForFrame(frame); @@ -582,7 +582,7 @@ void DumpRenderTree::didFailProvisionalLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didFailLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailLoadWithError\n", drtFrameDescription(frame).utf8().data()); locationChangeForFrame(frame); @@ -590,7 +590,7 @@ void DumpRenderTree::didFailLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didFinishLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishLoadForFrame\n", drtFrameDescription(frame).utf8().data()); if (frame == topLoadingFrame) @@ -601,7 +601,7 @@ void DumpRenderTree::didFinishLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didFinishDocumentLoadForFrame(WebCore::Frame* frame) { if (!testDone) { - if (gLayoutTestController->dumpFrameLoadCallbacks()) + if (gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", drtFrameDescription(frame).utf8().data()); else { unsigned pendingFrameUnloadEvents = frame->domWindow()->pendingUnloadEventListeners(); @@ -615,7 +615,7 @@ void DumpRenderTree::didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGl { JSValueRef exception = 0; - gLayoutTestController->makeWindowObject(context, windowObject, &exception); + gTestRunner->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); m_gcController->makeWindowObject(context, windowObject, &exception); @@ -633,17 +633,33 @@ void DumpRenderTree::didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGl void DumpRenderTree::didReceiveTitleForFrame(const String& title, WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didReceiveTitle: %s\n", drtFrameDescription(frame).utf8().data(), title.utf8().data()); - if (gLayoutTestController->dumpTitleChanges()) + if (gTestRunner->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", title.utf8().data()); } // ChromeClient delegates. void DumpRenderTree::addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) { - printf("CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.utf8().data()); + printf("CONSOLE MESSAGE: "); + if (lineNumber) + printf("line %d: ", lineNumber); + String newMessage = message; + int pos = message.find("file://"); + if (pos >= 0) { + newMessage = message.substring(0, pos); + String remaining = message.substring(pos); + String fileName; + int indexFile = remaining.reverseFind('/') + 1; + if (indexFile > 0 && indexFile < remaining.length()) + fileName = remaining.substring(indexFile); + else + fileName = "file:"; + newMessage.append(fileName); + } + printf("%s\n", newMessage.utf8().data()); } void DumpRenderTree::runJavaScriptAlert(const String& message) @@ -675,13 +691,13 @@ bool DumpRenderTree::runBeforeUnloadConfirmPanel(const String& message) void DumpRenderTree::setStatusText(const String& status) { - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", status.utf8().data()); } void DumpRenderTree::exceededDatabaseQuota(WebCore::SecurityOrigin* origin, const String& name) { - if (!testDone && gLayoutTestController->dumpDatabaseCallbacks()) + if (!testDone && gTestRunner->dumpDatabaseCallbacks()) printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", origin->protocol().utf8().data(), origin->host().utf8().data(), origin->port(), name.utf8().data()); WebCore::DatabaseTracker::tracker().setQuota(mainFrame->document()->securityOrigin(), 5 * 1024 * 1024); @@ -689,7 +705,7 @@ void DumpRenderTree::exceededDatabaseQuota(WebCore::SecurityOrigin* origin, cons bool DumpRenderTree::allowsOpeningWindow() { - return gLayoutTestController->canOpenWindows(); + return gTestRunner->canOpenWindows(); } void DumpRenderTree::windowCreated(BlackBerry::WebKit::WebPage* page) @@ -700,25 +716,25 @@ void DumpRenderTree::windowCreated(BlackBerry::WebKit::WebPage* page) // EditorClient delegates. void DumpRenderTree::didBeginEditing() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", "WebViewDidBeginEditingNotification"); } void DumpRenderTree::didEndEditing() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", "WebViewDidEndEditingNotification"); } void DumpRenderTree::didChange() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:%s\n", "WebViewDidChangeNotification"); } void DumpRenderTree::didChangeSelection() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", "WebViewDidChangeSelectionNotification"); } @@ -730,28 +746,28 @@ bool DumpRenderTree::findString(const String& string, WebCore::FindOptions optio bool DumpRenderTree::shouldBeginEditingInDOMRange(WebCore::Range* range) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", drtRangeDescription(range).utf8().data()); return m_acceptsEditing; } bool DumpRenderTree::shouldEndEditingInDOMRange(WebCore::Range* range) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", drtRangeDescription(range).utf8().data()); return m_acceptsEditing; } bool DumpRenderTree::shouldDeleteDOMRange(WebCore::Range* range) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", drtRangeDescription(range).utf8().data()); return m_acceptsEditing; } bool DumpRenderTree::shouldChangeSelectedDOMRangeToDOMRangeAffinityStillSelecting(WebCore::Range* fromRange, WebCore::Range* toRange, int affinity, bool stillSelecting) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", drtRangeDescription(fromRange).utf8().data(), drtRangeDescription(toRange).utf8().data(), drtAffinityDescription(static_cast<WebCore::EAffinity>(affinity)).utf8().data(), stillSelecting ? "TRUE" : "FALSE"); return m_acceptsEditing; } @@ -772,14 +788,14 @@ static const char* insertActionString(WebCore::EditorInsertAction action) bool DumpRenderTree::shouldInsertNode(WebCore::Node* node, WebCore::Range* range, int action) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", drtDumpPath(node).utf8().data(), drtRangeDescription(range).utf8().data(), insertActionString((WebCore::EditorInsertAction)action)); return m_acceptsEditing; } bool DumpRenderTree::shouldInsertText(const String& text, WebCore::Range* range, int action) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", text.utf8().data(), drtRangeDescription(range).utf8().data(), insertActionString((WebCore::EditorInsertAction)action)); return m_acceptsEditing; } @@ -816,36 +832,36 @@ void DumpRenderTree::didDecidePolicyForNavigationAction(const WebCore::Navigatio printf("Policy delegate: attempt to load %s with navigation type '%s'\n", request.url().string().utf8().data(), typeDescription); // FIXME: do originating part. - gLayoutTestController->notifyDone(); + gTestRunner->notifyDone(); } void DumpRenderTree::didDispatchWillPerformClientRedirect() { - if (!testDone && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) printf("Frame with user gesture \"%s\" - in willPerformClientRedirect\n", WebCore::ScriptController::processingUserGesture() ? "true" : "false"); } void DumpRenderTree::didHandleOnloadEventsForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didHandleOnloadEventsForFrame\n", drtFrameDescription(frame).utf8().data()); } void DumpRenderTree::didReceiveResponseForFrame(WebCore::Frame* frame, const WebCore::ResourceResponse& response) { - if (!testDone && gLayoutTestController->dumpResourceResponseMIMETypes()) + if (!testDone && gTestRunner->dumpResourceResponseMIMETypes()) printf("%s has MIME type %s\n", response.url().lastPathComponent().utf8().data(), response.mimeType().utf8().data()); } bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& credential) { - if (!gLayoutTestController->handlesAuthenticationChallenges()) { + if (!gTestRunner->handlesAuthenticationChallenges()) { credential = WebCore::Credential(); printf("%s - didReceiveAuthenticationChallenge - Simulating cancelled authentication\n", drtCredentialDescription(credential).utf8().data()); return false; } - const char* user = gLayoutTestController->authenticationUsername().c_str(); - const char* password = gLayoutTestController->authenticationPassword().c_str(); + const char* user = gTestRunner->authenticationUsername().c_str(); + const char* password = gTestRunner->authenticationPassword().c_str(); credential = WebCore::Credential(user, password, WebCore::CredentialPersistenceForSession); printf("%s - didReceiveAuthenticationChallenge - Responding with %s:%s\n", drtCredentialDescription(credential).utf8().data(), user, password); return true; diff --git a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp index fd59a417e..f6395fbf0 100644 --- a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp +++ b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp @@ -17,7 +17,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "CString.h" #include "DatabaseTracker.h" @@ -55,53 +55,53 @@ using WebCore::toElement; using WebCore::toJS; -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { UNUSED_PARAM(url); notImplemented(); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { #if ENABLE(DATABASE) WebCore::DatabaseTracker::tracker().deleteAllDatabases(); #endif } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->clearBackForwardList(true); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { notImplemented(); } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { UNUSED_PARAM(name); notImplemented(); return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { UNUSED_PARAM(name); notImplemented(); return 0; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { notImplemented(); } -void LayoutTestController::display() +void TestRunner::display() { notImplemented(); } @@ -114,7 +114,7 @@ static String jsStringRefToWebCoreString(JSStringRef str) return String::fromUTF8(strArr.get()); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { if (!mainFrame) return; @@ -125,7 +125,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) mainFrame->editor()->command(nameStr).execute(valueStr); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { if (!mainFrame) return false; @@ -135,12 +135,12 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name) return mainFrame->editor()->command(nameStr).isEnabled(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { notImplemented(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && (!topLoadingFrame || BlackBerry::WebKit::DumpRenderTree::currentInstance()->loadFinished()) && !WorkQueue::shared()->count()) dump(); @@ -149,12 +149,12 @@ void LayoutTestController::notifyDone() waitForPolicy = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef, JSStringRef url) { return JSStringRetain(url); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { size_t urlArrSize = JSStringGetMaximumUTF8CStringSize(url); OwnArrayPtr<char> urlArr = adoptArrayPtr(new char[urlArrSize]); @@ -167,55 +167,55 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->setAcceptsEditing(acceptsEditing); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota) +void TestRunner::setAppCacheMaximumSize(unsigned long long quota) { UNUSED_PARAM(quota); notImplemented(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool enable) +void TestRunner::setAuthorAndUserStylesEnabled(bool enable) { mainFrame->page()->settings()->setAuthorAndUserStylesEnabled(enable); } -void LayoutTestController::setCacheModel(int) +void TestRunner::setCacheModel(int) { notImplemented(); } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { UNUSED_PARAM(setDelegate); UNUSED_PARAM(permissive); notImplemented(); } -void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*) +void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString*) { // FIXME: Implement to support deleting all application caches for an origin. notImplemented(); } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef) { // FIXME: Implement to support getting disk usage in bytes for an origin. notImplemented(); return 0; } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that contain application caches. notImplemented(); return JSValueMakeUndefined(context); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { if (!mainFrame) return; @@ -223,57 +223,57 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota) WebCore::DatabaseTracker::tracker().setQuota(mainFrame->document()->securityOrigin(), quota); } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, jsStringRefToWebCoreString(scheme)); } -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) { UNUSED_PARAM(iconDatabaseEnabled); notImplemented(); } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef path) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef path) { UNUSED_PARAM(path); notImplemented(); } -void LayoutTestController::setPopupBlockingEnabled(bool flag) +void TestRunner::setPopupBlockingEnabled(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setJavaScriptOpenWindowsAutomatically(!flag); } -void LayoutTestController::setPrivateBrowsingEnabled(bool flag) +void TestRunner::setPrivateBrowsingEnabled(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setXSSAuditorEnabled(bool flag) +void TestRunner::setXSSAuditorEnabled(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setXSSAuditorEnabled(flag); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->setSelectTrailingWhitespaceEnabled(flag); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) { if (!mainFrame) return; @@ -281,51 +281,51 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) mainFrame->page()->setTabKeyCyclesThroughElements(cycles); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { String pathStr = jsStringRefToWebCoreString(path); BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setUserStyleSheetLocation(pathStr.utf8().data()); } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setWaitToDump(true); waitForPolicy = true; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { SharedArray<BlackBerry::WebKit::WebPage::BackForwardEntry> backForwardList; BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->getBackForwardList(backForwardList); return backForwardList.length(); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { notImplemented(); return 0; } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { UNUSED_PARAM(id); notImplemented(); return false; } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { UNUSED_PARAM(propertyName); UNUSED_PARAM(pageNumber); @@ -333,7 +333,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* property return 0; } -void LayoutTestController::setWaitToDump(bool waitToDump) +void TestRunner::setWaitToDump(bool waitToDump) { // Change from 30s to 35s because some test cases in multipart need 30 seconds, // refer to http/tests/multipart/resources/multipart-wait-before-boundary.php please. @@ -343,13 +343,13 @@ void LayoutTestController::setWaitToDump(bool waitToDump) BlackBerry::WebKit::DumpRenderTree::currentInstance()->setWaitToDumpWatchdog(kWaitToDumpWatchdogInterval); } -void LayoutTestController::setWindowIsKey(bool windowIsKey) +void TestRunner::setWindowIsKey(bool windowIsKey) { m_windowIsKey = windowIsKey; notImplemented(); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { if (!mainFrame) return false; @@ -373,7 +373,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return animationController->pauseAnimationAtTime(node->renderer(), name.get(), time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { if (!mainFrame) return false; @@ -397,7 +397,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return animationController->pauseTransitionAtTime(node->renderer(), name.get(), time); } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { if (!mainFrame) return false; @@ -409,7 +409,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return animationController->numberOfActiveAnimations(mainFrame->document()); } -unsigned int LayoutTestController::workerThreadCount() const +unsigned int TestRunner::workerThreadCount() const { #if ENABLE_WORKERS return WebCore::WorkerThread::workerThreadCount(); @@ -418,17 +418,17 @@ unsigned int LayoutTestController::workerThreadCount() const #endif } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { notImplemented(); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setLoadsImagesAutomatically(false); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { if (!mainFrame) return; @@ -446,41 +446,41 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value mainFrame->page()->settings()->setHyperlinkAuditingEnabled(valueStr == "true" || valueStr == "1"); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { UNUSED_PARAM(alwaysAcceptCookies); notImplemented(); } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { DumpRenderTreeSupport::setMockGeolocationPosition(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), latitude, longitude, accuracy); } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { String messageStr = jsStringRefToWebCoreString(message); DumpRenderTreeSupport::setMockGeolocationError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), code, messageStr); } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { notImplemented(); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { notImplemented(); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { UNUSED_PARAM(callId); UNUSED_PARAM(script); notImplemented(); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { UNUSED_PARAM(worldID); UNUSED_PARAM(globalObject); @@ -488,7 +488,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned notImplemented(); } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { UNUSED_PARAM(worldID); UNUSED_PARAM(globalObject); @@ -496,7 +496,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj notImplemented(); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { UNUSED_PARAM(source); UNUSED_PARAM(runAtStart); @@ -504,55 +504,55 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo notImplemented(); } -void LayoutTestController::addUserStyleSheet(JSStringRef, bool) +void TestRunner::addUserStyleSheet(JSStringRef, bool) { notImplemented(); } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const { notImplemented(); return 0; } -int LayoutTestController::numberOfPages(float, float) +int TestRunner::numberOfPages(float, float) { notImplemented(); return -1; } -void LayoutTestController::setScrollbarPolicy(JSStringRef, JSStringRef) +void TestRunner::setScrollbarPolicy(JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { notImplemented(); } -void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) +void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) { notImplemented(); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { notImplemented(); return false; } -void LayoutTestController::setFrameFlatteningEnabled(bool enable) +void TestRunner::setFrameFlatteningEnabled(bool enable) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setFrameFlatteningEnabled(enable); } -void LayoutTestController::setSpatialNavigationEnabled(bool enable) +void TestRunner::setSpatialNavigationEnabled(bool enable) { notImplemented(); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WebCore::SecurityPolicy::addOriginAccessWhitelistEntry(*WebCore::SecurityOrigin::createFromString(jsStringRefToWebCoreString(sourceOrigin)), jsStringRefToWebCoreString(destinationProtocol), @@ -560,7 +560,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry(*WebCore::SecurityOrigin::createFromString(jsStringRefToWebCoreString(sourceOrigin)), jsStringRefToWebCoreString(destinationProtocol), @@ -568,7 +568,7 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr allowDestinationSubdomains); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { if (!mainFrame) return; @@ -576,7 +576,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) mainFrame->page()->settings()->setAllowFileAccessFromFileURLs(enabled); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { if (!mainFrame) return; @@ -584,33 +584,33 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) mainFrame->page()->settings()->setAllowUniversalAccessFromFileURLs(enabled); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { notImplemented(); } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { notImplemented(); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) +void TestRunner::setJavaScriptCanAccessClipboard(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->setJavaScriptCanAccessClipboard(flag); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { notImplemented(); return 0; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { WebCore::Element* element = toElement(toJS(toJS(context), nodeObject)); if (!element) @@ -620,102 +620,102 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { notImplemented(); } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { notImplemented(); } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { notImplemented(); } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { notImplemented(); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { notImplemented(); } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { notImplemented(); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); DumpRenderTreeSupport::setMockGeolocationPermission(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), allow); } -void LayoutTestController::setViewModeMediaFeature(const JSStringRef mode) +void TestRunner::setViewModeMediaFeature(const JSStringRef mode) { notImplemented(); } -void LayoutTestController::setSerializeHTTPLoads(bool) +void TestRunner::setSerializeHTTPLoads(bool) { // FIXME: Implement if needed for https://bugs.webkit.org/show_bug.cgi?id=50758. notImplemented(); } -void LayoutTestController::setMinimumTimerInterval(double) +void TestRunner::setMinimumTimerInterval(double) { notImplemented(); } -void LayoutTestController::setTextDirection(JSStringRef) +void TestRunner::setTextDirection(JSStringRef) { notImplemented(); } -void LayoutTestController::goBack() +void TestRunner::goBack() { // FIXME: implement to enable loader/navigation-while-deferring-loads.html notImplemented(); } -void LayoutTestController::setDefersLoading(bool) +void TestRunner::setDefersLoading(bool) { // FIXME: implement to enable loader/navigation-while-deferring-loads.html notImplemented(); } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { notImplemented(); return JSValueMakeUndefined(context); } -void LayoutTestController::observeStorageTrackerNotifications(unsigned) +void TestRunner::observeStorageTrackerNotifications(unsigned) { notImplemented(); } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { notImplemented(); } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { notImplemented(); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { notImplemented(); } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { JSC::ExecState* exec = toJS(context); WebCore::Element* element = toElement(toJS(exec, nodeObject)); @@ -728,12 +728,12 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb inputElement->setAutofilled(autofilled); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { return DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()); } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebCore::FindOptions options = 0; @@ -774,12 +774,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, !(options & WebCore::Backwards), !(options & WebCore::CaseInsensitive), true /* wrap */, true /* highlightAllMatches */); } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) { // FIXME: Implement. } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { JSC::ExecState* exec = toJS(context); WebCore::Element* element = toElement(toJS(exec, nodeObject)); @@ -792,57 +792,57 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node inputElement->setValueForUser(jsStringRefToWebCoreString(value)); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef origin) { // FIXME: Implement to support getting disk usage by all application caches for an origin. return 0; } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { } -void LayoutTestController::setMockSpeechInputDumpRect(bool) +void TestRunner::setMockSpeechInputDumpRect(bool) { } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { notImplemented(); } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { notImplemented(); } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { notImplemented(); } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { notImplemented(); } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { notImplemented(); } diff --git a/Tools/DumpRenderTree/cg/ImageDiffCG.cpp b/Tools/DumpRenderTree/cg/ImageDiffCG.cpp index db3543730..7fa5110bb 100644 --- a/Tools/DumpRenderTree/cg/ImageDiffCG.cpp +++ b/Tools/DumpRenderTree/cg/ImageDiffCG.cpp @@ -214,7 +214,7 @@ int main(int argc, const char* argv[]) else if (imageSize > 0 && !baselineImage) baselineImage = createImageFromStdin(imageSize); else - fputs("error, image size must be specified.\n", stderr); + fputs("Error: image size must be specified.\n", stderr); } if (actualImage && baselineImage) { @@ -229,9 +229,17 @@ int main(int argc, const char* argv[]) difference = roundf(difference * 100.0f) / 100.0f; difference = max(difference, 0.01f); // round to 2 decimal places } - } else - fputs("error, test and reference image have different properties.\n", stderr); - + } else { + if (CGImageGetWidth(actualImage.get()) != CGImageGetWidth(baselineImage.get()) || CGImageGetHeight(actualImage.get()) != CGImageGetHeight(baselineImage.get())) + fprintf(stderr, "Error: test and reference images have different sizes. Test image is %lux%lu, reference image is %lux%lu\n", + CGImageGetWidth(actualImage.get()), CGImageGetHeight(actualImage.get()), + CGImageGetWidth(baselineImage.get()), CGImageGetHeight(baselineImage.get())); + else if (imageHasAlpha(actualImage.get()) != imageHasAlpha(baselineImage.get())) + fprintf(stderr, "Error: test and reference images differ in alpha. Test image %s alpha, reference image %s alpha.\n", + imageHasAlpha(actualImage.get()) ? "has" : "does not have", + imageHasAlpha(baselineImage.get()) ? "has" : "does not have"); + } + if (difference > 0.0f) { if (diffImage) { RetainPtr<CFMutableDataRef> imageData(AdoptCF, CFDataCreateMutable(0, 0)); diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp index 046e1ec2d..bbc9f9bc6 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp @@ -30,7 +30,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "DRTDevToolsAgent.h" #include "MockWebSpeechInputController.h" @@ -94,7 +94,7 @@ public: virtual void destroy() { } }; -LayoutTestController::LayoutTestController(TestShell* shell) +DRTTestRunner::DRTTestRunner(TestShell* shell) : m_shell(shell) , m_closeRemainingWindows(false) , m_deferMainResourceDataLoad(false) @@ -107,178 +107,178 @@ LayoutTestController::LayoutTestController(TestShell* shell) // Initialize the map that associates methods of this class with the names // they will use when called by JavaScript. The actual binding of those // names to their methods will be done by calling bindToJavaScript() (defined - // by CppBoundClass, the parent to LayoutTestController). - bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag); + // by CppBoundClass, the parent to DRTTestRunner). + bindMethod("addFileToPasteboardOnDrag", &DRTTestRunner::addFileToPasteboardOnDrag); #if ENABLE(INPUT_SPEECH) - bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult); - bindMethod("setMockSpeechInputDumpRect", &LayoutTestController::setMockSpeechInputDumpRect); + bindMethod("addMockSpeechInputResult", &DRTTestRunner::addMockSpeechInputResult); + bindMethod("setMockSpeechInputDumpRect", &DRTTestRunner::setMockSpeechInputDumpRect); #endif #if ENABLE(SCRIPTED_SPEECH) - bindMethod("addMockSpeechRecognitionResult", &LayoutTestController::addMockSpeechRecognitionResult); - bindMethod("setMockSpeechRecognitionError", &LayoutTestController::setMockSpeechRecognitionError); - bindMethod("wasMockSpeechRecognitionAborted", &LayoutTestController::wasMockSpeechRecognitionAborted); + bindMethod("addMockSpeechRecognitionResult", &DRTTestRunner::addMockSpeechRecognitionResult); + bindMethod("setMockSpeechRecognitionError", &DRTTestRunner::setMockSpeechRecognitionError); + bindMethod("wasMockSpeechRecognitionAborted", &DRTTestRunner::wasMockSpeechRecognitionAborted); #endif - bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry); - bindMethod("addUserScript", &LayoutTestController::addUserScript); - bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet); - bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases); - bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector); + bindMethod("addOriginAccessWhitelistEntry", &DRTTestRunner::addOriginAccessWhitelistEntry); + bindMethod("addUserScript", &DRTTestRunner::addUserScript); + bindMethod("addUserStyleSheet", &DRTTestRunner::addUserStyleSheet); + bindMethod("clearAllDatabases", &DRTTestRunner::clearAllDatabases); + bindMethod("closeWebInspector", &DRTTestRunner::closeWebInspector); #if ENABLE(POINTER_LOCK) - bindMethod("didLosePointerLock", &LayoutTestController::didLosePointerLock); + bindMethod("didLosePointerLock", &DRTTestRunner::didLosePointerLock); #endif - bindMethod("disableAutoResizeMode", &LayoutTestController::disableAutoResizeMode); - bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading); - bindMethod("display", &LayoutTestController::display); - bindMethod("displayInvalidatedRegion", &LayoutTestController::displayInvalidatedRegion); - bindMethod("dumpAsText", &LayoutTestController::dumpAsText); - bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList); - bindMethod("dumpChildFramesAsText", &LayoutTestController::dumpChildFramesAsText); - bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions); - bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks); - bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks); - bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks); - bindMethod("dumpProgressFinishedCallback", &LayoutTestController::dumpProgressFinishedCallback); - bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks); - bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks); - bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes); - bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect); - bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges); - bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges); - bindMethod("dumpPermissionClientCallbacks", &LayoutTestController::dumpPermissionClientCallbacks); - bindMethod("dumpCreateView", &LayoutTestController::dumpCreateView); - bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId); - bindMethod("enableAutoResizeMode", &LayoutTestController::enableAutoResizeMode); - bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector); - bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); - bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue); - bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin); - bindMethod("execCommand", &LayoutTestController::execCommand); - bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors); + bindMethod("disableAutoResizeMode", &DRTTestRunner::disableAutoResizeMode); + bindMethod("disableImageLoading", &DRTTestRunner::disableImageLoading); + bindMethod("display", &DRTTestRunner::display); + bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion); + bindMethod("dumpAsText", &DRTTestRunner::dumpAsText); + bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList); + bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText); + bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions); + bindMethod("dumpDatabaseCallbacks", &DRTTestRunner::dumpDatabaseCallbacks); + bindMethod("dumpEditingCallbacks", &DRTTestRunner::dumpEditingCallbacks); + bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks); + bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback); + bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks); + bindMethod("dumpResourceLoadCallbacks", &DRTTestRunner::dumpResourceLoadCallbacks); + bindMethod("dumpResourceResponseMIMETypes", &DRTTestRunner::dumpResourceResponseMIMETypes); + bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect); + bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges); + bindMethod("dumpTitleChanges", &DRTTestRunner::dumpTitleChanges); + bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks); + bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView); + bindMethod("elementDoesAutoCompleteForElementWithId", &DRTTestRunner::elementDoesAutoCompleteForElementWithId); + bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode); + bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector); + bindMethod("evaluateScriptInIsolatedWorld", &DRTTestRunner::evaluateScriptInIsolatedWorld); + bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue); + bindMethod("setIsolatedWorldSecurityOrigin", &DRTTestRunner::setIsolatedWorldSecurityOrigin); + bindMethod("execCommand", &DRTTestRunner::execCommand); + bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors); #if ENABLE(NOTIFICATIONS) - bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission); + bindMethod("grantDesktopNotificationPermission", &DRTTestRunner::grantDesktopNotificationPermission); #endif - bindMethod("findString", &LayoutTestController::findString); - bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled); - bindMethod("hasCustomPageSizeStyle", &LayoutTestController::hasCustomPageSizeStyle); - bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText); - bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext); - bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem); - bindMethod("notifyDone", &LayoutTestController::notifyDone); - bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations); - bindMethod("numberOfPages", &LayoutTestController::numberOfPages); - bindMethod("numberOfPendingGeolocationPermissionRequests", &LayoutTestController:: numberOfPendingGeolocationPermissionRequests); - bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual); - bindMethod("overridePreference", &LayoutTestController::overridePreference); - bindMethod("pageProperty", &LayoutTestController::pageProperty); - bindMethod("pageSizeAndMarginsInPixels", &LayoutTestController::pageSizeAndMarginsInPixels); - bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource); - bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId); - bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId); - bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation); - bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation); - bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript); - bindMethod("queueLoad", &LayoutTestController::queueLoad); - bindMethod("queueLoadHTMLString", &LayoutTestController::queueLoadHTMLString); - bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript); - bindMethod("queueReload", &LayoutTestController::queueReload); - bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry); - bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally); - bindMethod("resetPageVisibility", &LayoutTestController::resetPageVisibility); - bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing); - bindMethod("setAllowDisplayOfInsecureContent", &LayoutTestController::setAllowDisplayOfInsecureContent); - bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs); - bindMethod("setAllowRunningOfInsecureContent", &LayoutTestController::setAllowRunningOfInsecureContent); - bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs); - bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies); - bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled); - bindMethod("setAutofilled", &LayoutTestController::setAutofilled); - bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows); - bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete); - bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate); - bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota); - bindMethod("setDeferMainResourceDataLoad", &LayoutTestController::setDeferMainResourceDataLoad); - bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme); - bindMethod("setAudioData", &LayoutTestController::setAudioData); - bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission); - bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled); - bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard); - bindMethod("setMinimumTimerInterval", &LayoutTestController::setMinimumTimerInterval); - bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation); - bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError); - bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition); - bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility); - bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled); + bindMethod("findString", &DRTTestRunner::findString); + bindMethod("isCommandEnabled", &DRTTestRunner::isCommandEnabled); + bindMethod("hasCustomPageSizeStyle", &DRTTestRunner::hasCustomPageSizeStyle); + bindMethod("layerTreeAsText", &DRTTestRunner::layerTreeAsText); + bindMethod("loseCompositorContext", &DRTTestRunner::loseCompositorContext); + bindMethod("markerTextForListItem", &DRTTestRunner::markerTextForListItem); + bindMethod("notifyDone", &DRTTestRunner::notifyDone); + bindMethod("numberOfActiveAnimations", &DRTTestRunner::numberOfActiveAnimations); + bindMethod("numberOfPages", &DRTTestRunner::numberOfPages); + bindMethod("numberOfPendingGeolocationPermissionRequests", &DRTTestRunner:: numberOfPendingGeolocationPermissionRequests); + bindMethod("objCIdentityIsEqual", &DRTTestRunner::objCIdentityIsEqual); + bindMethod("overridePreference", &DRTTestRunner::overridePreference); + bindMethod("pageProperty", &DRTTestRunner::pageProperty); + bindMethod("pageSizeAndMarginsInPixels", &DRTTestRunner::pageSizeAndMarginsInPixels); + bindMethod("pathToLocalResource", &DRTTestRunner::pathToLocalResource); + bindMethod("pauseAnimationAtTimeOnElementWithId", &DRTTestRunner::pauseAnimationAtTimeOnElementWithId); + bindMethod("pauseTransitionAtTimeOnElementWithId", &DRTTestRunner::pauseTransitionAtTimeOnElementWithId); + bindMethod("queueBackNavigation", &DRTTestRunner::queueBackNavigation); + bindMethod("queueForwardNavigation", &DRTTestRunner::queueForwardNavigation); + bindMethod("queueLoadingScript", &DRTTestRunner::queueLoadingScript); + bindMethod("queueLoad", &DRTTestRunner::queueLoad); + bindMethod("queueLoadHTMLString", &DRTTestRunner::queueLoadHTMLString); + bindMethod("queueNonLoadingScript", &DRTTestRunner::queueNonLoadingScript); + bindMethod("queueReload", &DRTTestRunner::queueReload); + bindMethod("removeOriginAccessWhitelistEntry", &DRTTestRunner::removeOriginAccessWhitelistEntry); + bindMethod("repaintSweepHorizontally", &DRTTestRunner::repaintSweepHorizontally); + bindMethod("resetPageVisibility", &DRTTestRunner::resetPageVisibility); + bindMethod("setAcceptsEditing", &DRTTestRunner::setAcceptsEditing); + bindMethod("setAllowDisplayOfInsecureContent", &DRTTestRunner::setAllowDisplayOfInsecureContent); + bindMethod("setAllowFileAccessFromFileURLs", &DRTTestRunner::setAllowFileAccessFromFileURLs); + bindMethod("setAllowRunningOfInsecureContent", &DRTTestRunner::setAllowRunningOfInsecureContent); + bindMethod("setAllowUniversalAccessFromFileURLs", &DRTTestRunner::setAllowUniversalAccessFromFileURLs); + bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies); + bindMethod("setAuthorAndUserStylesEnabled", &DRTTestRunner::setAuthorAndUserStylesEnabled); + bindMethod("setAutofilled", &DRTTestRunner::setAutofilled); + bindMethod("setCanOpenWindows", &DRTTestRunner::setCanOpenWindows); + bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete); + bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate); + bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota); + bindMethod("setDeferMainResourceDataLoad", &DRTTestRunner::setDeferMainResourceDataLoad); + bindMethod("setDomainRelaxationForbiddenForURLScheme", &DRTTestRunner::setDomainRelaxationForbiddenForURLScheme); + bindMethod("setAudioData", &DRTTestRunner::setAudioData); + bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission); + bindMethod("setIconDatabaseEnabled", &DRTTestRunner::setIconDatabaseEnabled); + bindMethod("setJavaScriptCanAccessClipboard", &DRTTestRunner::setJavaScriptCanAccessClipboard); + bindMethod("setMinimumTimerInterval", &DRTTestRunner::setMinimumTimerInterval); + bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation); + bindMethod("setMockGeolocationError", &DRTTestRunner::setMockGeolocationError); + bindMethod("setMockGeolocationPosition", &DRTTestRunner::setMockGeolocationPosition); + bindMethod("setPageVisibility", &DRTTestRunner::setPageVisibility); + bindMethod("setPluginsEnabled", &DRTTestRunner::setPluginsEnabled); #if ENABLE(POINTER_LOCK) - bindMethod("setPointerLockWillFailAsynchronously", &LayoutTestController::setPointerLockWillFailAsynchronously); - bindMethod("setPointerLockWillFailSynchronously", &LayoutTestController::setPointerLockWillFailSynchronously); + bindMethod("setPointerLockWillFailAsynchronously", &DRTTestRunner::setPointerLockWillFailAsynchronously); + bindMethod("setPointerLockWillFailSynchronously", &DRTTestRunner::setPointerLockWillFailSynchronously); #endif - bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled); - bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale); - bindMethod("setPrinting", &LayoutTestController::setPrinting); - bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy); - bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled); - bindMethod("setTextSubpixelPositioning", &LayoutTestController::setTextSubpixelPositioning); - bindMethod("setBackingScaleFactor", &LayoutTestController::setBackingScaleFactor); - bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled); - bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads); - bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements); - bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled); - bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation); - bindMethod("setValueForUser", &LayoutTestController::setValueForUser); - bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader); - bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull); - bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect); - bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey); - bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); - bindMethod("setAsynchronousSpellCheckingEnabled", &LayoutTestController::setAsynchronousSpellCheckingEnabled); - bindMethod("showWebInspector", &LayoutTestController::showWebInspector); + bindMethod("setPopupBlockingEnabled", &DRTTestRunner::setPopupBlockingEnabled); + bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale); + bindMethod("setPrinting", &DRTTestRunner::setPrinting); + bindMethod("setScrollbarPolicy", &DRTTestRunner::setScrollbarPolicy); + bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled); + bindMethod("setTextSubpixelPositioning", &DRTTestRunner::setTextSubpixelPositioning); + bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor); + bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled); + bindMethod("setStopProvisionalFrameLoads", &DRTTestRunner::setStopProvisionalFrameLoads); + bindMethod("setTabKeyCyclesThroughElements", &DRTTestRunner::setTabKeyCyclesThroughElements); + bindMethod("setUserStyleSheetEnabled", &DRTTestRunner::setUserStyleSheetEnabled); + bindMethod("setUserStyleSheetLocation", &DRTTestRunner::setUserStyleSheetLocation); + bindMethod("setValueForUser", &DRTTestRunner::setValueForUser); + bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader); + bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull); + bindMethod("setWillSendRequestReturnsNullOnRedirect", &DRTTestRunner::setWillSendRequestReturnsNullOnRedirect); + bindMethod("setWindowIsKey", &DRTTestRunner::setWindowIsKey); + bindMethod("setXSSAuditorEnabled", &DRTTestRunner::setXSSAuditorEnabled); + bindMethod("setAsynchronousSpellCheckingEnabled", &DRTTestRunner::setAsynchronousSpellCheckingEnabled); + bindMethod("showWebInspector", &DRTTestRunner::showWebInspector); #if ENABLE(NOTIFICATIONS) - bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick); + bindMethod("simulateDesktopNotificationClick", &DRTTestRunner::simulateDesktopNotificationClick); #endif - bindMethod("startSpeechInput", &LayoutTestController::startSpeechInput); - bindMethod("testRepaint", &LayoutTestController::testRepaint); - bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate); - bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone); - bindMethod("windowCount", &LayoutTestController::windowCount); - bindMethod("setTextDirection", &LayoutTestController::setTextDirection); - bindMethod("setImagesAllowed", &LayoutTestController::setImagesAllowed); - bindMethod("setScriptsAllowed", &LayoutTestController::setScriptsAllowed); - bindMethod("setStorageAllowed", &LayoutTestController::setStorageAllowed); - bindMethod("setPluginsAllowed", &LayoutTestController::setPluginsAllowed); + bindMethod("startSpeechInput", &DRTTestRunner::startSpeechInput); + bindMethod("testRepaint", &DRTTestRunner::testRepaint); + bindMethod("waitForPolicyDelegate", &DRTTestRunner::waitForPolicyDelegate); + bindMethod("waitUntilDone", &DRTTestRunner::waitUntilDone); + bindMethod("windowCount", &DRTTestRunner::windowCount); + bindMethod("setTextDirection", &DRTTestRunner::setTextDirection); + bindMethod("setImagesAllowed", &DRTTestRunner::setImagesAllowed); + bindMethod("setScriptsAllowed", &DRTTestRunner::setScriptsAllowed); + bindMethod("setStorageAllowed", &DRTTestRunner::setStorageAllowed); + bindMethod("setPluginsAllowed", &DRTTestRunner::setPluginsAllowed); // The following are stubs. - bindMethod("abortModal", &LayoutTestController::abortModal); - bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject); - bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL); - bindMethod("applicationCacheDiskUsageForOrigin", &LayoutTestController::applicationCacheDiskUsageForOrigin); - bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView); - bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches); - bindMethod("clearApplicationCacheForOrigin", &LayoutTestController::clearApplicationCacheForOrigin); - bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList); - bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive); - bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory); - bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf); - bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota); - bindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews); - bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder); - bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled); - bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); - bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject); - bindMethod("deleteAllLocalStorage", &LayoutTestController::deleteAllLocalStorage); - bindMethod("localStorageDiskUsageForOrigin", &LayoutTestController::localStorageDiskUsageForOrigin); - bindMethod("originsWithLocalStorage", &LayoutTestController::originsWithLocalStorage); - bindMethod("deleteLocalStorageForOrigin", &LayoutTestController::deleteLocalStorageForOrigin); - bindMethod("observeStorageTrackerNotifications", &LayoutTestController::observeStorageTrackerNotifications); - bindMethod("syncLocalStorage", &LayoutTestController::syncLocalStorage); - bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload); - bindMethod("enableFixedLayoutMode", &LayoutTestController::enableFixedLayoutMode); - bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize); - bindMethod("selectionAsMarkup", &LayoutTestController::selectionAsMarkup); - bindMethod("setHasCustomFullScreenBehavior", &LayoutTestController::setHasCustomFullScreenBehavior); - bindMethod("textSurroundingNode", &LayoutTestController::textSurroundingNode); + bindMethod("abortModal", &DRTTestRunner::abortModal); + bindMethod("accessStoredWebScriptObject", &DRTTestRunner::accessStoredWebScriptObject); + bindMethod("addDisallowedURL", &DRTTestRunner::addDisallowedURL); + bindMethod("applicationCacheDiskUsageForOrigin", &DRTTestRunner::applicationCacheDiskUsageForOrigin); + bindMethod("callShouldCloseOnWebView", &DRTTestRunner::callShouldCloseOnWebView); + bindMethod("clearAllApplicationCaches", &DRTTestRunner::clearAllApplicationCaches); + bindMethod("clearApplicationCacheForOrigin", &DRTTestRunner::clearApplicationCacheForOrigin); + bindMethod("clearBackForwardList", &DRTTestRunner::clearBackForwardList); + bindMethod("dumpAsWebArchive", &DRTTestRunner::dumpAsWebArchive); + bindMethod("keepWebHistory", &DRTTestRunner::keepWebHistory); + bindMethod("objCClassNameOf", &DRTTestRunner::objCClassNameOf); + bindMethod("setApplicationCacheOriginQuota", &DRTTestRunner::setApplicationCacheOriginQuota); + bindMethod("setCallCloseOnWebViews", &DRTTestRunner::setCallCloseOnWebViews); + bindMethod("setMainFrameIsFirstResponder", &DRTTestRunner::setMainFrameIsFirstResponder); + bindMethod("setPrivateBrowsingEnabled", &DRTTestRunner::setPrivateBrowsingEnabled); + bindMethod("setUseDashboardCompatibilityMode", &DRTTestRunner::setUseDashboardCompatibilityMode); + bindMethod("storeWebScriptObject", &DRTTestRunner::storeWebScriptObject); + bindMethod("deleteAllLocalStorage", &DRTTestRunner::deleteAllLocalStorage); + bindMethod("localStorageDiskUsageForOrigin", &DRTTestRunner::localStorageDiskUsageForOrigin); + bindMethod("originsWithLocalStorage", &DRTTestRunner::originsWithLocalStorage); + bindMethod("deleteLocalStorageForOrigin", &DRTTestRunner::deleteLocalStorageForOrigin); + bindMethod("observeStorageTrackerNotifications", &DRTTestRunner::observeStorageTrackerNotifications); + bindMethod("syncLocalStorage", &DRTTestRunner::syncLocalStorage); + bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload); + bindMethod("enableFixedLayoutMode", &DRTTestRunner::enableFixedLayoutMode); + bindMethod("setFixedLayoutSize", &DRTTestRunner::setFixedLayoutSize); + bindMethod("selectionAsMarkup", &DRTTestRunner::selectionAsMarkup); + bindMethod("setHasCustomFullScreenBehavior", &DRTTestRunner::setHasCustomFullScreenBehavior); + bindMethod("textSurroundingNode", &DRTTestRunner::textSurroundingNode); // The fallback method is called when an unknown method is invoked. - bindFallbackMethod(&LayoutTestController::fallbackMethod); + bindFallbackMethod(&DRTTestRunner::fallbackMethod); // Shared properties. // globalFlag is used by a number of layout tests in @@ -289,21 +289,21 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindProperty("titleTextDirection", &m_titleTextDirection); bindProperty("platformName", &m_platformName); bindProperty("interceptPostMessage", &m_interceptPostMessage); - bindProperty("workerThreadCount", &LayoutTestController::workerThreadCount); - bindMethod("sendWebIntentResponse", &LayoutTestController::sendWebIntentResponse); - bindMethod("deliverWebIntent", &LayoutTestController::deliverWebIntent); + bindProperty("workerThreadCount", &DRTTestRunner::workerThreadCount); + bindMethod("sendWebIntentResponse", &DRTTestRunner::sendWebIntentResponse); + bindMethod("deliverWebIntent", &DRTTestRunner::deliverWebIntent); } -LayoutTestController::~LayoutTestController() +DRTTestRunner::~DRTTestRunner() { } -LayoutTestController::WorkQueue::~WorkQueue() +DRTTestRunner::WorkQueue::~WorkQueue() { reset(); } -void LayoutTestController::WorkQueue::processWorkSoon() +void DRTTestRunner::WorkQueue::processWorkSoon() { if (m_controller->m_shell->webViewHost()->topLoadingFrame()) return; @@ -315,7 +315,7 @@ void LayoutTestController::WorkQueue::processWorkSoon() m_controller->m_shell->testFinished(); } -void LayoutTestController::WorkQueue::processWork() +void DRTTestRunner::WorkQueue::processWork() { TestShell* shell = m_controller->m_shell; // Quit doing work once a load is in progress. @@ -330,14 +330,14 @@ void LayoutTestController::WorkQueue::processWork() shell->testFinished(); } -void LayoutTestController::WorkQueue::reset() +void DRTTestRunner::WorkQueue::reset() { m_frozen = false; while (!m_queue.isEmpty()) delete m_queue.takeFirst(); } -void LayoutTestController::WorkQueue::addWork(WorkItem* work) +void DRTTestRunner::WorkQueue::addWork(WorkItem* work) { if (m_frozen) { delete work; @@ -346,7 +346,7 @@ void LayoutTestController::WorkQueue::addWork(WorkItem* work) m_queue.append(work); } -void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result) { m_dumpAsText = true; m_generatePixelResults = false; @@ -358,98 +358,98 @@ void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVaria result->setNull(); } -void LayoutTestController::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result) { // Do nothing; we don't use this flag anywhere for now result->setNull(); } -void LayoutTestController::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpEditingCallbacks = true; result->setNull(); } -void LayoutTestController::dumpBackForwardList(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result) { m_dumpBackForwardList = true; result->setNull(); } -void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpFrameLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) { m_dumpProgressFinishedCallback = true; result->setNull(); } -void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpUserGestureInFrameLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpResourceLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result) { m_dumpResourceResponseMIMETypes = true; result->setNull(); } -void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result) { m_dumpChildFrameScrollPositions = true; result->setNull(); } -void LayoutTestController::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result) { m_dumpChildFramesAsText = true; result->setNull(); } -void LayoutTestController::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) { m_dumpWindowStatusChanges = true; result->setNull(); } -void LayoutTestController::dumpTitleChanges(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result) { m_dumpTitleChanges = true; result->setNull(); } -void LayoutTestController::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpPermissionClientCallbacks = true; result->setNull(); } -void LayoutTestController::dumpCreateView(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result) { m_dumpCreateView = true; result->setNull(); } -void LayoutTestController::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_acceptsEditing = arguments[0].value.boolValue; result->setNull(); } -void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result) { if (!webkit_support::BeingDebugged()) postDelayedTask(new NotifyDoneTimedOutTask(this), m_shell->layoutTestTimeout()); @@ -457,7 +457,7 @@ void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* res result->setNull(); } -void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::notifyDone(const CppArgumentList&, CppVariant* result) { // Test didn't timeout. Kill the timeout timer. m_taskList.revokeAll(); @@ -466,7 +466,7 @@ void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result result->setNull(); } -void LayoutTestController::completeNotifyDone(bool isTimeout) +void DRTTestRunner::completeNotifyDone(bool isTimeout) { if (m_waitUntilDone && !m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) { if (isTimeout) @@ -477,7 +477,7 @@ void LayoutTestController::completeNotifyDone(bool isTimeout) m_waitUntilDone = false; } -class WorkItemBackForward : public LayoutTestController::WorkItem { +class WorkItemBackForward : public DRTTestRunner::WorkItem { public: WorkItemBackForward(int distance) : m_distance(distance) { } bool run(TestShell* shell) @@ -490,21 +490,21 @@ private: int m_distance; }; -void LayoutTestController::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isNumber()) m_workQueue.addWork(new WorkItemBackForward(-arguments[0].toInt32())); result->setNull(); } -void LayoutTestController::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isNumber()) m_workQueue.addWork(new WorkItemBackForward(arguments[0].toInt32())); result->setNull(); } -class WorkItemReload : public LayoutTestController::WorkItem { +class WorkItemReload : public DRTTestRunner::WorkItem { public: bool run(TestShell* shell) { @@ -513,13 +513,13 @@ public: } }; -void LayoutTestController::queueReload(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::queueReload(const CppArgumentList&, CppVariant* result) { m_workQueue.addWork(new WorkItemReload); result->setNull(); } -class WorkItemLoadingScript : public LayoutTestController::WorkItem { +class WorkItemLoadingScript : public DRTTestRunner::WorkItem { public: WorkItemLoadingScript(const string& script) : m_script(script) { } bool run(TestShell* shell) @@ -532,7 +532,7 @@ private: string m_script; }; -class WorkItemNonLoadingScript : public LayoutTestController::WorkItem { +class WorkItemNonLoadingScript : public DRTTestRunner::WorkItem { public: WorkItemNonLoadingScript(const string& script) : m_script(script) { } bool run(TestShell* shell) @@ -545,21 +545,21 @@ private: string m_script; }; -void LayoutTestController::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) m_workQueue.addWork(new WorkItemLoadingScript(arguments[0].toString())); result->setNull(); } -void LayoutTestController::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) m_workQueue.addWork(new WorkItemNonLoadingScript(arguments[0].toString())); result->setNull(); } -class WorkItemLoad : public LayoutTestController::WorkItem { +class WorkItemLoad : public DRTTestRunner::WorkItem { public: WorkItemLoad(const WebURL& url, const WebString& target) : m_url(url) @@ -575,7 +575,7 @@ private: WebString m_target; }; -void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoad(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { // FIXME: Implement WebURL::resolve() and avoid GURL. @@ -591,7 +591,7 @@ void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVarian result->setNull(); } -class WorkItemLoadHTMLString : public LayoutTestController::WorkItem { +class WorkItemLoadHTMLString : public DRTTestRunner::WorkItem { public: WorkItemLoadHTMLString(const std::string& html, const WebURL& baseURL) : m_html(html) @@ -613,7 +613,7 @@ private: WebURL m_unreachableURL; }; -void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string html = arguments[0].toString(); @@ -628,7 +628,7 @@ void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, result->setNull(); } -void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 2) { // This is the best we can do to return an error. @@ -638,7 +638,7 @@ void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, result->set(arguments[0].isEqual(arguments[1])); } -void LayoutTestController::reset() +void DRTTestRunner::reset() { if (m_shell) { m_shell->webView()->setZoomLevel(false, 0); @@ -707,7 +707,7 @@ void LayoutTestController::reset() #endif } -void LayoutTestController::locationChangeDone() +void DRTTestRunner::locationChangeDone() { m_webHistoryItemCount.set(m_shell->navigationEntryCount()); @@ -718,72 +718,72 @@ void LayoutTestController::locationChangeDone() m_workQueue.processWorkSoon(); } -void LayoutTestController::policyDelegateDone() +void DRTTestRunner::policyDelegateDone() { ASSERT(m_waitUntilDone); m_shell->testFinished(); m_waitUntilDone = false; } -void LayoutTestController::setCanOpenWindows(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result) { m_canOpenWindows = true; result->setNull(); } -void LayoutTestController::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webView()->setTabKeyCyclesThroughElements(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::windowCount(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::windowCount(const CppArgumentList&, CppVariant* result) { result->set(static_cast<int>(m_shell->windowCount())); } -void LayoutTestController::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_closeRemainingWindows = arguments[0].value.boolValue; result->setNull(); } -void LayoutTestController::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0) webkit_support::SetAcceptAllCookies(cppVariantToBool(arguments[0])); result->setNull(); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webView()->settings()->setAsynchronousSpellCheckingEnabled(cppVariantToBool(arguments[0])); result->setNull(); } -void LayoutTestController::showWebInspector(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::showWebInspector(const CppArgumentList&, CppVariant* result) { m_shell->showDevTools(); result->setNull(); } -void LayoutTestController::closeWebInspector(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::closeWebInspector(const CppArgumentList& args, CppVariant* result) { m_shell->closeDevTools(); result->setNull(); } -void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->setFocus(m_shell->webView(), arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->userStyleSheetLocation = arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL(); @@ -792,7 +792,7 @@ void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& argum result->setNull(); } -void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { m_userStyleSheetLocation = webkit_support::LocalFileToDataURL( @@ -803,7 +803,7 @@ void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& argu result->setNull(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->authorAndUserStylesEnabled = arguments[0].value.boolValue; @@ -812,7 +812,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& result->setNull(); } -void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::execCommand(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() <= 0 || !arguments[0].isString()) @@ -829,7 +829,7 @@ void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVari m_shell->webView()->focusedFrame()->executeCommand(WebString::fromUTF8(command), WebString::fromUTF8(value)); } -void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() <= 0 || !arguments[0].isString()) { result->setNull(); @@ -841,7 +841,7 @@ void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, Cp result->set(rv); } -void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { bool blockPopups = arguments[0].toBoolean(); @@ -851,78 +851,78 @@ void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& argume result->setNull(); } -void LayoutTestController::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setImagesAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setScriptsAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setStorageAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setPluginsAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result) { // We have no need to support Dashboard Compatibility Mode (mac-only) result->setNull(); } -void LayoutTestController::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support application cache quotas. result->setNull(); } -void LayoutTestController::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support deleting all application cache for an origin. result->setNull(); } -void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support application cache quotas. result->setNull(); } -void LayoutTestController::originsWithApplicationCache(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::originsWithApplicationCache(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support getting origins that have application caches. result->setNull(); } -void LayoutTestController::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support getting disk usage by all application cache for an origin. result->setNull(); } -void LayoutTestController::setScrollbarPolicy(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setScrollbarPolicy(const CppArgumentList&, CppVariant* result) { // FIXME: implement. // Currently only has a non-null implementation on QT. result->setNull(); } -void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { bool enable = arguments[0].value.boolValue; @@ -934,14 +934,14 @@ void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& argume result->setNull(); } -void LayoutTestController::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->waitForPolicyDelegate(); m_waitUntilDone = true; result->setNull(); } -void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string header = arguments[0].toString(); @@ -951,21 +951,21 @@ void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& result->setNull(); } -void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setBlockRedirects(arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setRequestReturnNull(arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() <= 0 || !arguments[0].isString()) @@ -1003,33 +1003,33 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, result->set(webkit_support::RewriteLayoutTestsURL(url).spec()); } -void LayoutTestController::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result) { result->setNull(); m_shouldAddFileToPasteboard = true; } -void LayoutTestController::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) { result->setNull(); m_stopProvisionalFrameLoads = true; } -void LayoutTestController::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setSmartInsertDeleteEnabled(arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue); result->setNull(); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId) +bool DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1045,7 +1045,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& return controller->pauseAnimationAtTime(element, animationName, time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId) +bool DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1061,7 +1061,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& return controller->pauseTransitionAtTime(element, propertyName, time); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebString& elementId) +bool DRTTestRunner::elementDoesAutoCompleteForElementWithId(const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1075,7 +1075,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebStri return inputElement.autoComplete(); } -int LayoutTestController::numberOfActiveAnimations() +int DRTTestRunner::numberOfActiveAnimations() { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1088,7 +1088,7 @@ int LayoutTestController::numberOfActiveAnimations() return controller->numberOfActiveAnimations(); } -void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) { @@ -1099,7 +1099,7 @@ void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgument } } -void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) { @@ -1110,7 +1110,7 @@ void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumen } } -void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1120,7 +1120,7 @@ void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgu result->set(elementDoesAutoCompleteForElementWithId(elementId)); } -void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 4) { result->set(false); @@ -1138,7 +1138,7 @@ void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments result->set(true); } -void LayoutTestController::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() !=2) { result->set(false); @@ -1154,31 +1154,31 @@ void LayoutTestController::disableAutoResizeMode(const CppArgumentList& argument result->set(true); } -void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result) { result->set(numberOfActiveAnimations()); } -void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::disableImageLoading(const CppArgumentList&, CppVariant* result) { m_shell->preferences()->loadsImagesAutomatically = false; m_shell->applyPreferences(); result->setNull(); } -void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result) { // We don't use the WebKit icon database. result->setNull(); } -void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) { result->set(m_shell->webView()->dispatchBeforeUnloadEvent()); } #if ENABLE(NOTIFICATIONS) -void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1190,7 +1190,7 @@ void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentL result->set(true); } -void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1205,14 +1205,14 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis } #endif -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 2 || !arguments[0].isBool() || !arguments[1].isString()) return; m_shell->webView()->setDomainRelaxationForbidden(cppVariantToBool(arguments[0]), cppVariantToWebString(arguments[1])); } -void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() == 1) m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]); @@ -1222,23 +1222,23 @@ void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& a // Unimplemented stubs // -void LayoutTestController::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) { m_dumpSelectionRect = true; result->setNull(); } -void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::display(const CppArgumentList& arguments, CppVariant* result) { WebViewHost* host = m_shell->webViewHost(); const WebKit::WebSize& size = m_shell->webView()->size(); @@ -1249,7 +1249,7 @@ void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result->setNull(); } -void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result) { WebViewHost* host = m_shell->webViewHost(); host->paintInvalidatedRegion(); @@ -1257,59 +1257,59 @@ void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& argum result->setNull(); } -void LayoutTestController::testRepaint(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::testRepaint(const CppArgumentList&, CppVariant* result) { m_testRepaint = true; result->setNull(); } -void LayoutTestController::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) { m_sweepHorizontally = true; result->setNull(); } -void LayoutTestController::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::keepWebHistory(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::keepWebHistory(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->javaScriptCanAccessClipboard = arguments[0].value.boolValue; @@ -1318,7 +1318,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList result->setNull(); } -void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->XSSAuditorEnabled = arguments[0].value.boolValue; @@ -1327,7 +1327,7 @@ void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments result->setNull(); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) { v8::HandleScope scope; WebVector<v8::Local<v8::Value> > values; @@ -1357,7 +1357,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const Cpp } } -void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) { WebScriptSource source(cppVariantToWebString(arguments[1])); @@ -1368,7 +1368,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& result->setNull(); } -void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1380,7 +1380,7 @@ void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& WebSecurityOrigin::createFromString(cppVariantToWebString(arguments[1]))); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->allowUniversalAccessFromFileURLs = arguments[0].value.boolValue; @@ -1389,7 +1389,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgument result->setNull(); } -void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setDisplayingInsecureContentAllowed(arguments[0].toBoolean()); @@ -1397,7 +1397,7 @@ void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentLis result->setNull(); } -void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->allowFileAccessFromFileURLs = arguments[0].value.boolValue; @@ -1406,7 +1406,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& result->setNull(); } -void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setRunningInsecureContentAllowed(arguments[0].value.boolValue); @@ -1416,7 +1416,7 @@ void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentLis // Need these conversions because the format of the value for booleans // may vary - for example, on mac "1" and "0" are used for boolean. -bool LayoutTestController::cppVariantToBool(const CppVariant& value) +bool DRTTestRunner::cppVariantToBool(const CppVariant& value) { if (value.isBool()) return value.toBoolean(); @@ -1433,7 +1433,7 @@ bool LayoutTestController::cppVariantToBool(const CppVariant& value) return false; } -int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) +int32_t DRTTestRunner::cppVariantToInt32(const CppVariant& value) { if (value.isNumber()) return value.toInt32(); @@ -1449,7 +1449,7 @@ int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) return 0; } -WebString LayoutTestController::cppVariantToWebString(const CppVariant& value) +WebString DRTTestRunner::cppVariantToWebString(const CppVariant& value) { if (!value.isString()) { logErrorToConsole("Invalid value for preference. Expected string value."); @@ -1458,7 +1458,7 @@ WebString LayoutTestController::cppVariantToWebString(const CppVariant& value) return WebString::fromUTF8(value.toString()); } -Vector<WebString> LayoutTestController::cppVariantToWebStringArray(const CppVariant& value) +Vector<WebString> DRTTestRunner::cppVariantToWebStringArray(const CppVariant& value) { if (!value.isObject()) { logErrorToConsole("Invalid value for preference. Expected object value."); @@ -1488,7 +1488,7 @@ static void setFontMap(WebPreferences::ScriptFontFamilyMap& map, const Vector<We } } -void LayoutTestController::overridePreference(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2 || !arguments[0].isString()) @@ -1591,13 +1591,13 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments, m_shell->applyPreferences(); } -void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result) { - printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on LayoutTestController\n"); + printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on DRTTestRunner\n"); result->setNull(); } -void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1616,7 +1616,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments[3].toBoolean()); } -void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1635,20 +1635,20 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentLis arguments[3].toBoolean()); } -void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); webkit_support::ClearAllDatabases(); } -void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if ((arguments.size() >= 1) && arguments[0].isNumber()) webkit_support::SetDatabaseQuota(arguments[0].toInt32()); } -void LayoutTestController::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() == 1 && arguments[0].isString()) @@ -1715,13 +1715,13 @@ static bool parsePageNumberSizeMargins(const CppArgumentList& arguments, int arg return true; } -void LayoutTestController::setPrinting(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result) { setIsPrinting(true); result->setNull(); } -void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) { result->set(""); int pageNumber = 0; @@ -1746,7 +1746,7 @@ void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arg result->set(resultString.str()); } -void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result) { result->set(false); int pageIndex = 0; @@ -1758,7 +1758,7 @@ void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& argumen result->set(frame->hasCustomPageSizeStyle(pageIndex)); } -void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pageProperty(const CppArgumentList& arguments, CppVariant* result) { result->set(""); int pageNumber = 0; @@ -1775,7 +1775,7 @@ void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVar frame->printEnd(); } -void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::numberOfPages(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); int pageWidthInPixels = 0; @@ -1792,7 +1792,7 @@ void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVa result->set(numberOfPages); } -void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); Vector<WebViewHost*> windowList = m_shell->windowList(); @@ -1802,14 +1802,14 @@ void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const Cp result->set(numberOfRequests); } -void LayoutTestController::logErrorToConsole(const std::string& text) +void DRTTestRunner::logErrorToConsole(const std::string& text) { m_shell->webViewHost()->didAddMessageToConsole( WebConsoleMessage(WebConsoleMessage::LevelError, WebString::fromUTF8(text)), WebString(), 0); } -void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1817,13 +1817,13 @@ void LayoutTestController::evaluateInWebInspector(const CppArgumentList& argumen m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString()); } -void LayoutTestController::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); m_shell->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0); } -void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addUserScript(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isBool() || !arguments[2].isBool()) @@ -1834,7 +1834,7 @@ void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVa arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly); } -void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool()) @@ -1847,7 +1847,7 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C WebView::UserStyleInjectInExistingDocuments); } -void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber()) @@ -1870,7 +1870,7 @@ void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& argum // FIXME: For greater test flexibility, we should be able to set each page's geolocation mock individually. // https://bugs.webkit.org/show_bug.cgi?id=52368 -void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -1880,7 +1880,7 @@ void LayoutTestController::setGeolocationPermission(const CppArgumentList& argum windowList[i]->geolocationClientMock()->setPermission(arguments[0].toBoolean()); } -void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber()) @@ -1890,7 +1890,7 @@ void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arg windowList[i]->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble()); } -void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1900,13 +1900,13 @@ void LayoutTestController::setMockGeolocationError(const CppArgumentList& argume windowList[i]->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } -void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::abortModal(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } #if ENABLE(INPUT_SPEECH) -void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString()) @@ -1916,7 +1916,7 @@ void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& argum controller->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2])); } -void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -1928,7 +1928,7 @@ void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arg #endif #if ENABLE(SCRIPTED_SPEECH) -void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isNumber()) @@ -1938,7 +1938,7 @@ void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& recognizer->addMockResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble()); } -void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1948,7 +1948,7 @@ void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& recognizer->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } -void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result) { result->set(false); if (MockWebSpeechRecognizer* recognizer = m_shell->webViewHost()->mockSpeechRecognizer()) @@ -1956,7 +1956,7 @@ void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList } #endif -void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 1) @@ -1976,12 +1976,12 @@ void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, Cp input->startSpeechInput(); } -void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::layerTreeAsText(const CppArgumentList& args, CppVariant* result) { result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8()); } -void LayoutTestController::loseCompositorContext(const CppArgumentList& args, CppVariant*) +void DRTTestRunner::loseCompositorContext(const CppArgumentList& args, CppVariant*) { int numTimes; if (args.size() == 1 || !args[0].isNumber()) @@ -1991,7 +1991,7 @@ void LayoutTestController::loseCompositorContext(const CppArgumentList& args, Cp m_shell->webView()->loseCompositorContext(numTimes); } -void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::markerTextForListItem(const CppArgumentList& args, CppVariant* result) { WebElement element; if (!WebBindings::getElement(args[0].value.objectValue, &element)) @@ -2000,7 +2000,7 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp result->set(element.document().frame()->markerTextForListItem(element).utf8()); } -void LayoutTestController::findString(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::findString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 1 || !arguments[0].isString()) return; @@ -2028,7 +2028,7 @@ void LayoutTestController::findString(const CppArgumentList& arguments, CppVaria result->set(findResult); } -void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isNumber()) @@ -2036,7 +2036,7 @@ void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& argume m_shell->webView()->settings()->setMinimumTimerInterval(arguments[0].toDouble()); } -void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAutofilled(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2 || !arguments[1].isBool()) @@ -2053,7 +2053,7 @@ void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVa input->setAutofilled(arguments[1].value.boolValue); } -void LayoutTestController::setValueForUser(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2) @@ -2070,37 +2070,37 @@ void LayoutTestController::setValueForUser(const CppArgumentList& arguments, Cpp input->setValue(cppVariantToWebString(arguments[1]), true); } -void LayoutTestController::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*) +void DRTTestRunner::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*) { // Not Implemented } -void LayoutTestController::syncLocalStorage(const CppArgumentList&, CppVariant*) +void DRTTestRunner::syncLocalStorage(const CppArgumentList&, CppVariant*) { // Not Implemented } -void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() == 1 && arguments[0].isBool()) m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean(); @@ -2108,7 +2108,7 @@ void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const Cp result->setNull(); } -void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -2117,7 +2117,7 @@ void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& argument m_shell->webView()->enableFixedLayoutMode(enableFixedLayout); } -void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) @@ -2127,17 +2127,17 @@ void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, m_shell->webView()->setFixedLayoutSize(WebSize(width, height)); } -void LayoutTestController::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result) { result->set(m_shell->webView()->mainFrame()->selectionAsMarkup().utf8()); } -void LayoutTestController::workerThreadCount(CppVariant* result) +void DRTTestRunner::workerThreadCount(CppVariant* result) { result->set(static_cast<int>(WebWorkerInfo::dedicatedWorkerCount())); } -void LayoutTestController::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) { v8::HandleScope scope; v8::Local<v8::Context> ctx = m_shell->webView()->mainFrame()->mainWorldScriptContext(); @@ -2159,7 +2159,7 @@ void LayoutTestController::sendWebIntentResponse(const CppArgumentList& argument result->setNull(); } -void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 3) return; @@ -2180,7 +2180,7 @@ void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, Cp m_shell->webView()->mainFrame()->deliverIntent(intent, 0, m_intentClient.get()); } -void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) { #if OS(LINUX) || OS(ANDROID) // Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back @@ -2191,10 +2191,10 @@ void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arg result->setNull(); } -class InvokeCallbackTask : public MethodTask<LayoutTestController> { +class InvokeCallbackTask : public MethodTask<DRTTestRunner> { public: - InvokeCallbackTask(LayoutTestController* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) - : MethodTask<LayoutTestController>(object) + InvokeCallbackTask(DRTTestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) + : MethodTask<DRTTestRunner>(object) , m_callbackArguments(callbackArguments) , m_numberOfArguments(numberOfArguments) { @@ -2211,7 +2211,7 @@ private: uint32_t m_numberOfArguments; }; -void LayoutTestController::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isObject()) return; @@ -2225,7 +2225,7 @@ void LayoutTestController::setBackingScaleFactor(const CppArgumentList& argument postTask(new InvokeCallbackTask(this, callbackArguments.release(), 1)); } -void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->pluginsEnabled = arguments[0].toBoolean(); @@ -2234,12 +2234,12 @@ void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, C result->setNull(); } -void LayoutTestController::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result) { m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible, true); } -void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPageVisibility(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string newVisibility = arguments[0].toString(); @@ -2254,12 +2254,12 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C } } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void DRTTestRunner::setAutomaticLinkDetectionEnabled(bool) { // Not Implemented } -void LayoutTestController::setTextDirection(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTextDirection(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 1 || !arguments[0].isString()) @@ -2280,7 +2280,7 @@ void LayoutTestController::setTextDirection(const CppArgumentList& arguments, Cp m_shell->webView()->setTextDirection(direction); } -void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAudioData(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -2297,7 +2297,7 @@ void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVar setShouldDumpAsAudio(true); } -void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -2306,26 +2306,26 @@ void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& } #if ENABLE(POINTER_LOCK) -void LayoutTestController::didLosePointerLock(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::didLosePointerLock(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->didLosePointerLock(); result->setNull(); } -void LayoutTestController::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->setPointerLockWillFailAsynchronously(); result->setNull(); } -void LayoutTestController::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->setPointerLockWillFailSynchronously(); result->setNull(); } #endif -void LayoutTestController::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 4 || !arguments[0].isObject() || !arguments[1].isNumber() || !arguments[2].isNumber() || !arguments[3].isNumber()) diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h index 9cfd12359..e9c0171f9 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.h +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h @@ -30,28 +30,28 @@ */ /* - LayoutTestController class: - Bound to a JavaScript window.layoutTestController object using the + DRTTestRunner class: + Bound to a JavaScript window.testRunner object using the CppBoundClass::bindToJavascript(), this allows layout tests that are run in the test_shell (or, in principle, any web page loaded into a client app built with this class) to control various aspects of how the tests are run and what sort of output they produce. */ -#ifndef LayoutTestController_h -#define LayoutTestController_h +#ifndef DRTTestRunner_h +#define DRTTestRunner_h -#include "TestRunner.h" +#include "TestRunner/TestRunner.h" class TestShell; -class LayoutTestController : public TestRunner { +class DRTTestRunner : public TestRunner { public: // Builds the property and method lists needed to bind this class to a JS // object. - LayoutTestController(TestShell*); + DRTTestRunner(TestShell*); - ~LayoutTestController(); + ~DRTTestRunner(); // This function sets a flag that tells the test_shell to dump pages as // plain text, rather than as a text representation of the renderer's state. @@ -345,7 +345,7 @@ public: void setMockGeolocationPosition(const CppArgumentList&, CppVariant*); void setMockGeolocationError(const CppArgumentList&, CppVariant*); - // Empty stub method to keep parity with object model exposed by global LayoutTestController. + // Empty stub method to keep parity with object model exposed by global DRTTestRunner. void abortModal(const CppArgumentList&, CppVariant*); // Speech input related functions. @@ -528,7 +528,7 @@ private: // queueScript. class WorkQueue { public: - WorkQueue(LayoutTestController* controller) : m_frozen(false), m_controller(controller) { } + WorkQueue(DRTTestRunner* controller) : m_frozen(false), m_controller(controller) { } virtual ~WorkQueue(); void processWorkSoon(); @@ -552,7 +552,7 @@ private: TaskList m_taskList; Deque<WorkItem*> m_queue; bool m_frozen; - LayoutTestController* m_controller; + DRTTestRunner* m_controller; }; // Support for overridePreference. @@ -563,9 +563,9 @@ private: void logErrorToConsole(const std::string&); void completeNotifyDone(bool isTimeout); - class NotifyDoneTimedOutTask: public MethodTask<LayoutTestController> { + class NotifyDoneTimedOutTask: public MethodTask<DRTTestRunner> { public: - NotifyDoneTimedOutTask(LayoutTestController* object): MethodTask<LayoutTestController>(object) { } + NotifyDoneTimedOutTask(DRTTestRunner* object): MethodTask<DRTTestRunner>(object) { } virtual void runIfValid() { m_object->completeNotifyDone(true); } }; @@ -578,7 +578,7 @@ private: // Used for test timeouts. TaskList m_taskList; - // Non-owning pointer. The LayoutTestController is owned by the host. + // Non-owning pointer. The DRTTestRunner is owned by the host. TestShell* m_shell; // If true, the test_shell will produce a plain text dump rather than a @@ -717,4 +717,4 @@ private: bool m_hasCustomFullScreenBehavior; }; -#endif // LayoutTestController_h +#endif // DRTTestRunner_h diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index ae5502cd2..9a8bd7fd4 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -252,7 +252,7 @@ int main(int argc, char* argv[]) shell.callJSGC(); shell.callJSGC(); - // When we finish the last test, cleanup the LayoutTestController. + // When we finish the last test, cleanup the DRTTestRunner. // It may have references to not-yet-cleaned up windows. By cleaning up // here we help purify reports. shell.resetTestController(); diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.h b/Tools/DumpRenderTree/chromium/NotificationPresenter.h index 5fed178da..e98cc7294 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.h +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.h @@ -46,10 +46,10 @@ public: explicit NotificationPresenter(TestShell*) { } virtual ~NotificationPresenter(); - // Called by the LayoutTestController to simulate a user granting permission. + // Called by the DRTTestRunner to simulate a user granting permission. void grantPermission(const WebKit::WebString& origin); - // Called by the LayoutTestController to simulate a user clicking on a notification. + // Called by the DRTTestRunner to simulate a user clicking on a notification. bool simulateClick(const WebKit::WebString& notificationIdentifier); // WebKit::WebNotificationPresenter interface diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index 29a2a3130..9abb13fac 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -33,9 +33,8 @@ #include "DRTDevToolsAgent.h" #include "DRTDevToolsClient.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "MockWebPrerenderingSupport.h" -#include "platform/WebArrayBufferView.h" #include "WebDataSource.h" #include "WebDocument.h" #include "WebElement.h" @@ -49,6 +48,7 @@ #include "WebSettings.h" #include "WebView.h" #include "WebViewHost.h" +#include "platform/WebArrayBufferView.h" #include "skia/ext/platform_canvas.h" #include "webkit/support/webkit_support.h" #include "webkit/support/webkit_support_gfx.h" @@ -119,6 +119,7 @@ TestShell::TestShell() , m_isDisplayingModalDialog(false) { WebRuntimeFeatures::enableDataTransferItems(true); + WebRuntimeFeatures::enableDeviceMotion(false); WebRuntimeFeatures::enableGeolocation(true); WebRuntimeFeatures::enablePointerLock(true); WebRuntimeFeatures::enableIndexedDatabase(true); @@ -151,7 +152,7 @@ void TestShell::initialize() { m_webPermissions = adoptPtr(new WebPermissions(this)); m_testInterfaces = adoptPtr(new TestInterfaces()); - m_layoutTestController = adoptPtr(new LayoutTestController(this)); + m_testRunner = adoptPtr(new DRTTestRunner(this)); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); #endif @@ -240,11 +241,11 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) m_params = params; string testUrl = m_params.testUrl.spec(); - m_layoutTestController->setShouldGeneratePixelResults(shouldDumpPixels); + m_testRunner->setShouldGeneratePixelResults(shouldDumpPixels); if (testUrl.find("loading/") != string::npos || testUrl.find("loading\\") != string::npos) - m_layoutTestController->setShouldDumpFrameLoadCallbacks(true); + m_testRunner->setShouldDumpFrameLoadCallbacks(true); if (testUrl.find("compositing/") != string::npos || testUrl.find("compositing\\") != string::npos) { m_prefs.acceleratedCompositingForVideoEnabled = true; @@ -256,8 +257,8 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) if (testUrl.find("/dumpAsText/") != string::npos || testUrl.find("\\dumpAsText\\") != string::npos) { - m_layoutTestController->setShouldDumpAsText(true); - m_layoutTestController->setShouldGeneratePixelResults(false); + m_testRunner->setShouldDumpAsText(true); + m_testRunner->setShouldGeneratePixelResults(false); } if (testUrl.find("/inspector/") != string::npos @@ -265,7 +266,7 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) showDevTools(); if (m_params.debugLayerTree) - m_layoutTestController->setShowDebugLayerTree(true); + m_testRunner->setShowDebugLayerTree(true); if (m_dumpWhenFinished) m_printer.handleTestHeader(testUrl.c_str()); @@ -298,7 +299,7 @@ void TestShell::resetTestController() resetWebSettings(*webView()); m_webPermissions->reset(); m_testInterfaces->resetAll(); - m_layoutTestController->reset(); + m_testRunner->reset(); m_webViewHost->reset(); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter->reset(); @@ -555,14 +556,14 @@ void TestShell::dump() WebFrame* frame = m_webView->mainFrame(); if (!frame) return; - bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText(); - bool shouldDumpAsAudio = m_layoutTestController->shouldDumpAsAudio(); - bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults(); - bool shouldDumpAsPrinted = m_layoutTestController->isPrinting(); + bool shouldDumpAsText = m_testRunner->shouldDumpAsText(); + bool shouldDumpAsAudio = m_testRunner->shouldDumpAsAudio(); + bool shouldGeneratePixelResults = m_testRunner->shouldGeneratePixelResults(); + bool shouldDumpAsPrinted = m_testRunner->isPrinting(); bool dumpedAnything = false; if (shouldDumpAsAudio) { - const WebKit::WebArrayBufferView& webArrayBufferView = m_layoutTestController->audioData(); + const WebKit::WebArrayBufferView& webArrayBufferView = m_testRunner->audioData(); m_printer.handleAudio(webArrayBufferView.baseAddress(), webArrayBufferView.byteLength()); m_printer.handleAudioFooter(); m_printer.handleTestFooter(true); @@ -586,7 +587,7 @@ void TestShell::dump() } } if (shouldDumpAsText) { - bool recursive = m_layoutTestController->shouldDumpChildFramesAsText(); + bool recursive = m_testRunner->shouldDumpChildFramesAsText(); string dataUtf8 = shouldDumpAsPrinted ? dumpFramesAsPrintedText(frame, recursive) : dumpFramesAsText(frame, recursive); if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size()) FATAL("Short write to stdout, disk full?\n"); @@ -597,10 +598,10 @@ void TestShell::dump() if (m_params.debugRenderTree) renderTextBehavior |= WebFrame::RenderAsTextDebug; printf("%s", frame->renderTreeAsText(renderTextBehavior).utf8().data()); - bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions(); + bool recursive = m_testRunner->shouldDumpChildFrameScrollPositions(); dumpFrameScrollPosition(frame, recursive); } - if (m_layoutTestController->shouldDumpBackForwardList()) + if (m_testRunner->shouldDumpBackForwardList()) printf("%s", dumpAllBackForwardLists().c_str()); } if (dumpedAnything && m_params.printSeparators) @@ -612,18 +613,18 @@ void TestShell::dump() // stdout. dumpedAnything = true; m_webView->layout(); - if (m_layoutTestController->testRepaint()) { + if (m_testRunner->testRepaint()) { WebSize viewSize = m_webView->size(); int width = viewSize.width; int height = viewSize.height; - if (m_layoutTestController->sweepHorizontally()) { + if (m_testRunner->sweepHorizontally()) { for (WebRect column(0, 0, 1, height); column.x < width; column.x++) m_webViewHost->paintRect(column); } else { for (WebRect line(0, 0, width, 1); line.y < height; line.y++) m_webViewHost->paintRect(line); } - } else if (m_layoutTestController->isPrinting()) + } else if (m_testRunner->isPrinting()) m_webViewHost->paintPagesWithBoundaries(); else m_webViewHost->paintInvalidatedRegion(); @@ -631,7 +632,7 @@ void TestShell::dump() // See if we need to draw the selection bounds rect. Selection bounds // rect is the rect enclosing the (possibly transformed) selection. // The rect should be drawn after everything is laid out and painted. - if (m_layoutTestController->shouldDumpSelectionRect()) { + if (m_testRunner->shouldDumpSelectionRect()) { // If there is a selection rect - draw a red 1px border enclosing rect WebRect wr = frame->selectionBoundsRect(); if (!wr.isEmpty()) { @@ -725,8 +726,8 @@ void TestShell::bindJSObjectsToWindow(WebFrame* frame) { WebTestingSupport::injectInternalsObject(frame); m_testInterfaces->bindTo(frame); - m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); - m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("testRunner")); + m_testRunner->bindToJavascript(frame, WebString::fromUTF8("testRunner")); + m_testRunner->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); } WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url) diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 005d374a2..405034a4e 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -32,8 +32,8 @@ #define TestShell_h #include "AccessibilityControllerChromium.h" +#include "DRTTestRunner.h" #include "GamepadController.h" -#include "LayoutTestController.h" #include "NotificationPresenter.h" #include "TestEventPrinter.h" #include "TestInterfaces.h" @@ -87,7 +87,7 @@ public: WebKit::WebView* webView() const { return m_webView; } // Returns the host for the main WebView. WebViewHost* webViewHost() const { return m_webViewHost.get(); } - LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); } + DRTTestRunner* testRunner() const { return m_testRunner.get(); } EventSender* eventSender() const { return m_testInterfaces->eventSender(); } AccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); } #if ENABLE(NOTIFICATIONS) @@ -113,15 +113,15 @@ public: int navigationEntryCount() const; void setFocus(WebKit::WebWidget*, bool enable); - bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); } - bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); } - bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); } - bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); } + bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpFrameLoadCallbacks(); } + bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpUserGestureInFrameLoadCallbacks(); } + bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceLoadCallbacks(); } + bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceResponseMIMETypes(); } void setIsLoading(bool flag) { m_isLoading = flag; } - // Called by the LayoutTestController to signal test completion. + // Called by the DRTTestRunner to signal test completion. void testFinished(); - // Called by LayoutTestController when a test hits the timeout, but does not + // Called by DRTTestRunner when a test hits the timeout, but does not // cause a hang. We can avoid killing TestShell in this case and still dump // the test results. void testTimedOut(); @@ -211,7 +211,7 @@ private: OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent; OwnPtr<DRTDevToolsClient> m_drtDevToolsClient; OwnPtr<TestInterfaces> m_testInterfaces; - OwnPtr<LayoutTestController> m_layoutTestController; + OwnPtr<DRTTestRunner> m_testRunner; #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) OwnPtr<NotificationPresenter> m_notificationPresenter; #endif diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.cpp b/Tools/DumpRenderTree/chromium/WebPermissions.cpp index ee90a7b2c..2c7c9eee8 100644 --- a/Tools/DumpRenderTree/chromium/WebPermissions.cpp +++ b/Tools/DumpRenderTree/chromium/WebPermissions.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "WebPermissions.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "TestShell.h" #include "platform/WebCString.h" #include "platform/WebURL.h" @@ -49,7 +49,7 @@ WebPermissions::~WebPermissions() bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& imageURL) { bool allowed = enabledPerSettings && m_imagesAllowed; - if (layoutTestController()->shouldDumpPermissionClientCallbacks()) + if (testRunner()->shouldDumpPermissionClientCallbacks()) fprintf(stdout, "PERMISSION CLIENT: allowImage(%s): %s\n", m_shell->normalizeLayoutTestURL(imageURL.spec()).c_str(), allowed ? "true" : "false"); return allowed; } @@ -57,7 +57,7 @@ bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, cons bool WebPermissions::allowScriptFromSource(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& scriptURL) { bool allowed = enabledPerSettings && m_scriptsAllowed; - if (layoutTestController()->shouldDumpPermissionClientCallbacks()) + if (testRunner()->shouldDumpPermissionClientCallbacks()) fprintf(stdout, "PERMISSION CLIENT: allowScriptFromSource(%s): %s\n", m_shell->normalizeLayoutTestURL(scriptURL.spec()).c_str(), allowed ? "true" : "false"); return allowed; } @@ -126,7 +126,7 @@ void WebPermissions::reset() // Private functions ---------------------------------------------------------- -LayoutTestController* WebPermissions::layoutTestController() const +DRTTestRunner* WebPermissions::testRunner() const { - return m_shell->layoutTestController(); + return m_shell->testRunner(); } diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.h b/Tools/DumpRenderTree/chromium/WebPermissions.h index 184046a0a..c625077e8 100644 --- a/Tools/DumpRenderTree/chromium/WebPermissions.h +++ b/Tools/DumpRenderTree/chromium/WebPermissions.h @@ -33,7 +33,7 @@ #include "WebPermissionClient.h" -class LayoutTestController; +class DRTTestRunner; class TestShell; class WebPermissions : public WebKit::WebPermissionClient { @@ -63,7 +63,7 @@ public: void reset(); private: - LayoutTestController* layoutTestController() const; + DRTTestRunner* testRunner() const; // Non-owning pointer. The WebPermissions instance is owned by this TestShell instance. TestShell* m_shell; diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 115c405ec..a67d1e304 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -31,8 +31,8 @@ #include "config.h" #include "WebViewHost.h" +#include "DRTTestRunner.h" #include "EventSender.h" -#include "LayoutTestController.h" #include "MockGrammarCheck.h" #include "MockWebSpeechInputController.h" #include "MockWebSpeechRecognizer.h" @@ -251,9 +251,9 @@ static string textAffinityDescription(WebTextAffinity affinity) WebView* WebViewHost::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) { - if (!layoutTestController()->canOpenWindows()) + if (!testRunner()->canOpenWindows()) return 0; - if (layoutTestController()->shouldDumpCreateView()) + if (testRunner()->shouldDumpCreateView()) fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str()); return m_shell->createNewWindow(WebURL())->webView(); } @@ -319,7 +319,7 @@ void WebViewHost::didStartLoading() void WebViewHost::didStopLoading() { - if (layoutTestController()->shouldDumpProgressFinishedCallback()) + if (testRunner()->shouldDumpProgressFinishedCallback()) fputs("postProgressFinishedNotification\n", stdout); m_shell->setIsLoading(false); } @@ -329,50 +329,50 @@ void WebViewHost::didStopLoading() bool WebViewHost::shouldBeginEditing(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldEndEditing(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldInsertNode:", stdout); printNodeDescription(node, 0); fputs(" replacingDOMRange:", stdout); printRangeDescription(range); printf(" givenAction:%s\n", editingActionDescription(action).c_str()); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldInsertText(const WebString& text, const WebRange& range, WebEditingAction action) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:", text.utf8().data()); printRangeDescription(range); printf(" givenAction:%s\n", editingActionDescription(action).c_str()); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldChangeSelectedRange( const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout); printRangeDescription(fromRange); fputs(" toDOMRange:", stdout); @@ -381,27 +381,27 @@ bool WebViewHost::shouldChangeSelectedRange( textAffinityDescription(affinity).c_str(), (stillSelecting ? "TRUE" : "FALSE")); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldDeleteRange(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data()); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::isSmartInsertDeleteEnabled() @@ -416,28 +416,28 @@ bool WebViewHost::isSelectTrailingWhitespaceEnabled() void WebViewHost::didBeginEditing() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout); } void WebViewHost::didChangeSelection(bool isEmptySelection) { - if (layoutTestController()->shouldDumpEditingCallbacks()) + if (testRunner()->shouldDumpEditingCallbacks()) fputs("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n", stdout); // No need to update clipboard with the selected text in DRT. } void WebViewHost::didChangeContents() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout); } void WebViewHost::didEndEditing() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout); } @@ -561,7 +561,7 @@ bool WebViewHost::runModalPromptDialog(WebFrame* frame, const WebString& message bool WebViewHost::runModalBeforeUnloadDialog(WebFrame*, const WebString& message) { printf("CONFIRM NAVIGATION: %s\n", message.utf8().data()); - return !layoutTestController()->shouldStayOnPageAfterHandlingBeforeUnload(); + return !testRunner()->shouldStayOnPageAfterHandlingBeforeUnload(); } void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData& contextMenuData) @@ -581,7 +581,7 @@ WebContextMenuData* WebViewHost::lastContextMenuData() const void WebViewHost::setStatusText(const WebString& text) { - if (!layoutTestController()->shouldDumpStatusCallbacks()) + if (!testRunner()->shouldDumpStatusCallbacks()) return; // When running tests, write to stdout. printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data()); @@ -590,7 +590,7 @@ void WebViewHost::setStatusText(const WebString& text) void WebViewHost::startDragging(WebFrame*, const WebDragData& data, WebDragOperationsMask mask, const WebImage&, const WebPoint&) { WebDragData mutableDragData = data; - if (layoutTestController()->shouldAddFileToPasteboard()) { + if (testRunner()->shouldAddFileToPasteboard()) { // Add a file called DRTFakeFile to the drag&drop clipboard. addDRTFakeFileToDataObject(&mutableDragData); } @@ -1055,7 +1055,7 @@ WebNavigationPolicy WebViewHost::decidePolicyForNavigation( result = WebKit::WebNavigationPolicyIgnore; if (m_policyDelegateShouldNotifyDone) - layoutTestController()->policyDelegateDone(); + testRunner()->policyDelegateDone(); return result; } @@ -1113,7 +1113,7 @@ void WebViewHost::didCancelClientRedirect(WebFrame* frame) void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds) { ds->setExtraData(m_pendingExtraData.leakPtr()); - if (!layoutTestController()->deferMainResourceDataLoad()) + if (!testRunner()->deferMainResourceDataLoad()) ds->setDeferMainResourceDataLoad(false); } @@ -1130,7 +1130,7 @@ void WebViewHost::didStartProvisionalLoad(WebFrame* frame) if (!m_topLoadingFrame) m_topLoadingFrame = frame; - if (layoutTestController()->stopProvisionalFrameLoads()) { + if (testRunner()->stopProvisionalFrameLoads()) { printFrameDescription(frame); fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout); frame->stopLoading(); @@ -1183,11 +1183,11 @@ void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTe printf(" - didReceiveTitle: %s\n", title8.data()); } - if (layoutTestController()->shouldDumpTitleChanges()) + if (testRunner()->shouldDumpTitleChanges()) printf("TITLE CHANGED: %s\n", title8.data()); setPageTitle(title); - layoutTestController()->setTitleTextDirection(direction); + testRunner()->setTitleTextDirection(direction); } void WebViewHost::didFinishDocumentLoad(WebFrame* frame) @@ -1281,7 +1281,7 @@ void WebViewHost::willSendRequest(WebFrame* frame, unsigned identifier, WebURLRe string requestURL = url.possibly_invalid_spec(); GURL mainDocumentURL = request.firstPartyForCookies(); - if (layoutTestController()->shouldDumpResourceLoadCallbacks()) { + if (testRunner()->shouldDumpResourceLoadCallbacks()) { printResourceDescription(identifier); printf(" - willSendRequest <NSURLRequest URL %s, main document URL %s," " http method %s> redirectResponse ", @@ -1385,9 +1385,14 @@ void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long webkit_support::OpenFileSystem(frame, type, size, create, callbacks); } +void WebViewHost::deleteFileSystem(WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, WebKit::WebFileSystemCallbacks* callbacks) +{ + webkit_support::DeleteFileSystem(frame, type, callbacks); +} + bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurityOrigin target, WebDOMMessageEvent event) { - if (m_shell->layoutTestController()->shouldInterceptPostMessage()) { + if (m_shell->testRunner()->shouldInterceptPostMessage()) { fputs("intercepted postMessage\n", stdout); return true; } @@ -1638,9 +1643,9 @@ bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload) // Private functions ---------------------------------------------------------- -LayoutTestController* WebViewHost::layoutTestController() const +DRTTestRunner* WebViewHost::testRunner() const { - return m_shell->layoutTestController(); + return m_shell->testRunner(); } void WebViewHost::updateAddressBar(WebView* webView) @@ -1660,7 +1665,7 @@ void WebViewHost::locationChangeDone(WebFrame* frame) if (frame != m_topLoadingFrame) return; m_topLoadingFrame = 0; - layoutTestController()->locationChangeDone(); + testRunner()->locationChangeDone(); } void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation) @@ -1780,7 +1785,7 @@ void WebViewHost::setAddressBarURL(const WebURL&) void WebViewHost::enterFullScreenNow() { - if (layoutTestController()->hasCustomFullScreenBehavior()) + if (testRunner()->hasCustomFullScreenBehavior()) return; webView()->willEnterFullScreen(); @@ -1789,7 +1794,7 @@ void WebViewHost::enterFullScreenNow() void WebViewHost::exitFullScreenNow() { - if (layoutTestController()->hasCustomFullScreenBehavior()) + if (testRunner()->hasCustomFullScreenBehavior()) return; webView()->willExitFullScreen(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 13f2e1ec5..94ed4cd8d 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -47,7 +47,7 @@ #include <wtf/Vector.h> #include <wtf/text/WTFString.h> -class LayoutTestController; +class DRTTestRunner; class MockWebSpeechInputController; class MockWebSpeechRecognizer; class SkCanvas; @@ -264,6 +264,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&); virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage); virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*); + virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*); virtual bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent); virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&); virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&); @@ -277,7 +278,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, void finishLastTextCheck(); virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) OVERRIDE; - // Geolocation client mocks for LayoutTestController + // Geolocation client mocks for DRTTestRunner WebKit::WebGeolocationClientMock* geolocationClientMock(); // Pending task list, Note taht the method is referred from MethodTask class. @@ -302,7 +303,7 @@ private: CallbackMethodType m_callback; }; - LayoutTestController* layoutTestController() const; + DRTTestRunner* testRunner() const; // Called the title of the page changes. // Can be used to update the title of the window. diff --git a/Tools/DumpRenderTree/efl/CMakeLists.txt b/Tools/DumpRenderTree/efl/CMakeLists.txt index 067dbd32b..7d99f073f 100644 --- a/Tools/DumpRenderTree/efl/CMakeLists.txt +++ b/Tools/DumpRenderTree/efl/CMakeLists.txt @@ -2,7 +2,7 @@ SET(DumpRenderTree_SOURCES ${TOOLS_DIR}/DumpRenderTree/DumpRenderTreeCommon.cpp ${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp ${TOOLS_DIR}/DumpRenderTree/GCController.cpp - ${TOOLS_DIR}/DumpRenderTree/LayoutTestController.cpp + ${TOOLS_DIR}/DumpRenderTree/TestRunner.cpp ${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp ${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp ${TOOLS_DIR}/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp @@ -15,7 +15,7 @@ SET(DumpRenderTree_SOURCES ${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp ${TOOLS_DIR}/DumpRenderTree/efl/GCControllerEfl.cpp ${TOOLS_DIR}/DumpRenderTree/efl/JSStringUtils.cpp - ${TOOLS_DIR}/DumpRenderTree/efl/LayoutTestControllerEfl.cpp + ${TOOLS_DIR}/DumpRenderTree/efl/TestRunnerEfl.cpp ${TOOLS_DIR}/DumpRenderTree/efl/PixelDumpSupportEfl.cpp ${TOOLS_DIR}/DumpRenderTree/efl/TextInputController.cpp ${TOOLS_DIR}/DumpRenderTree/efl/WorkQueueItemEfl.cpp @@ -40,8 +40,8 @@ SET(DumpRenderTree_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${SQLITE_LIBRARIES} - ${Glib_LIBRARIES} - ${LIBSOUP24_LIBRARIES} + ${GLIB_LIBRARIES} + ${LIBSOUP_LIBRARIES} ) SET(DumpRenderTree_INCLUDE_DIRECTORIES @@ -100,8 +100,8 @@ SET(DumpRenderTree_INCLUDE_DIRECTORIES ${EFLDEPS_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} ${FONTCONFIG_INCLUDE_DIR} - ${Glib_INCLUDE_DIRS} - ${LIBSOUP24_INCLUDE_DIRS} + ${GLIB_INCLUDE_DIRS} + ${LIBSOUP_INCLUDE_DIRS} ) SET(DumpRenderTree_LINK_FLAGS @@ -109,7 +109,6 @@ SET(DumpRenderTree_LINK_FLAGS ${EDJE_LDFLAGS} ${EFLDEPS_LDFLAGS} ${EVAS_LDFLAGS} - ${LIBSOUP24_LDFLAGS} ) # FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp index 0713cb60c..c1e480134 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp @@ -31,9 +31,9 @@ #include "DumpRenderTreeView.h" #include "EventSender.h" #include "FontManagement.h" -#include "LayoutTestController.h" #include "NotImplemented.h" #include "PixelDumpSupport.h" +#include "TestRunner.h" #include "WebCoreSupport/DumpRenderTreeSupportEfl.h" #include "WebCoreTestSupport.h" #include "WorkQueue.h" @@ -62,7 +62,7 @@ Ecore_Timer* waitToDumpWatchdog = 0; extern Ewk_History_Item* prevTestBFItem; // From the top-level DumpRenderTree.h -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; volatile bool done = false; static bool dumpPixelsForCurrentTest; @@ -85,7 +85,7 @@ static String dumpFramesAsText(Evas_Object* frame) result.append("\n"); eina_stringshare_del(frameContents); - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { Eina_List* children = DumpRenderTreeSupportEfl::frameChildren(frame); void* iterator; @@ -128,7 +128,7 @@ static void dumpFrameScrollPosition(Evas_Object* frame) printf("%s", result.toString().utf8().data()); } - if (gLayoutTestController->dumpChildFrameScrollPositions()) { + if (gTestRunner->dumpChildFrameScrollPositions()) { Eina_List* children = DumpRenderTreeSupportEfl::frameChildren(frame); void* iterator; @@ -215,29 +215,29 @@ static inline bool isGlobalHistoryTest(const String& cTestPathOrURL) return cTestPathOrURL.contains("/globalhistory/"); } -static void createLayoutTestController(const String& testURL, const String& expectedPixelHash) +static void createTestRunner(const String& testURL, const String& expectedPixelHash) { - gLayoutTestController = - LayoutTestController::create(std::string(testURL.utf8().data()), + gTestRunner = + TestRunner::create(std::string(testURL.utf8().data()), std::string(expectedPixelHash.utf8().data())); topLoadingFrame = 0; done = false; - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (shouldLogFrameLoadDelegates(testURL)) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(testURL)) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); - gLayoutTestController->setDumpHistoryDelegateCallbacks(isGlobalHistoryTest(testURL)); + gTestRunner->setDumpHistoryDelegateCallbacks(isGlobalHistoryTest(testURL)); if (shouldDumpAsText(testURL)) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } @@ -268,14 +268,14 @@ static void runTest(const char* inputLine) const String testURL = getFinalTestURL(testPathOrURL); browser->resetDefaultsToConsistentValues(); - createLayoutTestController(testURL, expectedPixelHash); + createTestRunner(testURL, expectedPixelHash); WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); const bool isSVGW3CTest = testURL.contains("svg/W3C-SVG-1.1"); - const int width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth; - const int height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight; + const int width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth; + const int height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight; evas_object_resize(browser->mainView(), width, height); if (prevTestBFItem) @@ -288,8 +288,8 @@ static void runTest(const char* inputLine) ecore_main_loop_begin(); - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); browser->clearExtraViews(); @@ -298,7 +298,7 @@ static void runTest(const char* inputLine) ewk_view_uri_set(browser->mainView(), "about:blank"); - gLayoutTestController.clear(); + gTestRunner.clear(); sendPixelResultsEOF(); } @@ -320,15 +320,15 @@ static void adjustOutputTypeByMimeType(const Evas_Object* frame) { const String responseMimeType(DumpRenderTreeSupportEfl::responseMimeType(frame)); if (responseMimeType == "text/plain") { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } static void dumpFrameContentsAsText(Evas_Object* frame) { String result; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) result = dumpFramesAsText(frame); else result = DumpRenderTreeSupportEfl::renderTreeDump(frame); @@ -338,17 +338,17 @@ static void dumpFrameContentsAsText(Evas_Object* frame) static bool shouldDumpFrameScrollPosition() { - return !gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive(); + return !gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive(); } static bool shouldDumpPixelsAndCompareWithExpected() { - return dumpPixelsForCurrentTest && gLayoutTestController->generatePixelResults() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive(); + return dumpPixelsForCurrentTest && gTestRunner->generatePixelResults() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive(); } static bool shouldDumpBackForwardList() { - return gLayoutTestController->dumpBackForwardList(); + return gTestRunner->dumpBackForwardList(); } static bool initEfl() @@ -412,7 +412,7 @@ void dump() } if (shouldDumpPixelsAndCompareWithExpected()) - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); done = true; ecore_main_loop_quit(); diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp index 0d1fa4b63..c167aca51 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp @@ -34,8 +34,8 @@ #include "EventSender.h" #include "GCController.h" #include "KURL.h" -#include "LayoutTestController.h" #include "NotImplemented.h" +#include "TestRunner.h" #include "TextInputController.h" #include "WebCoreSupport/DumpRenderTreeSupportEfl.h" #include "WebCoreTestSupport.h" @@ -148,7 +148,7 @@ Evas_Object* DumpRenderTreeChrome::createWebInspectorView() Evas_Object* mainFrame = ewk_view_frame_main_get(inspectorView); evas_object_smart_callback_add(mainFrame, "load,finished", onInspectorFrameLoadFinished, 0); - evas_object_resize(inspectorView, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight); + evas_object_resize(inspectorView, TestRunner::maxViewWidth, TestRunner::maxViewHeight); evas_object_show(inspectorView); evas_object_focus_set(inspectorView, true); @@ -418,12 +418,12 @@ void DumpRenderTreeChrome::onWindowObjectCleared(void* userData, Evas_Object*, v { Ewk_Window_Object_Cleared_Event* objectClearedInfo = static_cast<Ewk_Window_Object_Cleared_Event*>(eventInfo); JSValueRef exception = 0; - ASSERT(gLayoutTestController); + ASSERT(gTestRunner); GCController* gcController = static_cast<GCController*>(userData); ASSERT(gcController); - gLayoutTestController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception); + gTestRunner->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception); ASSERT(!exception); gcController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception); @@ -456,7 +456,7 @@ void DumpRenderTreeChrome::onLoadStarted(void*, Evas_Object* view, void* eventIn Eina_Bool DumpRenderTreeChrome::processWork(void*) { - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); return ECORE_CALLBACK_CANCEL; @@ -467,7 +467,7 @@ void DumpRenderTreeChrome::topLoadingFrameLoadFinished() topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); - if (gLayoutTestController->waitToDump()) + if (gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -478,7 +478,7 @@ void DumpRenderTreeChrome::topLoadingFrameLoadFinished() void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventInfo) { - if (!gLayoutTestController->dumpStatusCallbacks()) + if (!gTestRunner->dumpStatusCallbacks()) return; const char* statusbarText = static_cast<const char*>(eventInfo); @@ -487,7 +487,7 @@ void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventIn void DumpRenderTreeChrome::onFrameIconChanged(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpIconChanges()) { + if (!done && gTestRunner->dumpIconChanges()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didChangeIcons\n", frameName.utf8().data()); } @@ -497,19 +497,19 @@ void DumpRenderTreeChrome::onFrameTitleChanged(void*, Evas_Object* frame, void* { const Ewk_Text_With_Direction* titleText = static_cast<const Ewk_Text_With_Direction*>(eventInfo); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didReceiveTitle: %s\n", frameName.utf8().data(), (titleText && titleText->string) ? titleText->string : ""); } - if (!done && gLayoutTestController->dumpTitleChanges()) + if (!done && gTestRunner->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", (titleText && titleText->string) ? titleText->string : ""); - if (!done && gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!done && gTestRunner->dumpHistoryDelegateCallbacks()) printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", ewk_frame_uri_get(frame) , (titleText && titleText->string) ? titleText->string : ""); - gLayoutTestController->setTitleTextDirection(titleText->direction == EWK_TEXT_DIRECTION_LEFT_TO_RIGHT ? "ltr" : "rtl"); + gTestRunner->setTitleTextDirection(titleText->direction == EWK_TEXT_DIRECTION_LEFT_TO_RIGHT ? "ltr" : "rtl"); } void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eventInfo) @@ -517,7 +517,7 @@ void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eve const Evas_Object* frame = static_cast<Evas_Object*>(eventInfo); const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", frameName.utf8().data()); else if (!done) { const unsigned pendingFrameUnloadEvents = DumpRenderTreeSupportEfl::pendingUnloadEventCount(frame); @@ -530,19 +530,19 @@ void DumpRenderTreeChrome::onWillSendRequest(void*, Evas_Object*, void* eventInf { Ewk_Frame_Resource_Messages* messages = static_cast<Ewk_Frame_Resource_Messages*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - willSendRequest %s redirectResponse %s\n", m_dumpAssignedUrls.contains(messages->request->identifier) ? m_dumpAssignedUrls.get(messages->request->identifier).data() : "<unknown>", descriptionSuitableForTestResult(messages->request).data(), descriptionSuitableForTestResult(messages->redirect_response).data()); - if (!done && gLayoutTestController->willSendRequestReturnsNull()) { - // As requested by the LayoutTestController, don't perform the request. + if (!done && gTestRunner->willSendRequestReturnsNull()) { + // As requested by the TestRunner, don't perform the request. messages->request->url = 0; return; } - if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && messages->redirect_response) { + if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && messages->redirect_response) { printf("Returning null for this redirect\n"); messages->request->url = 0; return; @@ -560,7 +560,7 @@ void DumpRenderTreeChrome::onWillSendRequest(void*, Evas_Object*, void* eventInf return; } - const std::string& destination = gLayoutTestController->redirectionDestinationForURL(url.string().utf8().data()); + const std::string& destination = gTestRunner->redirectionDestinationForURL(url.string().utf8().data()); if (destination.length()) messages->request->url = strdup(destination.c_str()); } @@ -569,7 +569,7 @@ void DumpRenderTreeChrome::onWebViewOnloadEvent(void*, Evas_Object*, void* event { const Evas_Object* frame = static_cast<Evas_Object*>(eventInfo); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didHandleOnloadEventsForFrame\n", frameName.utf8().data()); } @@ -577,13 +577,13 @@ void DumpRenderTreeChrome::onWebViewOnloadEvent(void*, Evas_Object*, void* event void DumpRenderTreeChrome::onInsecureContentRun(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didRunInsecureContent\n"); } void DumpRenderTreeChrome::onInsecureContentDisplayed(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didDisplayInsecureContent\n"); } @@ -608,7 +608,7 @@ void DumpRenderTreeChrome::onFrameCreated(void*, Evas_Object*, void* eventInfo) void DumpRenderTreeChrome::onWebViewNavigatedWithData(void*, Evas_Object*, void* eventInfo) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; ASSERT(eventInfo); @@ -631,7 +631,7 @@ void DumpRenderTreeChrome::onWebViewNavigatedWithData(void*, Evas_Object*, void* void DumpRenderTreeChrome::onWebViewServerRedirect(void*, Evas_Object*, void* eventInfo) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; ASSERT(eventInfo); @@ -641,7 +641,7 @@ void DumpRenderTreeChrome::onWebViewServerRedirect(void*, Evas_Object*, void* ev void DumpRenderTreeChrome::onWebViewClientRedirect(void*, Evas_Object*, void* eventInfo) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; ASSERT(eventInfo); @@ -651,7 +651,7 @@ void DumpRenderTreeChrome::onWebViewClientRedirect(void*, Evas_Object*, void* ev void DumpRenderTreeChrome::onWebViewPopulateVisitedLinks(void*, Evas_Object* ewkView, void*) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; printf("Asked to populate visited links for WebView \"%s\"\n", ewk_view_uri_get(ewkView)); @@ -678,7 +678,7 @@ void DumpRenderTreeChrome::onInspectorFrameLoadFinished(void*, Evas_Object*, voi void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didStartProvisionalLoadForFrame\n", frameName.utf8().data()); } @@ -686,7 +686,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, voi if (!topLoadingFrame && !done) topLoadingFrame = frame; - if (!done && gLayoutTestController->stopProvisionalFrameLoads()) { + if (!done && gTestRunner->stopProvisionalFrameLoads()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - stopping load in didStartProvisionalLoadForFrame callback\n", frameName.utf8().data()); ewk_frame_stop(frame); @@ -697,7 +697,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoadFailed(void*, Evas_Object* fram { m_provisionalLoadFailedFrame = frame; - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didFailProvisionalLoadWithError\n", frameName.utf8().data()); } @@ -705,7 +705,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoadFailed(void*, Evas_Object* fram void DumpRenderTreeChrome::onFrameLoadCommitted(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didCommitLoadForFrame\n", frameName.utf8().data()); } @@ -721,10 +721,10 @@ void DumpRenderTreeChrome::onFrameLoadFinished(void*, Evas_Object* frame, void* if (error) return; - if (!done && gLayoutTestController->dumpProgressFinishedCallback()) + if (!done && gTestRunner->dumpProgressFinishedCallback()) printf("postProgressFinishedNotification\n"); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didFinishLoadForFrame\n", frameName.utf8().data()); } @@ -738,7 +738,7 @@ void DumpRenderTreeChrome::onFrameLoadError(void*, Evas_Object* frame, void*) // In case of provisional load error, we receive both "load,error" and "load,provisional,failed" // signals. m_provisionalLoadFailedFrame is used to avoid printing twice the load error: in // onFrameProvisionalLoadFailed() and onFrameLoadError(). - if (!done && gLayoutTestController->dumpFrameLoadCallbacks() && frame != m_provisionalLoadFailedFrame) { + if (!done && gTestRunner->dumpFrameLoadCallbacks() && frame != m_provisionalLoadFailedFrame) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didFailLoadWithError\n", frameName.utf8().data()); } @@ -752,7 +752,7 @@ void DumpRenderTreeChrome::onFrameLoadError(void*, Evas_Object* frame, void*) void DumpRenderTreeChrome::onFrameRedirectCancelled(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didCancelClientRedirectForFrame\n", frameName.utf8().data()); } @@ -760,7 +760,7 @@ void DumpRenderTreeChrome::onFrameRedirectCancelled(void*, Evas_Object* frame, v void DumpRenderTreeChrome::onFrameRedirectForProvisionalLoad(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", frameName.utf8().data()); } @@ -770,7 +770,7 @@ void DumpRenderTreeChrome::onFrameRedirectRequested(void*, Evas_Object* frame, v { const char* url = static_cast<const char*>(eventInfo); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - willPerformClientRedirectToURL: %s \n", frameName.utf8().data(), pathSuitableForTestResult(url).data()); } @@ -778,7 +778,7 @@ void DumpRenderTreeChrome::onFrameRedirectRequested(void*, Evas_Object* frame, v void DumpRenderTreeChrome::onDidDetectXSS(void*, Evas_Object* view, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didDetectXSS\n"); } @@ -786,14 +786,14 @@ void DumpRenderTreeChrome::onResponseReceived(void*, Evas_Object*, void* eventIn { Ewk_Frame_Resource_Response* response = static_cast<Ewk_Frame_Resource_Response*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { CString responseDescription(descriptionSuitableForTestResult(response)); printf("%s - didReceiveResponse %s\n", m_dumpAssignedUrls.contains(response->identifier) ? m_dumpAssignedUrls.get(response->identifier).data() : "<unknown>", responseDescription.data()); } - if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) { + if (!done && gTestRunner->dumpResourceResponseMIMETypes()) { printf("%s has MIME type %s\n", KURL(ParsedURLString, response->url).lastPathComponent().utf8().data(), response->mime_type); @@ -804,7 +804,7 @@ void DumpRenderTreeChrome::onResourceLoadFinished(void*, Evas_Object*, void* eve { unsigned long identifier = *static_cast<unsigned long*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - didFinishLoading\n", (m_dumpAssignedUrls.contains(identifier) ? m_dumpAssignedUrls.take(identifier).data() : "<unknown>")); } @@ -813,7 +813,7 @@ void DumpRenderTreeChrome::onResourceLoadFailed(void*, Evas_Object*, void* event { Ewk_Frame_Load_Error* error = static_cast<Ewk_Frame_Load_Error*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - didFailLoadingWithError: %s\n", (m_dumpAssignedUrls.contains(error->resource_identifier) ? m_dumpAssignedUrls.take(error->resource_identifier).data() : "<unknown>"), descriptionSuitableForTestResult(error).data()); @@ -823,7 +823,7 @@ void DumpRenderTreeChrome::onNewResourceRequest(void*, Evas_Object*, void* event { Ewk_Frame_Resource_Request* request = static_cast<Ewk_Frame_Resource_Request*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) m_dumpAssignedUrls.add(request->identifier, pathSuitableForTestResult(request->url)); } diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp index eb15a8409..f801c3cef 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp @@ -30,7 +30,7 @@ #include "DumpRenderTree.h" #include "DumpRenderTreeChrome.h" #include "DumpRenderTreeEfl.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <EWebKit.h> #include <Ecore.h> #include <Eina.h> @@ -95,7 +95,7 @@ static Eina_Bool onJavaScriptPrompt(Ewk_View_Smart_Data*, Evas_Object*, const ch static Evas_Object* onWindowCreate(Ewk_View_Smart_Data*, Eina_Bool, const Ewk_Window_Features*) { - return gLayoutTestController->canOpenWindows() ? browser->createNewWindow() : 0; + return gTestRunner->canOpenWindows() ? browser->createNewWindow() : 0; } static Eina_Bool onWindowCloseDelayed(void* data) @@ -113,7 +113,7 @@ static void onWindowClose(Ewk_View_Smart_Data* smartData) static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* databaseName, uint64_t currentSize, uint64_t expectedSize) { - if (!gLayoutTestController->dumpDatabaseCallbacks()) + if (!gTestRunner->dumpDatabaseCallbacks()) return 0; Ewk_Security_Origin* origin = ewk_frame_security_origin_get(frame); @@ -129,7 +129,7 @@ static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Obj static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Security_Origin *origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded) { - if (gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) { + if (gTestRunner->dumpApplicationCacheDelegateCallbacks()) { // For example, numbers from 30000 - 39999 will output as 30000. // Rounding up or down does not really matter for these tests. It's // sufficient to just get a range of 10000 to determine if we were @@ -142,7 +142,7 @@ static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Securit truncatedSpaceNeeded); } - if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota()) + if (gTestRunner->disallowIncreaseForApplicationCacheQuota()) return 0; return defaultOriginQuota; @@ -187,8 +187,8 @@ static Eina_Bool onNavigationPolicyDecision(Ewk_View_Smart_Data*, Ewk_Frame_Reso printf("Policy delegate: attempt to load %s with navigation type '%s'\n", urlSuitableForTestResult(request->url).utf8().data(), navigationTypeToString(navigationType)); - if (gLayoutTestController) - gLayoutTestController->notifyDone(); + if (gTestRunner) + gTestRunner->notifyDone(); return policyDelegatePermissive; } diff --git a/Tools/DumpRenderTree/efl/EditingCallbacks.cpp b/Tools/DumpRenderTree/efl/EditingCallbacks.cpp index 896d83f7e..7a03cddd1 100644 --- a/Tools/DumpRenderTree/efl/EditingCallbacks.cpp +++ b/Tools/DumpRenderTree/efl/EditingCallbacks.cpp @@ -33,10 +33,10 @@ #include "DumpRenderTree.h" #include "EditorClientEfl.h" #include "EditorInsertAction.h" -#include "LayoutTestController.h" #include "Node.h" #include "Range.h" #include "StylePropertySet.h" +#include "TestRunner.h" #include "TextAffinity.h" #include <wtf/text/CString.h> #include <wtf/text/WTFString.h> @@ -87,7 +87,7 @@ static const char* selectionAffinityString(WebCore::EAffinity affinity) void shouldBeginEditing(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo); printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).utf8().data()); } @@ -95,7 +95,7 @@ void shouldBeginEditing(void*, Evas_Object*, void* eventInfo) void shouldEndEditing(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo); printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).utf8().data()); } @@ -103,7 +103,7 @@ void shouldEndEditing(void*, Evas_Object*, void* eventInfo) void shouldInsertNode(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Insert_Node_Event* shouldInsertNodeEvent = static_cast<Ewk_Should_Insert_Node_Event*>(eventInfo); printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", dumpPath(shouldInsertNodeEvent->node).utf8().data(), dumpRange(shouldInsertNodeEvent->range).utf8().data(), @@ -113,7 +113,7 @@ void shouldInsertNode(void*, Evas_Object*, void* eventInfo) void shouldInsertText(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Insert_Text_Event* shouldInsertTextEvent = static_cast<Ewk_Should_Insert_Text_Event*>(eventInfo); printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", shouldInsertTextEvent->text, dumpRange(shouldInsertTextEvent->range).utf8().data(), insertActionString(shouldInsertTextEvent->action)); @@ -122,7 +122,7 @@ void shouldInsertText(void*, Evas_Object*, void* eventInfo) void shouldDeleteRange(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo); printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).utf8().data()); } @@ -130,7 +130,7 @@ void shouldDeleteRange(void*, Evas_Object*, void* eventInfo) void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Change_Selected_Range_Event* shouldChangeSelectedRangeEvent = static_cast<Ewk_Should_Change_Selected_Range_Event*>(eventInfo); printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", dumpRange(shouldChangeSelectedRangeEvent->fromRange).utf8().data(), dumpRange(shouldChangeSelectedRangeEvent->toRange).utf8().data(), @@ -140,7 +140,7 @@ void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo) void shouldApplyStyle(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Apply_Style_Event* shouldApplyStyleEvent = static_cast<Ewk_Should_Apply_Style_Event*>(eventInfo); printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", shouldApplyStyleEvent->style->asText().utf8().data(), dumpRange(shouldApplyStyleEvent->range).utf8().data()); @@ -149,25 +149,25 @@ void shouldApplyStyle(void*, Evas_Object*, void* eventInfo) void editingBegan(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n"); } void userChangedContents(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); } void editingEnded(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n"); } void selectionChanged(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); } diff --git a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp index 71891dcb4..1b1dca326 100644 --- a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp +++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp @@ -35,7 +35,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "DumpRenderTree.h" #include "DumpRenderTreeChrome.h" @@ -62,16 +62,16 @@ enum { WebCacheModelPrimaryWebBrowser = 2 }; -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -void LayoutTestController::addDisallowedURL(JSStringRef) +void TestRunner::addDisallowedURL(JSStringRef) { notImplemented(); } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { Ewk_History* history = ewk_view_history_get(browser->mainView()); if (!history) @@ -84,51 +84,51 @@ void LayoutTestController::clearBackForwardList() ewk_history_item_free(item); } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef) { notImplemented(); return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef) { notImplemented(); return 0; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 notImplemented(); } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { notImplemented(); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return DumpRenderTreeSupportEfl::computedStyleIncludingVisitedInfo(context, value); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { notImplemented(); return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("")); } -int LayoutTestController::numberOfPages(float pageWidth, float pageHeight) +int TestRunner::numberOfPages(float pageWidth, float pageHeight) { return DumpRenderTreeSupportEfl::numberOfPages(browser->mainFrame(), pageWidth, pageHeight); } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { const String property = DumpRenderTreeSupportEfl::pageProperty(browser->mainFrame(), propertyName, pageNumber); if (property.isEmpty()) @@ -138,7 +138,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* property return propertyValue; } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { String pageSizeAndMargins = DumpRenderTreeSupportEfl::pageSizeAndMarginsInPixels(browser->mainFrame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); @@ -149,7 +149,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pa return returnValue; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { const Ewk_History* history = ewk_view_history_get(browser->mainView()); if (!history) @@ -158,12 +158,12 @@ size_t LayoutTestController::webHistoryItemCount() return ewk_history_back_list_length(history) + ewk_history_forward_list_length(history); } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { return DumpRenderTreeSupportEfl::workerThreadCount(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) dump(); @@ -171,7 +171,7 @@ void LayoutTestController::notifyDone() waitForPolicy = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) { String requestedUrl(url->characters(), url->length()); String resourceRoot; @@ -197,7 +197,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt return JSStringCreateWithUTF8CString(fullPathToUrl.utf8().data()); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { WebCore::KURL baseURL(WebCore::KURL(), String::fromUTF8(ewk_frame_uri_get(browser->mainFrame()))); WebCore::KURL absoluteURL(baseURL, WTF::String(url->ustring().impl())); @@ -208,35 +208,35 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { ewk_view_editable_set(browser->mainView(), acceptsEditing); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { ewk_cookies_policy_set(alwaysAcceptCookies ? EWK_COOKIE_JAR_ACCEPT_ALWAYS : EWK_COOKIE_JAR_ACCEPT_NEVER); } -void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive) { policyDelegateEnabled = enabled; policyDelegatePermissive = permissive; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setCustomPolicyDelegate(true, false); waitForPolicy = true; setWaitToDump(true); } -void LayoutTestController::setScrollbarPolicy(JSStringRef, JSStringRef) +void TestRunner::setScrollbarPolicy(JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { WebCore::KURL kurl; kurl.setProtocol(String(protocol->characters(), protocol->length())); @@ -245,7 +245,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi ewk_security_policy_whitelist_origin_add(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { WebCore::KURL kurl; kurl.setProtocol(String(protocol->characters(), protocol->length())); @@ -254,17 +254,17 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr ewk_security_policy_whitelist_origin_del(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains); } -void LayoutTestController::setMainFrameIsFirstResponder(bool) +void TestRunner::setMainFrameIsFirstResponder(bool) { notImplemented(); } -void LayoutTestController::setTabKeyCyclesThroughElements(bool) +void TestRunner::setTabKeyCyclesThroughElements(bool) { notImplemented(); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool) +void TestRunner::setUseDashboardCompatibilityMode(bool) { notImplemented(); } @@ -272,13 +272,13 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool) static CString gUserStyleSheet; static bool gUserStyleSheetEnabled = true; -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { gUserStyleSheetEnabled = flag; ewk_view_setting_user_stylesheet_set(browser->mainView(), flag ? gUserStyleSheet.data() : 0); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { gUserStyleSheet = path->ustring().utf8(); @@ -286,12 +286,12 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) setUserStyleSheetEnabled(true); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, WTF::String(value->ustring().impl())); } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { Evas_Object* view = browser->mainView(); if (!view) @@ -309,12 +309,12 @@ void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) ewk_view_mode_set(view, EWK_VIEW_MODE_MINIMIZED); } -void LayoutTestController::setWindowIsKey(bool) +void TestRunner::setWindowIsKey(bool) { notImplemented(); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled(browser->mainView(), flag); } @@ -322,11 +322,11 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) static Eina_Bool waitToDumpWatchdogFired(void*) { waitToDumpWatchdog = 0; - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); return ECORE_CALLBACK_CANCEL; } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { static const double timeoutSeconds = 30; @@ -335,116 +335,116 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone) waitToDumpWatchdog = ecore_timer_add(timeoutSeconds, waitToDumpWatchdogFired, 0); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return browser->extraViews().size() + 1; // + 1 for the main view. } -void LayoutTestController::setPrivateBrowsingEnabled(bool flag) +void TestRunner::setPrivateBrowsingEnabled(bool flag) { ewk_view_setting_private_browsing_set(browser->mainView(), flag); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) +void TestRunner::setJavaScriptCanAccessClipboard(bool flag) { ewk_view_setting_scripts_can_access_clipboard_set(browser->mainView(), flag); } -void LayoutTestController::setXSSAuditorEnabled(bool flag) +void TestRunner::setXSSAuditorEnabled(bool flag) { ewk_view_setting_enable_xss_auditor_set(browser->mainView(), flag); } -void LayoutTestController::setFrameFlatteningEnabled(bool flag) +void TestRunner::setFrameFlatteningEnabled(bool flag) { ewk_view_setting_enable_frame_flattening_set(browser->mainView(), flag); } -void LayoutTestController::setSpatialNavigationEnabled(bool flag) +void TestRunner::setSpatialNavigationEnabled(bool flag) { ewk_view_setting_spatial_navigation_set(browser->mainView(), flag); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool) { notImplemented(); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool) +void TestRunner::setAllowFileAccessFromFileURLs(bool) { notImplemented(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(browser->mainView(), flag); } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { DumpRenderTreeSupportEfl::setAutofilled(context, nodeObject, autofilled); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { ewk_view_setting_auto_load_images_set(browser->mainView(), EINA_FALSE); } -void LayoutTestController::setMockDeviceOrientation(bool, double, bool, double, bool, double) +void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, double) { // FIXME: Implement for DeviceOrientation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=30335. notImplemented(); } -void LayoutTestController::setMockGeolocationPosition(double, double, double) +void TestRunner::setMockGeolocationPosition(double, double, double) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. notImplemented(); } -void LayoutTestController::setMockGeolocationError(int, JSStringRef) +void TestRunner::setMockGeolocationError(int, JSStringRef) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. notImplemented(); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { // FIXME: Implement for Geolocation layout tests. setGeolocationPermissionCommon(allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { // FIXME: Implement for Geolocation layout tests. return -1; } -void LayoutTestController::addMockSpeechInputResult(JSStringRef, double, JSStringRef) +void TestRunner::addMockSpeechInputResult(JSStringRef, double, JSStringRef) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. notImplemented(); } -void LayoutTestController::setMockSpeechInputDumpRect(bool) +void TestRunner::setMockSpeechInputDumpRect(bool) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. notImplemented(); } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. notImplemented(); } -void LayoutTestController::setIconDatabaseEnabled(bool enabled) +void TestRunner::setIconDatabaseEnabled(bool enabled) { ewk_settings_icon_database_path_set(0); @@ -467,34 +467,34 @@ void LayoutTestController::setIconDatabaseEnabled(bool enabled) ewk_settings_icon_database_path_set(databasePath.utf8().data()); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(browser->mainView(), flag); } -void LayoutTestController::setPopupBlockingEnabled(bool flag) +void TestRunner::setPopupBlockingEnabled(bool flag) { ewk_view_setting_scripts_can_open_windows_set(browser->mainView(), !flag); } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { ewk_view_setting_enable_plugins_set(browser->mainView(), flag); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { const String elementId(id->ustring().impl()); const Evas_Object* mainFrame = browser->mainFrame(); return DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(mainFrame, elementId); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { DumpRenderTreeSupportEfl::executeCoreCommandByName(browser->mainView(), name->ustring().utf8().data(), value->ustring().utf8().data()); } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length")); JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0); @@ -528,12 +528,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, return DumpRenderTreeSupportEfl::findString(browser->mainView(), WTF::String(target->ustring().impl()), options); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { return DumpRenderTreeSupportEfl::isCommandEnabled(browser->mainView(), name->ustring().utf8().data()); } -void LayoutTestController::setCacheModel(int cacheModel) +void TestRunner::setCacheModel(int cacheModel) { unsigned int cacheTotalCapacity; unsigned int cacheMinDeadCapacity; @@ -574,124 +574,124 @@ void LayoutTestController::setCacheModel(int cacheModel) ewk_settings_page_cache_capacity_set(pageCacheCapacity); } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef) { notImplemented(); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { notImplemented(); } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { ewk_settings_application_cache_clear(); } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame()); ewk_security_origin_application_cache_quota_set(origin, quota); ewk_security_origin_free(origin); } -void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString* url) +void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString* url) { Ewk_Security_Origin* origin = ewk_security_origin_new_from_string(url->ustring().utf8().data()); ewk_security_origin_application_cache_clear(origin); ewk_security_origin_free(origin); } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef) { // FIXME: Implement to support getting disk usage in bytes for an origin. notImplemented(); return 0; } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that contain application caches. notImplemented(); return JSValueMakeUndefined(context); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef) { notImplemented(); return 0; } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { ewk_web_database_remove_all(); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame()); ewk_security_origin_web_database_quota_set(origin, quota); ewk_security_origin_free(origin); } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { notImplemented(); return JSValueMakeUndefined(context); } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { notImplemented(); } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef) { notImplemented(); } -void LayoutTestController::observeStorageTrackerNotifications(unsigned) +void TestRunner::observeStorageTrackerNotifications(unsigned) { notImplemented(); } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { notImplemented(); } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { DumpRenderTreeSupportEfl::setDomainRelaxationForbiddenForURLScheme(forbidden, WTF::String(scheme->ustring().impl())); } -void LayoutTestController::goBack() +void TestRunner::goBack() { ewk_frame_back(browser->mainFrame()); } -void LayoutTestController::setDefersLoading(bool defers) +void TestRunner::setDefersLoading(bool defers) { DumpRenderTreeSupportEfl::setDefersLoading(browser->mainView(), defers); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { ewk_settings_application_cache_max_quota_set(size); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { return DumpRenderTreeSupportEfl::pauseAnimation(browser->mainFrame(), animationName->ustring().utf8().data(), elementId->ustring().utf8().data(), time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { return DumpRenderTreeSupportEfl::pauseTransition(browser->mainFrame(), propertyName->ustring().utf8().data(), elementId->ustring().utf8().data(), time); } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { return DumpRenderTreeSupportEfl::activeAnimationsCount(browser->mainFrame()); } @@ -706,7 +706,7 @@ static inline int toInt(JSStringRef value) return atoi(value->ustring().utf8().data()); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { if (equals(key, "WebKitJavaScriptEnabled")) ewk_view_setting_enable_scripts_set(browser->mainView(), toBool(value)); @@ -735,56 +735,56 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value else if (equals(key, "WebKitWebAudioEnabled")) ewk_view_setting_web_audio_set(browser->mainView(), toBool(value)); else - fprintf(stderr, "LayoutTestController::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data()); + fprintf(stderr, "TestRunner::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data()); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { DumpRenderTreeSupportEfl::addUserScript(browser->mainView(), String(source->ustring().impl()), runAtStart, allFrames); } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), WTF::String(source->ustring().impl()), allFrames); } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { ewk_view_setting_enable_developer_extras_set(browser->mainView(), enabled); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { notImplemented(); } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { ewk_view_web_inspector_show(browser->mainView()); browser->waitInspectorLoadFinished(); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { ewk_view_web_inspector_close(browser->mainView()); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { DumpRenderTreeSupportEfl::evaluateInWebInspector(browser->mainView(), callId, String(script->ustring().impl())); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned, JSObjectRef, JSStringRef) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned, JSObjectRef, JSStringRef) { notImplemented(); } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld(browser->mainFrame(), worldID, globalObject, String(script->ustring().impl())); } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { Ewk_History* history = ewk_view_history_get(browser->mainView()); if (!history) @@ -793,27 +793,27 @@ void LayoutTestController::removeAllVisitedLinks() ewk_history_clear(history); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return DumpRenderTreeSupportEfl::callShouldCloseOnWebView(browser->mainFrame()); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef, JSStringRef) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { notImplemented(); } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { ewk_frame_editable_set(browser->mainFrame(), EINA_TRUE); } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { String markerTextChar = DumpRenderTreeSupportEfl::markerTextForListItem(context, nodeObject); if (markerTextChar.isEmpty()) @@ -823,27 +823,27 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { notImplemented(); } -void LayoutTestController::setSerializeHTTPLoads(bool serialize) +void TestRunner::setSerializeHTTPLoads(bool serialize) { DumpRenderTreeSupportEfl::setSerializeHTTPLoads(serialize); } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { ewk_view_setting_minimum_timer_interval_set(browser->mainView(), minimumTimerInterval); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { Ewk_Text_Direction ewkDirection; if (JSStringIsEqualToUTF8CString(direction, "auto")) @@ -853,43 +853,43 @@ void LayoutTestController::setTextDirection(JSStringRef direction) else if (JSStringIsEqualToUTF8CString(direction, "ltr")) ewkDirection = EWK_TEXT_DIRECTION_LEFT_TO_RIGHT; else { - fprintf(stderr, "LayoutTestController::setTextDirection called with unknown direction: '%s'.\n", direction->ustring().utf8().data()); + fprintf(stderr, "TestRunner::setTextDirection called with unknown direction: '%s'.\n", direction->ustring().utf8().data()); return; } ewk_view_text_direction_set(browser->mainView(), ewkDirection); } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { notImplemented(); } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { notImplemented(); } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { notImplemented(); } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { notImplemented(); } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, true); } -void LayoutTestController::setPageVisibility(const char* visibility) +void TestRunner::setPageVisibility(const char* visibility) { String newVisibility(visibility); if (newVisibility == "visible") @@ -902,12 +902,12 @@ void LayoutTestController::setPageVisibility(const char* visibility) ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_PREVIEW, false); } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { notImplemented(); } -void LayoutTestController::sendWebIntentResponse(JSStringRef response) +void TestRunner::sendWebIntentResponse(JSStringRef response) { Ewk_Intent_Request* request = browser->currentIntentRequest(); if (!request) @@ -916,12 +916,12 @@ void LayoutTestController::sendWebIntentResponse(JSStringRef response) DumpRenderTreeSupportEfl::sendWebIntentResponse(request, response); } -void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) +void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) { DumpRenderTreeSupportEfl::deliverWebIntent(browser->mainFrame(), action, type, data); } -void LayoutTestController::setStorageDatabaseIdleInterval(double) +void TestRunner::setStorageDatabaseIdleInterval(double) { notImplemented(); } diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp index fae866609..75986d82e 100644 --- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -36,9 +36,9 @@ #include "EditingCallbacks.h" #include "EventSender.h" #include "GCController.h" -#include "LayoutTestController.h" #include "PixelDumpSupport.h" #include "SelfScrollingWebKitWebView.h" +#include "TestRunner.h" #include "TextInputController.h" #include "WebCoreSupport/DumpRenderTreeSupportGtk.h" #include "WebCoreTestSupport.h" @@ -78,7 +78,7 @@ static int dumpTree = 1; static int useTimeoutWatchdog = 1; AccessibilityController* axController = 0; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; static GCController* gcController = 0; static WebKitWebView* webView; static GtkWidget* window; @@ -140,7 +140,7 @@ void dumpFrameScrollPosition(WebKitWebFrame* frame) printf("scrolled to %ld,%ld\n", x, y); } - if (gLayoutTestController->dumpChildFrameScrollPositions()) { + if (gTestRunner->dumpChildFrameScrollPositions()) { GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame); for (GSList* child = children; child; child = g_slist_next(child)) dumpFrameScrollPosition(static_cast<WebKitWebFrame*>(child->data)); @@ -292,7 +292,7 @@ static gchar* dumpFramesAsText(WebKitWebFrame* frame) result = g_strdup_printf("\n--------\nFrame: '%s'\n--------\n%s\n", frameName, innerText.data()); } - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame); for (GSList* child = children; child; child = g_slist_next(child)) { GOwnPtr<gchar> childData(dumpFramesAsText(static_cast<WebKitWebFrame*>(child->data))); @@ -574,12 +574,12 @@ void dump() gchar* responseMimeType = webkit_web_frame_get_response_mime_type(mainFrame); if (g_str_equal(responseMimeType, "text/plain")) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } g_free(responseMimeType); - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) result = dumpFramesAsText(mainFrame); else { // Widget resizing is done asynchronously in GTK+. We pump the main @@ -596,11 +596,11 @@ void dump() if (!result) { const char* errorMessage; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) errorMessage = "[documentElement innerText]"; - else if (gLayoutTestController->dumpDOMAsWebArchive()) + else if (gTestRunner->dumpDOMAsWebArchive()) errorMessage = "[[mainFrame DOMDocument] webArchive]"; - else if (gLayoutTestController->dumpSourceAsWebArchive()) + else if (gTestRunner->dumpSourceAsWebArchive()) errorMessage = "[[mainFrame dataSource] webArchive]"; else errorMessage = "[mainFrame renderTreeAsExternalRepresentation]"; @@ -608,10 +608,10 @@ void dump() } else { printf("%s", result); g_free(result); - if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) + if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive()) dumpFrameScrollPosition(mainFrame); - if (gLayoutTestController->dumpBackForwardList()) + if (gTestRunner->dumpBackForwardList()) dumpBackForwardListForAllWebViews(); } @@ -624,11 +624,11 @@ void dump() } if (dumpPixelsForCurrentTest - && gLayoutTestController->generatePixelResults() - && !gLayoutTestController->dumpDOMAsWebArchive() - && !gLayoutTestController->dumpSourceAsWebArchive()) { + && gTestRunner->generatePixelResults() + && !gTestRunner->dumpDOMAsWebArchive() + && !gTestRunner->dumpSourceAsWebArchive()) { DumpRenderTreeSupportGtk::forceWebViewPaint(webView); - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); } // FIXME: call displayWebView here when we support --paint @@ -706,22 +706,22 @@ static void runTest(const string& inputLine) resetDefaultsToConsistentValues(); - gLayoutTestController = LayoutTestController::create(testURL, command.expectedPixelHash); + gTestRunner = TestRunner::create(testURL, command.expectedPixelHash); topLoadingFrame = 0; done = false; - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (shouldLogFrameLoadDelegates(testURL)) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); if (shouldEnableDeveloperExtras(testURL)) { - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(testURL)) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); if (shouldDumpAsText(testURL)) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } @@ -731,8 +731,8 @@ static void runTest(const string& inputLine) bool isSVGW3CTest = (testURL.find("svg/W3C-SVG-1.1") != string::npos); GtkAllocation size; size.x = size.y = 0; - size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth; - size.height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight; + size.width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth; + size.height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight; gtk_window_resize(GTK_WINDOW(window), size.width, size.height); gtk_widget_size_allocate(container, &size); @@ -753,12 +753,12 @@ static void runTest(const string& inputLine) // If developer extras enabled Web Inspector may have been open by the test. if (shouldEnableDeveloperExtras(testURL)) { - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); } // Also check if we still have opened webViews and free them. - if (gLayoutTestController->closeRemainingWindowsWhenComplete() || webViewList) { + if (gTestRunner->closeRemainingWindowsWhenComplete() || webViewList) { while (webViewList) { g_object_unref(WEBKIT_WEB_VIEW(webViewList->data)); webViewList = g_slist_next(webViewList); @@ -772,7 +772,7 @@ static void runTest(const string& inputLine) // A blank load seems to be necessary to reset state after certain tests. webkit_web_view_open(webView, "about:blank"); - gLayoutTestController.clear(); + gTestRunner.clear(); // terminate the (possibly empty) pixels block after all the state reset sendPixelResultsEOF(); @@ -789,7 +789,7 @@ void webViewLoadStarted(WebKitWebView* view, WebKitWebFrame* frame, void*) static gboolean processWork(void* data) { // if we finish all the commands, we're ready to dump state - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); return FALSE; @@ -827,7 +827,7 @@ static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void // so we can use it here in the DRT to provide the correct dump. if (frame != topLoadingFrame) return; - if (gLayoutTestController->dumpProgressFinishedCallback()) + if (gTestRunner->dumpProgressFinishedCallback()) printf("postProgressFinishedNotification\n"); } @@ -838,7 +838,7 @@ static gboolean webViewLoadError(WebKitWebView*, WebKitWebFrame*, gchar*, gpoint static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { char* frameName = getFrameNameSuitableForTestResult(view, frame); printf("%s - didFinishDocumentLoadForFrame\n", frameName); g_free(frameName); @@ -854,7 +854,7 @@ static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* fra static void webViewOnloadEvent(WebKitWebView* view, WebKitWebFrame* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { char* frameName = getFrameNameSuitableForTestResult(view, frame); printf("%s - didHandleOnloadEventsForFrame\n", frameName); g_free(frameName); @@ -871,9 +871,9 @@ static void addControllerToWindow(JSContextRef context, JSObjectRef windowObject static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef windowObject, gpointer data) { JSValueRef exception = 0; - ASSERT(gLayoutTestController); + ASSERT(gTestRunner); - gLayoutTestController->makeWindowObject(context, windowObject, &exception); + gTestRunner->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); gcController->makeWindowObject(context, windowObject, &exception); @@ -940,7 +940,7 @@ static gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame, static void webViewTitleChanged(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, gpointer data) { - if (gLayoutTestController->dumpTitleChanges() && !done) + if (gTestRunner->dumpTitleChanges() && !done) printf("TITLE CHANGED: %s\n", title ? title : ""); } @@ -950,7 +950,7 @@ static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKit WebKitWebPolicyDecision* policyDecision) { // Use the default handler if we're not waiting for policy, - // i.e., LayoutTestController::waitForPolicyDelegate + // i.e., TestRunner::waitForPolicyDelegate if (!waitForPolicy) return FALSE; @@ -985,7 +985,7 @@ static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKit g_free(typeDescription); webkit_web_policy_decision_ignore(policyDecision); - gLayoutTestController->notifyDone(); + gTestRunner->notifyDone(); return TRUE; } @@ -994,7 +994,7 @@ static void webViewStatusBarTextChanged(WebKitWebView* view, const gchar* messag { // Are we doing anything wrong? One test that does not call // dumpStatusCallbacks gets true here - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", message); } @@ -1015,7 +1015,7 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We ASSERT(database); WebKitSecurityOrigin* origin = webkit_web_database_get_security_origin(database); - if (gLayoutTestController->dumpDatabaseCallbacks()) { + if (gTestRunner->dumpDatabaseCallbacks()) { printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", webkit_security_origin_get_protocol(origin), webkit_security_origin_get_host(origin), @@ -1028,9 +1028,9 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We static bool geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision) { - if (!gLayoutTestController->isGeolocationPermissionSet()) + if (!gTestRunner->isGeolocationPermissionSet()) return FALSE; - if (gLayoutTestController->geolocationPermission()) + if (gTestRunner->geolocationPermission()) webkit_geolocation_policy_allow(decision); else webkit_geolocation_policy_deny(decision); @@ -1070,7 +1070,7 @@ static void topLoadingFrameLoadFinished() { topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test - if (gLayoutTestController->waitToDump()) + if (gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -1083,7 +1083,7 @@ static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data { WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame); - if (gLayoutTestController->dumpFrameLoadCallbacks()) { + if (gTestRunner->dumpFrameLoadCallbacks()) { GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame)); switch (loadStatus) { @@ -1126,7 +1126,8 @@ static CString pathFromSoupURI(SoupURI* uri) return CString(uriString.get()); } - GOwnPtr<gchar> pathDirname(g_path_get_basename(g_path_get_dirname(uri->path))); + GOwnPtr<gchar> parentPath(g_path_get_dirname(uri->path)); + GOwnPtr<gchar> pathDirname(g_path_get_basename(parentPath.get())); GOwnPtr<gchar> pathBasename(g_path_get_basename(uri->path)); GOwnPtr<gchar> urlPath(g_strdup_printf("%s/%s", pathDirname.get(), pathBasename.get())); return CString(urlPath.get()); @@ -1249,13 +1250,13 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF { - if (!done && gLayoutTestController->willSendRequestReturnsNull()) { - // As requested by the LayoutTestController, don't perform the request. + if (!done && gTestRunner->willSendRequestReturnsNull()) { + // As requested by the TestRunner, don't perform the request. webkit_network_request_set_uri(request, "about:blank"); return; } - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - willSendRequest %s redirectResponse %s\n", convertNetworkRequestToURLPath(request).data(), descriptionSuitableForTestResult(request).data(), @@ -1279,7 +1280,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF soup_uri_free(uri); if (soupMessage) { - const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders(); + const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders(); for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) soup_message_headers_remove(soupMessage->request_headers, header->c_str()); } @@ -1288,7 +1289,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF static void didReceiveResponse(WebKitWebView* webView, WebKitWebFrame*, WebKitWebResource* webResource, WebKitNetworkResponse* response) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { CString responseDescription(descriptionSuitableForTestResult(response)); CString path(convertWebResourceToURLPath(webResource)); printf("%s - didReceiveResponse %s\n", path.data(), responseDescription.data()); @@ -1300,13 +1301,13 @@ static void didReceiveResponse(WebKitWebView* webView, WebKitWebFrame*, WebKitWe static void didFinishLoading(WebKitWebView* webView, WebKitWebFrame* webFrame, WebKitWebResource* webResource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - didFinishLoading\n", descriptionSuitableForTestResult(webView, webFrame, webResource).data()); } static void didFailLoadingWithError(WebKitWebView* webView, WebKitWebFrame* webFrame, WebKitWebResource* webResource, GError* webError) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { CString webErrorString(descriptionSuitableForTestResult(webError, webResource)); printf("%s - didFailLoadingWithError: %s\n", descriptionSuitableForTestResult(webView, webFrame, webResource).data(), webErrorString.data()); @@ -1315,7 +1316,7 @@ static void didFailLoadingWithError(WebKitWebView* webView, WebKitWebFrame* webF static void didRunInsecureContent(WebKitWebFrame*, WebKitSecurityOrigin*, const char* url) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didRunInsecureContent\n"); } @@ -1386,11 +1387,11 @@ static WebKitWebView* createWebView() static WebKitWebView* webViewCreate(WebKitWebView* view, WebKitWebFrame* frame) { - if (!gLayoutTestController->canOpenWindows()) + if (!gTestRunner->canOpenWindows()) return 0; // Make sure that waitUntilDone has been called. - ASSERT(gLayoutTestController->waitToDump()); + ASSERT(gTestRunner->waitToDump()); WebKitWebView* newWebView = createWebView(); g_object_ref_sink(G_OBJECT(newWebView)); diff --git a/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp b/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp index c5fa009fb..4c968d9f4 100644 --- a/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp +++ b/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp @@ -30,7 +30,7 @@ #include "EditingCallbacks.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <gtk/gtk.h> #include <webkit/webkit.h> #include <wtf/gobject/GOwnPtr.h> @@ -99,21 +99,21 @@ static const char* selectionAffinityString(WebKitSelectionAffinity affinity) gboolean shouldBeginEditing(WebKitWebView* webView, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).data()); return TRUE; } gboolean shouldEndEditing(WebKitWebView* webView, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).data()); return TRUE; } gboolean shouldInsertNode(WebKitWebView* webView, WebKitDOMNode* node, WebKitDOMRange* range, WebKitInsertAction action) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", dumpNodePath(node).data(), dumpRange(range).data(), insertActionString(action)); } @@ -122,7 +122,7 @@ gboolean shouldInsertNode(WebKitWebView* webView, WebKitDOMNode* node, WebKitDOM gboolean shouldInsertText(WebKitWebView* webView, const gchar* text, WebKitDOMRange* range, WebKitInsertAction action) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", text, dumpRange(range).data(), insertActionString(action)); } @@ -131,7 +131,7 @@ gboolean shouldInsertText(WebKitWebView* webView, const gchar* text, WebKitDOMRa gboolean shouldDeleteRange(WebKitWebView* webView, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).data()); return TRUE; } @@ -144,7 +144,7 @@ gboolean shouldShowDeleteInterfaceForElement(WebKitWebView* webView, WebKitDOMHT gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromRange, WebKitDOMRange* toRange, WebKitSelectionAffinity affinity, gboolean stillSelecting) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", dumpRange(fromRange).data(), dumpRange(toRange).data(), selectionAffinityString(affinity), stillSelecting ? "TRUE" : "FALSE"); @@ -154,7 +154,7 @@ gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromR gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration* style, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { GOwnPtr<gchar> styleText(webkit_dom_css_style_declaration_get_css_text(style)); printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", styleText.get(), dumpRange(range).data()); @@ -164,25 +164,25 @@ gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration* void editingBegan(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n"); } void userChangedContents(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); } void editingEnded(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n"); } void selectionChanged(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); } diff --git a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp index fffd92422..41575d72f 100644 --- a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp @@ -32,7 +32,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "DumpRenderTree.h" #include "WebCoreSupport/DumpRenderTreeSupportGtk.h" @@ -53,17 +53,17 @@ extern "C" { void webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script); } -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { // FIXME: implement } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { // FIXME: implement } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView); @@ -80,63 +80,63 @@ void LayoutTestController::clearBackForwardList() g_object_unref(item); } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { // FIXME: implement return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { // FIXME: implement return 0; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { // FIXME: implement } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(context, value); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { // FIXME: implement JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString("")); return string; } -int LayoutTestController::numberOfPages(float pageWidth, float pageHeight) +int TestRunner::numberOfPages(float pageWidth, float pageHeight) { return DumpRenderTreeSupportGtk::numberOfPagesForFrame(mainFrame, pageWidth, pageHeight); } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageProperty(mainFrame, propertyName, pageNumber).data())); return propertyValue; } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(mainFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).data())); return propertyValue; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView); @@ -150,18 +150,18 @@ size_t LayoutTestController::webHistoryItemCount() webkit_web_back_forward_list_get_forward_length(list); } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { return DumpRenderTreeSupportGtk::workerThreadCount(); } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() const +JSRetainPtr<JSStringRef> TestRunner::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk")); return platformName; } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) dump(); @@ -169,7 +169,7 @@ void LayoutTestController::notifyDone() waitForPolicy = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) { GOwnPtr<char> urlCString(JSStringCopyUTF8CString(url)); if (!g_str_has_prefix(urlCString.get(), "file:///tmp/LayoutTests/")) @@ -181,7 +181,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt return JSStringCreateWithUTF8CString(testURI.get()); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { gchar* relativeURL = JSStringCopyUTF8CString(url); SoupURI* baseURI = soup_uri_new(webkit_web_frame_get_uri(mainFrame)); @@ -203,13 +203,13 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); webkit_web_view_set_editable(webView, acceptsEditing); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { SoupSession* session = webkit_get_default_session(); SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR)); @@ -233,23 +233,23 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, policy, NULL); } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { // FIXME: implement } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { waitForPolicy = true; setWaitToDump(true); } -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) { // FIXME: implement } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { gchar* sourceOriginGChar = JSStringCopyUTF8CString(sourceOrigin); gchar* protocolGChar = JSStringCopyUTF8CString(protocol); @@ -260,7 +260,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi g_free(hostGChar); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { GOwnPtr<gchar> sourceOriginGChar(JSStringCopyUTF8CString(sourceOrigin)); GOwnPtr<gchar> protocolGChar(JSStringCopyUTF8CString(protocol)); @@ -268,19 +268,19 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr DumpRenderTreeSupportGtk::removeWhiteListAccessFromOrigin(sourceOriginGChar.get(), protocolGChar.get(), hostGChar.get(), includeSubdomains); } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { // FIXME: implement } -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebSettings* settings = webkit_web_view_get_settings(webView); g_object_set(G_OBJECT(settings), "tab-key-cycles-through-elements", cycles, NULL); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { // FIXME: implement } @@ -288,7 +288,7 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) static gchar* userStyleSheet = NULL; static gboolean userStyleSheetEnabled = TRUE; -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { userStyleSheetEnabled = flag; @@ -300,7 +300,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool flag) g_object_set(G_OBJECT(settings), "user-stylesheet-uri", "", NULL); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { g_free(userStyleSheet); userStyleSheet = JSStringCopyUTF8CString(path); @@ -308,12 +308,12 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) setUserStyleSheetEnabled(true); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { DumpRenderTreeSupportGtk::setValueForUser(context, nodeObject, value); } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -334,12 +334,12 @@ void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) g_free(viewMode); } -void LayoutTestController::setWindowIsKey(bool windowIsKey) +void TestRunner::setWindowIsKey(bool windowIsKey) { // FIXME: implement } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(webkit_web_frame_get_web_view(mainFrame), flag); } @@ -347,11 +347,11 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) static gboolean waitToDumpWatchdogFired(void*) { setWaitToDumpWatchdog(0); - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); return FALSE; } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { static const int timeoutSeconds = 30; @@ -360,13 +360,13 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone) setWaitToDumpWatchdog(g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0)); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { // +1 -> including the main view return g_slist_length(webViewList) + 1; } -void LayoutTestController::setPrivateBrowsingEnabled(bool flag) +void TestRunner::setPrivateBrowsingEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -375,7 +375,7 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-private-browsing", flag, NULL); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) +void TestRunner::setJavaScriptCanAccessClipboard(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -384,7 +384,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) g_object_set(G_OBJECT(settings), "javascript-can-access-clipboard", flag, NULL); } -void LayoutTestController::setXSSAuditorEnabled(bool flag) +void TestRunner::setXSSAuditorEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -393,7 +393,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-xss-auditor", flag, NULL); } -void LayoutTestController::setFrameFlatteningEnabled(bool flag) +void TestRunner::setFrameFlatteningEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -402,7 +402,7 @@ void LayoutTestController::setFrameFlatteningEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-frame-flattening", flag, NULL); } -void LayoutTestController::setSpatialNavigationEnabled(bool flag) +void TestRunner::setSpatialNavigationEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -411,7 +411,7 @@ void LayoutTestController::setSpatialNavigationEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-spatial-navigation", flag, NULL); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -420,7 +420,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag) g_object_set(G_OBJECT(settings), "enable-universal-access-from-file-uris", flag, NULL); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag) +void TestRunner::setAllowFileAccessFromFileURLs(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -429,17 +429,17 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag) g_object_set(G_OBJECT(settings), "enable-file-access-from-file-uris", flag, NULL); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { // FIXME: implement } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled) { DumpRenderTreeSupportGtk::setAutofilled(context, nodeObject, isAutofilled); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -448,13 +448,13 @@ void LayoutTestController::disableImageLoading() g_object_set(G_OBJECT(settings), "auto-load-images", FALSE, NULL); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { // FIXME: Implement for DeviceOrientation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=30335. } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); if (!view) @@ -464,7 +464,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo DumpRenderTreeSupportGtk::setMockGeolocationPosition(view, latitude, longitude, accuracy); } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); if (!view) @@ -475,7 +475,7 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message DumpRenderTreeSupportGtk::setMockGeolocationError(view, code, cMessage.get()); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); @@ -486,7 +486,7 @@ void LayoutTestController::setGeolocationPermission(bool allow) DumpRenderTreeSupportGtk::setMockGeolocationPermission(view, allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); if (!view) @@ -496,25 +496,25 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests() return DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests(view); } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setIconDatabaseEnabled(bool enabled) +void TestRunner::setIconDatabaseEnabled(bool enabled) { WebKitIconDatabase* database = webkit_get_icon_database(); if (enabled) { @@ -524,12 +524,12 @@ void LayoutTestController::setIconDatabaseEnabled(bool enabled) webkit_icon_database_set_path(database, 0); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { DumpRenderTreeSupportGtk::setSelectTrailingWhitespaceEnabled(flag); } -void LayoutTestController::setPopupBlockingEnabled(bool flag) +void TestRunner::setPopupBlockingEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -539,7 +539,7 @@ void LayoutTestController::setPopupBlockingEnabled(bool flag) } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -548,12 +548,12 @@ void LayoutTestController::setPluginsEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-plugins", flag, NULL); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { return DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(mainFrame, id); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -565,7 +565,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) g_free(cValue); } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebKitFindOptions findOptions = 0; WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); @@ -603,7 +603,7 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, return DumpRenderTreeSupportGtk::findString(webView, targetString.get(), findOptions); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -614,7 +614,7 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name) return result; } -void LayoutTestController::setCacheModel(int cacheModel) +void TestRunner::setCacheModel(int cacheModel) { // These constants are derived from the Mac cache model enum in Source/WebKit/mac/WebView/WebPreferences.h. switch (cacheModel) { @@ -632,110 +632,110 @@ void LayoutTestController::setCacheModel(int cacheModel) } } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) { // FIXME: implement } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { // FIXME: implement } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { // FIXME: Implement to support application cache quotas. } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { // FIXME: Implement to support application cache quotas. } -void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*) +void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString*) { // FIXME: Implement to support deleting all application caches for an origin. } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) { // FIXME: Implement to support getting disk usage in bytes for an origin. return 0; } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that contain application caches. return JSValueMakeUndefined(context); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name) { // FIXME: implement return 0; } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { webkit_remove_all_web_databases(); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { WebKitSecurityOrigin* origin = webkit_web_frame_get_security_origin(mainFrame); webkit_security_origin_set_web_database_quota(origin, quota); } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { // FIXME: implement return JSValueMakeUndefined(context); } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { // FIXME: implement } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef originIdentifier) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef originIdentifier) { // FIXME: implement } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { // FIXME: implement } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { // FIXME: implement } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { GOwnPtr<gchar> urlScheme(JSStringCopyUTF8CString(scheme)); DumpRenderTreeSupportGtk::setDomainRelaxationForbiddenForURLScheme(forbidden, urlScheme.get()); } -void LayoutTestController::goBack() +void TestRunner::goBack() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); webkit_web_view_go_back(webView); } -void LayoutTestController::setDefersLoading(bool defers) +void TestRunner::setDefersLoading(bool defers) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); DumpRenderTreeSupportGtk::setDefersLoading(webView, defers); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { webkit_application_cache_set_maximum_size(size); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { gchar* name = JSStringCopyUTF8CString(animationName); gchar* element = JSStringCopyUTF8CString(elementId); @@ -745,7 +745,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return returnValue; } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { gchar* name = JSStringCopyUTF8CString(propertyName); gchar* element = JSStringCopyUTF8CString(elementId); @@ -755,7 +755,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return returnValue; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { return DumpRenderTreeSupportGtk::numberOfActiveAnimations(mainFrame); } @@ -765,7 +765,7 @@ static gboolean booleanFromValue(gchar* value) return !g_ascii_strcasecmp(value, "true") || !g_ascii_strcasecmp(value, "1"); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key)); GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value)); @@ -806,7 +806,7 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); return; } else { - fprintf(stderr, "LayoutTestController::overridePreference tried to override " + fprintf(stderr, "TestRunner::overridePreference tried to override " "unknown preference '%s'.\n", originalName.get()); return; } @@ -827,16 +827,16 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value gfloat newValue = g_ascii_strtod(valueAsString.get(), 0); g_object_set(G_OBJECT(settings), propertyName, newValue, NULL); } else - fprintf(stderr, "LayoutTestController::overridePreference failed to override " + fprintf(stderr, "TestRunner::overridePreference failed to override " "preference '%s'.\n", originalName.get()); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { - printf("LayoutTestController::addUserScript not implemented.\n"); + printf("TestRunner::addUserScript not implemented.\n"); } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source)); DumpRenderTreeSupportGtk::addUserStyleSheet(mainFrame, sourceCode.get(), allFrames); @@ -844,7 +844,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView); @@ -852,12 +852,12 @@ void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) g_object_set(webSettings, "enable-developer-extras", enabled, NULL); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); @@ -865,7 +865,7 @@ void LayoutTestController::showWebInspector() webkit_web_inspector_show(inspector); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); @@ -873,7 +873,7 @@ void LayoutTestController::closeWebInspector() webkit_web_inspector_close(inspector); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); @@ -883,41 +883,41 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip g_free(scriptString); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { // FIXME: Implement this. } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return DumpRenderTreeSupportGtk::shouldClose(mainFrame); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { CString markerTextGChar = DumpRenderTreeSupportGtk::markerTextForListItem(mainFrame, context, nodeObject); if (markerTextGChar.isNull()) @@ -927,76 +927,76 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { } -void LayoutTestController::setSerializeHTTPLoads(bool serialize) +void TestRunner::setSerializeHTTPLoads(bool serialize) { DumpRenderTreeSupportGtk::setSerializeHTTPLoads(serialize); } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); DumpRenderTreeSupportGtk::setMinimumTimerInterval(webView, minimumTimerInterval); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { // FIXME: Implement. } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement this. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement this. } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::setStorageDatabaseIdleInterval(double) +void TestRunner::setStorageDatabaseIdleInterval(double) { // FIXME: Implement this. } diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm index cbd893f85..2bd54bb70 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm @@ -40,7 +40,7 @@ #import "FrameLoadDelegate.h" #import "HistoryDelegate.h" #import "JavaScriptThreading.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import "MockGeolocationProvider.h" #import "NavigationController.h" #import "ObjCPlugin.h" @@ -118,7 +118,7 @@ static void runTest(const string& testPathOrURL); volatile bool done; NavigationController* gNavigationController = 0; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; WebFrame *mainFrame = 0; // This is the topmost frame that is loading, during a given load, or nil when no load is @@ -510,7 +510,7 @@ static void registerMockScrollbars() WebView *createWebViewAndOffscreenWindow() { - NSRect rect = NSMakeRect(0, 0, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight); + NSRect rect = NSMakeRect(0, 0, TestRunner::maxViewWidth, TestRunner::maxViewHeight); WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"]; [webView setUIDelegate:uiDelegate]; @@ -673,7 +673,7 @@ static void resetDefaultsToConsistentValues() [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain]; - LayoutTestController::setSerializeHTTPLoads(false); + TestRunner::setSerializeHTTPLoads(false); setlocale(LC_ALL, ""); } @@ -899,7 +899,7 @@ void dumpRenderTree(int argc, const char *argv[]) [DumpRenderTreePasteboard releaseLocalPasteboards]; - // FIXME: This should be moved onto LayoutTestController and made into a HashSet + // FIXME: This should be moved onto TestRunner and made into a HashSet if (disallowedURLs) { CFRelease(disallowedURLs); disallowedURLs = 0; @@ -924,9 +924,9 @@ static NSInteger compareHistoryItems(id item1, id item2, void *context) static NSData *dumpAudio() { - const char *encodedAudioData = gLayoutTestController->encodedAudioData().c_str(); + const char *encodedAudioData = gTestRunner->encodedAudioData().c_str(); - NSData *data = [NSData dataWithBytes:encodedAudioData length:gLayoutTestController->encodedAudioData().length()]; + NSData *data = [NSData dataWithBytes:encodedAudioData length:gTestRunner->encodedAudioData().length()]; return data; } @@ -974,7 +974,7 @@ static void dumpFrameScrollPosition(WebFrame *f) printf("scrolled to %.f,%.f\n", scrollPosition.x, scrollPosition.y); } - if (gLayoutTestController->dumpChildFrameScrollPositions()) { + if (gTestRunner->dumpChildFrameScrollPositions()) { NSArray *kids = [f childFrames]; if (kids) for (unsigned i = 0; i < [kids count]; i++) @@ -998,7 +998,7 @@ static NSString *dumpFramesAsText(WebFrame *frame) [result appendFormat:@"%@\n", [documentElement innerText]]; - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { NSArray *kids = [frame childFrames]; if (kids) { for (unsigned i = 0; i < [kids count]; i++) @@ -1078,21 +1078,21 @@ static void dumpBackForwardListForWebView(WebView *view) static void sizeWebViewForCurrentTest() { // W3C SVG tests expect to be 480x360 - bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); + bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); if (isSVGW3CTest) [[mainFrame webView] setFrameSize:NSMakeSize(480, 360)]; else - [[mainFrame webView] setFrameSize:NSMakeSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)]; + [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight)]; } static const char *methodNameStringForFailedTest() { const char *errorMessage; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) errorMessage = "[documentElement innerText]"; - else if (gLayoutTestController->dumpDOMAsWebArchive()) + else if (gTestRunner->dumpDOMAsWebArchive()) errorMessage = "[[mainFrame DOMDocument] webArchive]"; - else if (gLayoutTestController->dumpSourceAsWebArchive()) + else if (gTestRunner->dumpSourceAsWebArchive()) errorMessage = "[[mainFrame dataSource] webArchive]"; else errorMessage = "[mainFrame renderTreeAsExternalRepresentation]"; @@ -1143,43 +1143,43 @@ void dump() NSString *resultMimeType = @"text/plain"; if ([[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"]) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } - if (gLayoutTestController->dumpAsAudio()) { + if (gTestRunner->dumpAsAudio()) { resultData = dumpAudio(); resultMimeType = @"audio/wav"; - } else if (gLayoutTestController->dumpAsText()) { + } else if (gTestRunner->dumpAsText()) { resultString = dumpFramesAsText(mainFrame); - } else if (gLayoutTestController->dumpAsPDF()) { + } else if (gTestRunner->dumpAsPDF()) { resultData = dumpFrameAsPDF(mainFrame); resultMimeType = @"application/pdf"; - } else if (gLayoutTestController->dumpDOMAsWebArchive()) { + } else if (gTestRunner->dumpDOMAsWebArchive()) { WebArchive *webArchive = [[mainFrame DOMDocument] webArchive]; resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data])); resultMimeType = @"application/x-webarchive"; - } else if (gLayoutTestController->dumpSourceAsWebArchive()) { + } else if (gTestRunner->dumpSourceAsWebArchive()) { WebArchive *webArchive = [[mainFrame dataSource] webArchive]; resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data])); resultMimeType = @"application/x-webarchive"; } else - resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gLayoutTestController->isPrinting()]; + resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gTestRunner->isPrinting()]; if (resultString && !resultData) resultData = [resultString dataUsingEncoding:NSUTF8StringEncoding]; printf("Content-Type: %s\n", [resultMimeType UTF8String]); - if (gLayoutTestController->dumpAsAudio()) + if (gTestRunner->dumpAsAudio()) printf("Content-Transfer-Encoding: base64\n"); if (resultData) { fwrite([resultData bytes], 1, [resultData length], stdout); - if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) + if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive()) dumpFrameScrollPosition(mainFrame); - if (gLayoutTestController->dumpBackForwardList()) + if (gTestRunner->dumpBackForwardList()) dumpBackForwardListForAllWindows(); } else printf("ERROR: nil result from %s", methodNameStringForFailedTest()); @@ -1195,9 +1195,9 @@ void dump() } } - if (dumpPixelsForCurrentTest && gLayoutTestController->generatePixelResults()) + if (dumpPixelsForCurrentTest && gTestRunner->generatePixelResults()) // FIXME: when isPrinting is set, dump the image with page separators. - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); puts("#EOF"); // terminate the (possibly empty) pixels block @@ -1256,10 +1256,10 @@ static void resetWebViewToConsistentStateBeforeTesting() resetDefaultsToConsistentValues(); - if (gLayoutTestController) { + if (gTestRunner) { WebCoreTestSupport::resetInternalsObject([mainFrame globalContext]); // in the case that a test using the chrome input field failed, be sure to clean up for the next test - gLayoutTestController->removeChromeInputField(); + gTestRunner->removeChromeInputField(); } [[mainFrame webView] setSmartInsertDeleteEnabled:YES]; @@ -1304,19 +1304,19 @@ static void runTest(const string& inputLine) resetWebViewToConsistentStateBeforeTesting(); - gLayoutTestController = LayoutTestController::create(testURL, command.expectedPixelHash); + gTestRunner = TestRunner::create(testURL, command.expectedPixelHash); topLoadingFrame = nil; ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop! releaseAndZero(&draggingInfo); done = NO; sizeWebViewForCurrentTest(); - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (disallowedURLs) CFSetRemoveAllValues(disallowedURLs); if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); if (shouldLogHistoryDelegates(pathOrURL.c_str())) [[mainFrame webView] setHistoryDelegate:historyDelegate]; @@ -1324,12 +1324,12 @@ static void runTest(const string& inputLine) [[mainFrame webView] setHistoryDelegate:nil]; if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(pathOrURL.c_str())) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); if (shouldDumpAsText(pathOrURL.c_str())) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } @@ -1364,7 +1364,7 @@ static void runTest(const string& inputLine) WorkQueue::shared()->clear(); - if (gLayoutTestController->closeRemainingWindowsWhenComplete()) { + if (gTestRunner->closeRemainingWindowsWhenComplete()) { NSArray* array = [DumpRenderTreeWindow openWindows]; unsigned count = [array count]; @@ -1384,8 +1384,8 @@ static void runTest(const string& inputLine) // If developer extras enabled Web Inspector may have been open by the test. if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); } resetWebViewToConsistentStateBeforeTesting(); @@ -1399,7 +1399,7 @@ static void runTest(const string& inputLine) ASSERT(CFArrayGetCount(openWindowsRef) == 1); ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]); - gLayoutTestController.clear(); + gTestRunner.clear(); if (ignoreWebCoreNodeLeaks) [WebCoreStatistics stopIgnoringWebCoreNodeLeaks]; diff --git a/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm index e0cdc6b6e..17a114ba0 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm @@ -34,7 +34,7 @@ #import "DumpRenderTree.h" // FIXME: This file is ObjC++ only because of this include. :( -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebViewPrivate.h> #import <WebKit/WebTypesInternal.h> @@ -79,7 +79,12 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { - (BOOL)isKeyWindow { - return gLayoutTestController ? gLayoutTestController->windowIsKey() : YES; + return gTestRunner ? gTestRunner->windowIsKey() : YES; +} + +- (BOOL)_hasKeyAppearance +{ + return [self isKeyWindow]; } - (void)keyDown:(NSEvent *)event diff --git a/Tools/DumpRenderTree/mac/EditingDelegate.mm b/Tools/DumpRenderTree/mac/EditingDelegate.mm index b1e48c5fa..d6227a72c 100644 --- a/Tools/DumpRenderTree/mac/EditingDelegate.mm +++ b/Tools/DumpRenderTree/mac/EditingDelegate.mm @@ -30,7 +30,7 @@ #import "EditingDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebKit.h> @interface DOMNode (dumpPath) @@ -74,14 +74,14 @@ - (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldEndEditingInDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } @@ -94,7 +94,7 @@ "WebViewInsertActionDropped", }; - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", [[node dumpPath] UTF8String], [[range dump] UTF8String], insertactionstring[action]); return acceptsEditing; } @@ -107,14 +107,14 @@ "WebViewInsertActionDropped", }; - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", [[text description] UTF8String], [[range dump] UTF8String], insertactionstring[action]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } @@ -135,52 +135,52 @@ "TRUE" }; - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", [[currentRange dump] UTF8String], [[proposedRange dump] UTF8String], affinitystring[selectionAffinity], boolstring[flag]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", [[style description] UTF8String], [[range dump] UTF8String]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n", [[currentStyle description] UTF8String], [[proposedStyle description] UTF8String]); return acceptsEditing; } - (void)webViewDidBeginEditing:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChange:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:%s\n", [[notification name] UTF8String]); } - (void)webViewDidEndEditing:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChangeTypingStyle:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChangeSelection:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", [[notification name] UTF8String]); } diff --git a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm index 69c246197..88cc7c920 100644 --- a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm +++ b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm @@ -35,7 +35,7 @@ #import "EventSendingController.h" #import "Foundation/NSNotification.h" #import "GCController.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import "NavigationController.h" #import "ObjCController.h" #import "ObjCPlugin.h" @@ -131,7 +131,7 @@ return; // if we finish all the commands, we're ready to dump state - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); } @@ -145,7 +145,7 @@ if ([dataSource webFrame] == topLoadingFrame) { topLoadingFrame = nil; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test - if (!gLayoutTestController->waitToDump()) { + if (!gTestRunner->waitToDump()) { if (WorkQueue::shared()->count()) [self performSelector:@selector(processWork:) withObject:nil afterDelay:0]; else @@ -156,12 +156,12 @@ - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } - if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - in didStartProvisionalLoadForFrame", [frame _drt_printFrameUserGestureStatus]]; printf ("%s\n", [string UTF8String]); } @@ -172,13 +172,13 @@ if (!topLoadingFrame && !done) topLoadingFrame = frame; - if (!done && gLayoutTestController->stopProvisionalFrameLoads()) { + if (!done && gTestRunner->stopProvisionalFrameLoads()) { NSString *string = [NSString stringWithFormat:@"%@ - stopping load in didStartProvisionalLoadForFrame callback", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); [frame stopLoading]; } - if (!done && gLayoutTestController->useDeferredFrameLoading()) { + if (!done && gTestRunner->useDeferredFrameLoading()) { [sender setDefersCallbacks:YES]; int64_t deferredWaitTime = 5 * NSEC_PER_MSEC; dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, deferredWaitTime); @@ -190,7 +190,7 @@ - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didCommitLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -198,14 +198,14 @@ ASSERT(![frame provisionalDataSource]); ASSERT([frame dataSource]); - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); NSView *documentView = [[mainFrame frameView] documentView]; [[[mainFrame webView] window] makeFirstResponder:documentView]; } - (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailProvisionalLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } @@ -228,7 +228,7 @@ ASSERT([frame dataSource]); ASSERT(frame == [[frame dataSource] webFrame]); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -244,7 +244,7 @@ - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -257,7 +257,7 @@ - (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"?? - windowScriptObjectAvailable"]; printf ("%s\n", [string UTF8String]); } @@ -267,13 +267,13 @@ - (void)didClearWindowObjectInStandardWorldForFrame:(WebFrame *)frame { - // Make New-Style LayoutTestController + // Make New-Style TestRunner JSContextRef context = [frame globalContext]; JSObjectRef globalObject = JSContextGetGlobalObject(context); JSValueRef exception = 0; - ASSERT(gLayoutTestController); - gLayoutTestController->makeWindowObject(context, globalObject, &exception); + ASSERT(gTestRunner); + gTestRunner->makeWindowObject(context, globalObject, &exception); ASSERT(!exception); gcController->makeWindowObject(context, globalObject, &exception); @@ -338,18 +338,18 @@ - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveTitle: %@", [frame _drt_descriptionSuitableForTestResult], title]; printf ("%s\n", [string UTF8String]); } - if (gLayoutTestController->dumpTitleChanges()) + if (gTestRunner->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", [title UTF8String]); } - (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveServerRedirectForProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -357,7 +357,7 @@ - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didChangeLocationWithinPageForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -365,12 +365,12 @@ - (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willPerformClientRedirectToURL: %@ ", [frame _drt_descriptionSuitableForTestResult], [URL _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } - if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - in willPerformClientRedirect", [frame _drt_printFrameUserGestureStatus]]; printf ("%s\n", [string UTF8String]); } @@ -378,7 +378,7 @@ - (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didCancelClientRedirectForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -386,7 +386,7 @@ - (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishDocumentLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } else if (!done) { @@ -400,7 +400,7 @@ - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didHandleOnloadEventsForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -408,25 +408,25 @@ - (void)webViewDidDisplayInsecureContent:(WebView *)sender { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf ("didDisplayInsecureContent\n"); } - (void)webView:(WebView *)sender didRunInsecureContent:(WebSecurityOrigin *)origin { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf ("didRunInsecureContent\n"); } - (void)webView:(WebView *)sender didDetectXSS:(NSURL *)insecureURL { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf ("didDetectXSS\n"); } - (void)webViewProgressFinishedNotification:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpProgressFinishedCallback()) + if (!done && gTestRunner->dumpProgressFinishedCallback()) printf ("postProgressFinishedNotification\n"); } diff --git a/Tools/DumpRenderTree/mac/HistoryDelegate.mm b/Tools/DumpRenderTree/mac/HistoryDelegate.mm index cbc409327..4c703f90a 100644 --- a/Tools/DumpRenderTree/mac/HistoryDelegate.mm +++ b/Tools/DumpRenderTree/mac/HistoryDelegate.mm @@ -26,7 +26,7 @@ #import "HistoryDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebNavigationData.h> #import <WebKit/WebView.h> @@ -74,7 +74,7 @@ - (void)populateVisitedLinksForWebView:(WebView *)webView { - if (gLayoutTestController->dumpVisitedLinksCallback()) + if (gTestRunner->dumpVisitedLinksCallback()) printf("Asked to populate visited links for WebView \"%s\"\n", [[[NSURL URLWithString:[webView mainFrameURL]] _drt_descriptionSuitableForTestResult] UTF8String]); } diff --git a/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm b/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm index eaef0d523..71f739063 100644 --- a/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm +++ b/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm @@ -33,7 +33,7 @@ #include "PixelDumpSupportCG.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <CoreGraphics/CGBitmapContext.h> #include <wtf/Assertions.h> #include <wtf/RefPtr.h> @@ -184,8 +184,8 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc PassRefPtr<BitmapContext> createPagedBitmapContext() { - int pageWidthInPixels = LayoutTestController::maxViewWidth; - int pageHeightInPixels = LayoutTestController::maxViewHeight; + int pageWidthInPixels = TestRunner::maxViewWidth; + int pageHeightInPixels = TestRunner::maxViewHeight; int numberOfPages = [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels]; size_t rowBytes = 0; void* buffer = 0; diff --git a/Tools/DumpRenderTree/mac/PolicyDelegate.h b/Tools/DumpRenderTree/mac/PolicyDelegate.h index 3b954557d..c1a7e6f25 100644 --- a/Tools/DumpRenderTree/mac/PolicyDelegate.h +++ b/Tools/DumpRenderTree/mac/PolicyDelegate.h @@ -28,14 +28,14 @@ #import <Cocoa/Cocoa.h> -class LayoutTestController; +class TestRunner; @interface PolicyDelegate : NSObject { BOOL permissiveDelegate; - LayoutTestController* controllerToNotifyDone; + TestRunner* controllerToNotifyDone; } - (void)setPermissive:(BOOL)permissive; -- (void)setControllerToNotifyDone:(LayoutTestController*)controller; +- (void)setControllerToNotifyDone:(TestRunner*)controller; @end diff --git a/Tools/DumpRenderTree/mac/PolicyDelegate.mm b/Tools/DumpRenderTree/mac/PolicyDelegate.mm index 5ad7368f3..6a0eeb9ec 100644 --- a/Tools/DumpRenderTree/mac/PolicyDelegate.mm +++ b/Tools/DumpRenderTree/mac/PolicyDelegate.mm @@ -30,7 +30,7 @@ #import "PolicyDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/DOMElement.h> #import <WebKit/WebFrame.h> #import <WebKit/WebPolicyDelegate.h> @@ -133,7 +133,7 @@ static NSString *dispositionTypeFromContentDispositionHeader(NSString *header) permissiveDelegate = permissive; } -- (void)setControllerToNotifyDone:(LayoutTestController*)controller +- (void)setControllerToNotifyDone:(TestRunner*)controller { controllerToNotifyDone = controller; } diff --git a/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm b/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm index a1e4f17a2..c5b26442c 100644 --- a/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm +++ b/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm @@ -30,7 +30,7 @@ #import "ResourceLoadDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebKit.h> #import <WebKit/WebTypesInternal.h> #import <WebKit/WebDataSourcePrivate.h> @@ -121,7 +121,7 @@ using namespace std; { ASSERT([[dataSource webFrame] dataSource] || [[dataSource webFrame] provisionalDataSource]); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) return [[request URL] _drt_descriptionSuitableForTestResult]; return @"<unknown>"; @@ -140,20 +140,20 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [request _drt_descriptionSuitableForTestResult], [redirectResponse _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } - if (!done && !gLayoutTestController->deferMainResourceDataLoad()) { + if (!done && !gTestRunner->deferMainResourceDataLoad()) { [dataSource _setDeferMainResourceDataLoad:false]; } - if (!done && gLayoutTestController->willSendRequestReturnsNull()) + if (!done && gTestRunner->willSendRequestReturnsNull()) return nil; - if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && redirectResponse) { + if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && redirectResponse) { printf("Returning null for this redirect\n"); return nil; } @@ -161,7 +161,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) NSURL *url = [request URL]; NSString *host = [url host]; if (host && (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"http"] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"https"])) { - NSString *testPathOrURL = [NSString stringWithUTF8String:gLayoutTestController->testPathOrURL().c_str()]; + NSString *testPathOrURL = [NSString stringWithUTF8String:gTestRunner->testPathOrURL().c_str()]; NSString *lowercaseTestPathOrURL = [testPathOrURL lowercaseString]; NSString *testHost = 0; if ([lowercaseTestPathOrURL hasPrefix:@"http:"] || [lowercaseTestPathOrURL hasPrefix:@"https:"]) @@ -176,13 +176,13 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) return nil; NSMutableURLRequest *newRequest = [request mutableCopy]; - const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders(); + const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders(); for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) { NSString *nsHeader = [[NSString alloc] initWithUTF8String:header->c_str()]; [newRequest setValue:nil forHTTPHeaderField:nsHeader]; [nsHeader release]; } - const std::string& destination = gLayoutTestController->redirectionDestinationForURL([[url absoluteString] UTF8String]); + const std::string& destination = gTestRunner->redirectionDestinationForURL([[url absoluteString] UTF8String]); if (destination.length()) [newRequest setURL:[NSURL URLWithString:[NSString stringWithUTF8String:destination.data()]]]; @@ -191,7 +191,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) - (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource { - if (!gLayoutTestController->handlesAuthenticationChallenges()) { + if (!gTestRunner->handlesAuthenticationChallenges()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet", identifier]; printf("%s\n", [string UTF8String]); @@ -199,10 +199,10 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) return; } - const char* user = gLayoutTestController->authenticationUsername().c_str(); + const char* user = gTestRunner->authenticationUsername().c_str(); NSString *nsUser = [NSString stringWithFormat:@"%s", user ? user : ""]; - const char* password = gLayoutTestController->authenticationPassword().c_str(); + const char* password = gTestRunner->authenticationPassword().c_str(); NSString *nsPassword = [NSString stringWithFormat:@"%s", password ? password : ""]; NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Responding with %@:%@", identifier, nsUser, nsPassword]; @@ -218,11 +218,11 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(void)webView: (WebView *)wv resource:identifier didReceiveResponse: (NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveResponse %@", identifier, [response _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } - if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) + if (!done && gTestRunner->dumpResourceResponseMIMETypes()) printf("%s has MIME type %s\n", [[[[response URL] relativePath] lastPathComponent] UTF8String], [[response MIMEType] UTF8String]); } @@ -232,7 +232,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(void)webView: (WebView *)wv resource:identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoading", identifier]; printf("%s\n", [string UTF8String]); } @@ -240,7 +240,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(void)webView: (WebView *)wv resource:identifier didFailLoadingWithError:(NSError *)error fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadingWithError: %@", identifier, [error _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } @@ -255,7 +255,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(NSCachedURLResponse *) webView: (WebView *)wv resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpWillCacheResponse()) { + if (!done && gTestRunner->dumpWillCacheResponse()) { NSString *string = [NSString stringWithFormat:@"%@ - willCacheResponse: called", identifier]; printf("%s\n", [string UTF8String]); } @@ -266,11 +266,11 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) { // Only log the message when shouldPaintBrokenImage() returns NO; this avoids changing results of layout tests with failed // images, e.g., security/block-test-no-port.html. - if (!done && gLayoutTestController->dumpResourceLoadCallbacks() && !gLayoutTestController->shouldPaintBrokenImage()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks() && !gTestRunner->shouldPaintBrokenImage()) { NSString *string = [NSString stringWithFormat:@"%@ - shouldPaintBrokenImage: NO", [imageURL _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } - return gLayoutTestController->shouldPaintBrokenImage(); + return gTestRunner->shouldPaintBrokenImage(); } @end diff --git a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/Tools/DumpRenderTree/mac/TestRunnerMac.mm index a32287141..1d7de85e2 100644 --- a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/Tools/DumpRenderTree/mac/TestRunnerMac.mm @@ -28,7 +28,7 @@ #import "config.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import "EditingDelegate.h" #import "MockGeolocationProvider.h" @@ -107,11 +107,11 @@ @end -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); @@ -125,17 +125,17 @@ void LayoutTestController::addDisallowedURL(JSStringRef url) CFSetAddValue(disallowedURLs, [request URL]); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return [[mainFrame webView] shouldClose]; } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { [WebApplicationCache deleteAllApplicationCaches]; } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef url) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; @@ -144,12 +144,12 @@ long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef u return usage; } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { [[WebStorageManager sharedWebStorageManager] syncLocalStorage]; } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef url) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; @@ -158,12 +158,12 @@ long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef url) return usage; } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { [storageDelegate logNotifications:number controller:this]; } -void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url) +void TestRunner::clearApplicationCacheForOrigin(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); @@ -186,32 +186,32 @@ JSValueRef originsArrayToJS(JSContextRef context, NSArray *origins) return JSObjectMakeArray(context, count, jsOriginsArray, NULL); } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { return originsArrayToJS(context, [WebApplicationCache originsWithCache]); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases]; } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { [[WebStorageManager sharedWebStorageManager] deleteAllOrigins]; } -void LayoutTestController::setStorageDatabaseIdleInterval(double interval) +void TestRunner::setStorageDatabaseIdleInterval(double interval) { [WebStorageManager setStorageDatabaseIdleInterval:interval]; } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { return originsArrayToJS(context, [[WebStorageManager sharedWebStorageManager] origins]); } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, URL)); @@ -220,7 +220,7 @@ void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) [origin release]; } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { WebBackForwardList *backForwardList = [[mainFrame webView] backForwardList]; WebHistoryItem *item = [[backForwardList currentItem] retain]; @@ -235,26 +235,26 @@ void LayoutTestController::clearBackForwardList() [item release]; } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); return JSStringCreateWithCFString((CFStringRef)[nameNS _web_decodeHostName]); } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); return JSStringCreateWithCFString((CFStringRef)[nameNS _web_encodeHostName]); } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { if (![WebHistory optionalSharedHistory]) { WebHistory *history = [[WebHistory alloc] init]; @@ -263,18 +263,18 @@ void LayoutTestController::keepWebHistory() } } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value]; } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText])); return string; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element) @@ -284,45 +284,45 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageProperty:propertyName:pageNumber])); return propertyValue; } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageSizeAndMarginsInPixels:pageNumber:width:height:marginTop:marginRight:marginBottom:marginLeft])); return propertyValue; } -int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) +int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) { return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels]; } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { return [[[mainFrame webView] UIDelegate] numberOfPendingGeolocationPermissionRequests]; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { return [[[WebHistory optionalSharedHistory] allItems] count]; } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { return [WebWorkersPrivate workerThreadCount]; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() const +JSRetainPtr<JSStringRef> TestRunner::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac")); return platformName; } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) dump(); @@ -362,12 +362,12 @@ static inline std::string resourceRootAbsolutePath(const std::string& testPathOr return testPathOrURL.substr(0, indexOfSeparatorAfterDirectoryName(expectedRootName, testPathOrURL)); } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString) { // The passed in path will be an absolute path to the resource starting // with "/tmp" or "/tmp/LayoutTests", optionally starting with the explicit file:// protocol. // /tmp maps to DUMPRENDERTREE_TEMP, and /tmp/LayoutTests maps to LOCAL_RESOURCE_ROOT. - // FIXME: This code should work on all *nix platforms and can be moved into LayoutTestController.cpp. + // FIXME: This code should work on all *nix platforms and can be moved into TestRunner.cpp. std::string expectedRootName; std::string absolutePathToResourceRoot; std::string localResourceString = stringFromJSString(localResourceJSString); @@ -393,7 +393,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt return JSStringCreateWithUTF8CString(absolutePathToLocalResource.c_str()); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); NSString *urlNS = (NSString *)urlCF.get(); @@ -405,12 +405,12 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool newAcceptsEditing) +void TestRunner::setAcceptsEditing(bool newAcceptsEditing) { [(EditingDelegate *)[[mainFrame webView] editingDelegate] setAcceptsEditing:newAcceptsEditing]; } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { if (alwaysAcceptCookies == m_alwaysAcceptCookies) return; @@ -420,24 +420,24 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:cookieAcceptPolicy]; } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { [WebApplicationCache setMaximumSize:size]; } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"http://127.0.0.1:8000"]]; [[origin applicationCacheQuotaManager] setQuota:quota]; [origin release]; } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { [[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag]; } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]]) @@ -446,7 +446,7 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb [(DOMHTMLInputElement *)element _setAutofilled:autofilled]; } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { if (setDelegate) { [policyDelegate setPermissive:permissive]; @@ -455,30 +455,30 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis [[mainFrame webView] setPolicyDelegate:nil]; } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]]; [[origin databaseQuotaManager] setQuota:quota]; [origin release]; } -void LayoutTestController::goBack() +void TestRunner::goBack() { [[mainFrame webView] goBack]; } -void LayoutTestController::setDefersLoading(bool defers) +void TestRunner::setDefersLoading(bool defers) { [[mainFrame webView] setDefersCallbacks:defers]; } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { RetainPtr<CFStringRef> schemeCFString(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, scheme)); [WebView _setDomainRelaxationForbidden:forbidden forURLScheme:(NSString *)schemeCFString.get()]; } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { // DumpRenderTree configured the WebView to use WebDeviceOrientationProviderMock. id<WebDeviceOrientationProvider> provider = [[mainFrame webView] _deviceOrientationProvider]; @@ -488,14 +488,14 @@ void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double [orientation release]; } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { WebGeolocationPosition *position = [[WebGeolocationPosition alloc] initWithTimestamp:currentTime() latitude:latitude longitude:longitude accuracy:accuracy]; [[MockGeolocationProvider shared] setPosition:position]; [position release]; } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { RetainPtr<CFStringRef> messageCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, message)); NSString *messageNS = (NSString *)messageCF.get(); @@ -503,31 +503,31 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message [[MockGeolocationProvider shared] setError:error]; } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); [[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission]; } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) { // FIXME: Workaround <rdar://problem/6480108> static WebIconDatabase *sharedWebIconDatabase = NULL; @@ -541,7 +541,7 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) [sharedWebIconDatabase setEnabled:iconDatabaseEnabled]; } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { NSView *documentView = [[mainFrame frameView] documentView]; @@ -549,79 +549,79 @@ void LayoutTestController::setMainFrameIsFirstResponder(bool flag) [[[mainFrame webView] window] makeFirstResponder:firstResponder]; } -void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) +void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) { [[[mainFrame webView] preferences] setPrivateBrowsingEnabled:privateBrowsingEnabled]; } -void LayoutTestController::setXSSAuditorEnabled(bool enabled) +void TestRunner::setXSSAuditorEnabled(bool enabled) { [[[mainFrame webView] preferences] setXSSAuditorEnabled:enabled]; } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { [[[mainFrame webView] preferences] setFrameFlatteningEnabled:enabled]; } -void LayoutTestController::setSpatialNavigationEnabled(bool enabled) +void TestRunner::setSpatialNavigationEnabled(bool enabled) { [[[mainFrame webView] preferences] setSpatialNavigationEnabled:enabled]; } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { [[[mainFrame webView] preferences] setAllowUniversalAccessFromFileURLs:enabled]; } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { [[[mainFrame webView] preferences] setAllowFileAccessFromFileURLs:enabled]; } -void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) +void TestRunner::setPopupBlockingEnabled(bool popupBlockingEnabled) { [[[mainFrame webView] preferences] setJavaScriptCanOpenWindowsAutomatically:!popupBlockingEnabled]; } -void LayoutTestController::setPluginsEnabled(bool pluginsEnabled) +void TestRunner::setPluginsEnabled(bool pluginsEnabled) { [[[mainFrame webView] preferences] setPlugInsEnabled:pluginsEnabled]; } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) { [[[mainFrame webView] preferences] setJavaScriptCanAccessClipboard:enabled]; } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool enabled) +void TestRunner::setAutomaticLinkDetectionEnabled(bool enabled) { [[mainFrame webView] setAutomaticLinkDetectionEnabled:enabled]; } -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) { [[mainFrame webView] setTabKeyCyclesThroughElements:cycles]; } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { [[mainFrame webView] _setDashboardBehavior:WebDashboardBehaviorUseBackwardCompatibilityMode to:flag]; } -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { [[WebPreferences standardPreferences] setUserStyleSheetEnabled:flag]; } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { RetainPtr<CFStringRef> pathCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, path)); NSURL *url = [NSURL URLWithString:(NSString *)pathCF.get()]; [[WebPreferences standardPreferences] setUserStyleSheetLocation:url]; } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]]) @@ -631,22 +631,22 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node [(DOMHTMLInputElement *)element _setValueForUser:(NSString *)valueCF.get()]; } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { // FIXME: implement } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { [[WebPreferences standardPreferences] setLoadsImagesAutomatically:NO]; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { [[mainFrame webView] _dispatchPendingLoadRequests]; } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { RetainPtr<CFStringRef> keyCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, key)); NSString *keyNS = (NSString *)keyCF.get(); @@ -657,34 +657,34 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value [[WebPreferences standardPreferences] _setPreferenceForTestWithValue:valueNS forKey:keyNS]; } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { [WebHistory _removeAllVisitedLinks]; } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) { RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL)); ::setPersistentUserStyleSheetLocation(urlString.get()); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { ::setPersistentUserStyleSheetLocation(0); } -void LayoutTestController::setWindowIsKey(bool windowIsKey) +void TestRunner::setWindowIsKey(bool windowIsKey) { m_windowIsKey = windowIsKey; [[mainFrame webView] _updateActiveState]; } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { [[mainFrame webView] setSmartInsertDeleteEnabled:flag]; } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { [[mainFrame webView] setSelectTrailingWhitespaceEnabled:flag]; } @@ -693,22 +693,22 @@ static const CFTimeInterval waitToDumpWatchdogInterval = 30.0; static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) { - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { m_waitToDump = waitUntilDone; if (m_waitToDump && shouldSetWaitToDumpWatchdog()) setWaitToDumpWatchdog(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval, 0, 0, 0, waitUntilDoneWatchdogFired, NULL)); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return CFArrayGetCount(openWindowsRef); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef jsString) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef jsString) { RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, jsString)); NSString *idNS = (NSString *)idCF.get(); @@ -722,7 +722,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef j return false; } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); @@ -733,7 +733,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) [[mainFrame webView] _executeCoreCommandByName:nameNS value:valueNS]; } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebFindOptions options = 0; @@ -769,12 +769,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, return [[mainFrame webView] findString:(NSString *)targetCFString.get() options:options]; } -void LayoutTestController::setCacheModel(int cacheModel) +void TestRunner::setCacheModel(int cacheModel) { [[WebPreferences standardPreferences] setCacheModel:cacheModel]; } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); @@ -798,7 +798,7 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name) return [validator validateUserInterfaceItem:target.get()]; } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId)); NSString *idNS = (NSString *)idCF.get(); @@ -808,7 +808,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return [mainFrame _pauseAnimation:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time]; } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId)); NSString *idNS = (NSString *)idCF.get(); @@ -818,19 +818,19 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return [mainFrame _pauseTransitionOfProperty:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time]; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { return [mainFrame _numberOfActiveAnimations]; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setWaitToDump(true); [policyDelegate setControllerToNotifyDone:this]; [[mainFrame webView] setPolicyDelegate:policyDelegate]; } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin)); NSString *sourceOriginNS = (NSString *)sourceOriginCF.get(); @@ -841,7 +841,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi [WebView _addOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains]; } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin)); NSString *sourceOriginNS = (NSString *)sourceOriginCF.get(); @@ -852,46 +852,46 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr [WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains]; } -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) { // FIXME: implement } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source)); NSString *sourceNS = (NSString *)sourceCF.get(); [WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd) injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)]; } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source)); NSString *sourceNS = (NSString *)sourceCF.get(); [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)]; } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:enabled]; } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool enabled) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool enabled) { [[[mainFrame webView] preferences] setAsynchronousSpellCheckingEnabled:enabled]; } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { [[[mainFrame webView] inspector] show:nil]; } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { [[[mainFrame webView] inspector] close:nil]; } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script)); NSString *scriptNS = (NSString *)scriptCF.get(); @@ -916,12 +916,12 @@ unsigned worldIDForWorld(WebScriptWorld *world) return 0; } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script)); NSString *scriptNS = (NSString *)scriptCF.get(); @@ -978,7 +978,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj @end -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @@ -1005,13 +1005,13 @@ void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, [pool release]; } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { WebView *view = [mainFrame webView]; [view goToBackForwardItem:[[view backForwardList] currentItem]]; } -void LayoutTestController::setWebViewEditable(bool editable) +void TestRunner::setWebViewEditable(bool editable) { WebView *view = [mainFrame webView]; [view setEditable:editable]; @@ -1092,7 +1092,7 @@ static NSString *SynchronousLoaderRunLoopMode = @"DumpRenderTreeSynchronousLoade @end -void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) +void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) { // See <rdar://problem/7880699>. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 @@ -1106,22 +1106,22 @@ void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef user #endif } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { [NSApp abortModal]; } -void LayoutTestController::setSerializeHTTPLoads(bool serialize) +void TestRunner::setSerializeHTTPLoads(bool serialize) { [WebView _setLoadResourcesSerially:serialize]; } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { [[mainFrame webView] _setMinimumTimerInterval:minimumTimerInterval]; } -void LayoutTestController::setTextDirection(JSStringRef directionName) +void TestRunner::setTextDirection(JSStringRef directionName) { #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 if (JSStringIsEqualToUTF8CString(directionName, "ltr")) @@ -1133,7 +1133,7 @@ void LayoutTestController::setTextDirection(JSStringRef directionName) #endif } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)]; textField.tag = 1; @@ -1144,7 +1144,7 @@ void LayoutTestController::addChromeInputField() [[mainFrame webView] setNextKeyView:textField]; } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { NSView* textField = [[[[mainFrame webView] window] contentView] viewWithTag:1]; if (textField) { @@ -1153,37 +1153,37 @@ void LayoutTestController::removeChromeInputField() } } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { [[[mainFrame webView] window] makeFirstResponder:[mainFrame webView]]; } -void LayoutTestController::setBackingScaleFactor(double backingScaleFactor) +void TestRunner::setBackingScaleFactor(double backingScaleFactor) { [[mainFrame webView] _setCustomBackingScaleFactor:backingScaleFactor]; } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { // FIXME: Implement. } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement. } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { // FIXME: Implement. } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { // FIXME: Implement. } diff --git a/Tools/DumpRenderTree/mac/UIDelegate.mm b/Tools/DumpRenderTree/mac/UIDelegate.mm index 840fdc209..dddec7af1 100644 --- a/Tools/DumpRenderTree/mac/UIDelegate.mm +++ b/Tools/DumpRenderTree/mac/UIDelegate.mm @@ -32,7 +32,7 @@ #import "DumpRenderTree.h" #import "DumpRenderTreeDraggingInfo.h" #import "EventSendingController.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebApplicationCache.h> #import <WebKit/WebFramePrivate.h> #import <WebKit/WebHTMLViewPrivate.h> @@ -80,10 +80,10 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webViewRunModal:(WebView *)sender { - gLayoutTestController->setWindowIsKey(false); + gTestRunner->setWindowIsKey(false); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalWindowWillClose:) name:NSWindowWillCloseNotification object:nil]; [NSApp runModalForWindow:[sender window]]; - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); } - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame @@ -111,7 +111,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; if (!done) printf("CONFIRM NAVIGATION: %s\n", [message UTF8String]); - return !gLayoutTestController->shouldStayOnPageAfterHandlingBeforeUnload(); + return !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload(); } @@ -125,25 +125,25 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webViewFocus:(WebView *)webView { - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); } - (void)webViewUnfocus:(WebView *)webView { - gLayoutTestController->setWindowIsKey(false); + gTestRunner->setWindowIsKey(false); } - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request { - if (!gLayoutTestController->canOpenWindows()) + if (!gTestRunner->canOpenWindows()) return nil; // Make sure that waitUntilDone has been called. - ASSERT(gLayoutTestController->waitToDump()); + ASSERT(gTestRunner->waitToDump()); WebView *webView = createWebViewAndOffscreenWindow(); - if (gLayoutTestController->newWindowsCopyBackForwardList()) + if (gTestRunner->newWindowsCopyBackForwardList()) [webView _loadBackForwardListFromOtherView:sender]; return [webView autorelease]; @@ -153,7 +153,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; { NSWindow* window = [sender window]; - if (gLayoutTestController->callCloseOnWebViews()) + if (gTestRunner->callCloseOnWebViews()) [sender close]; [window close]; @@ -161,7 +161,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier { - if (!done && gLayoutTestController->dumpDatabaseCallbacks()) { + if (!done && gTestRunner->dumpDatabaseCallbacks()) { printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], [databaseIdentifier UTF8String]); } @@ -172,7 +172,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin totalSpaceNeeded:(NSUInteger)totalSpaceNeeded { - if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) { + if (!done && gTestRunner->dumpApplicationCacheDelegateCallbacks()) { // For example, numbers from 30000 - 39999 will output as 30000. // Rounding up or down not really matter for these tests. It's // sufficient to just get a range of 10000 to determine if we were @@ -182,7 +182,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], truncatedSpaceNeeded); } - if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota()) + if (gTestRunner->disallowIncreaseForApplicationCacheQuota()) return; static const unsigned long long defaultOriginQuota = [WebApplicationCache defaultOriginQuota]; @@ -191,20 +191,20 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender setStatusText:(NSString *)text { - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]); } - (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebAllowDenyPolicyListener>)listener { - if (!gLayoutTestController->isGeolocationPermissionSet()) { + if (!gTestRunner->isGeolocationPermissionSet()) { if (!m_pendingGeolocationPermissionListeners) m_pendingGeolocationPermissionListeners = [[NSMutableSet set] retain]; [m_pendingGeolocationPermissionListeners addObject:listener]; return; } - if (gLayoutTestController->geolocationPermission()) + if (gTestRunner->geolocationPermission()) [listener allow]; else [listener deny]; @@ -212,7 +212,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)didSetMockGeolocationPermission { - ASSERT(gLayoutTestController->isGeolocationPermissionSet()); + ASSERT(gTestRunner->isGeolocationPermissionSet()); if (m_pendingGeolocationPermissionListeners && !m_timer) m_timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO]; } @@ -227,12 +227,12 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)timerFired { - ASSERT(gLayoutTestController->isGeolocationPermissionSet()); + ASSERT(gTestRunner->isGeolocationPermissionSet()); m_timer = 0; NSEnumerator* enumerator = [m_pendingGeolocationPermissionListeners objectEnumerator]; id<WebAllowDenyPolicyListener> listener; while ((listener = [enumerator nextObject])) { - if (gLayoutTestController->geolocationPermission()) + if (gTestRunner->geolocationPermission()) [listener allow]; else [listener deny]; @@ -260,7 +260,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)webView enterFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener { - if (!gLayoutTestController->hasCustomFullScreenBehavior()) + if (!gTestRunner->hasCustomFullScreenBehavior()) [self performSelector:@selector(enterFullScreenWithListener:) withObject:listener afterDelay:0]; } @@ -272,7 +272,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)webView exitFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener { - if (!gLayoutTestController->hasCustomFullScreenBehavior()) + if (!gTestRunner->hasCustomFullScreenBehavior()) [self performSelector:@selector(exitFullScreenWithListener:) withObject:listener afterDelay:0]; } diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index 6cd068ccf..1936f644a 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -18,7 +18,8 @@ INCLUDEPATH += \ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \ $${ROOT_WEBKIT_DIR}/Source/WTF -QT = core gui network testlib webkit widgets printsupport +QT = core gui network testlib webkit widgets +contains(DEFINES, HAVE_QTPRINTSUPPORT=1): QT += printsupport macx: QT += xml contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig @@ -30,7 +31,7 @@ HEADERS += \ EventSenderQt.h \ TextInputControllerQt.h \ WorkQueueItemQt.h \ - LayoutTestControllerQt.h \ + TestRunnerQt.h \ GCControllerQt.h \ QtInitializeTestFonts.h \ testplugin.h @@ -42,7 +43,7 @@ SOURCES += \ EventSenderQt.cpp \ TextInputControllerQt.cpp \ WorkQueueItemQt.cpp \ - LayoutTestControllerQt.cpp \ + TestRunnerQt.cpp \ GCControllerQt.cpp \ QtInitializeTestFonts.cpp \ testplugin.cpp \ diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 8f64e2750..db09ad713 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -36,7 +36,7 @@ #include "DumpRenderTreeSupportQt.h" #include "EventSenderQt.h" #include "GCControllerQt.h" -#include "LayoutTestControllerQt.h" +#include "TestRunnerQt.h" #include "TextInputControllerQt.h" #include "QtInitializeTestFonts.h" #include "testplugin.h" @@ -57,7 +57,7 @@ #include <QNetworkRequest> #include <QPaintDevice> #include <QPaintEngine> -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) #include <QPrinter> #endif #include <QProgressBar> @@ -110,7 +110,7 @@ void NetworkAccessManager::sslErrorsEncountered(QNetworkReply* reply, const QLis #endif -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) class NullPrinter : public QPrinter { public: class NullPaintEngine : public QPaintEngine { @@ -176,7 +176,7 @@ QWebInspector* WebPage::webInspector() void WebPage::resetSettings() { // After each layout test, reset the settings that may have been changed by - // layoutTestController.overridePreference() or similar. + // testRunner.overridePreference() or similar. settings()->resetFontSize(QWebSettings::DefaultFontSize); settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows); settings()->resetAttribute(QWebSettings::JavascriptEnabled); @@ -194,16 +194,16 @@ void WebPage::resetSettings() settings()->resetAttribute(QWebSettings::CSSGridLayoutEnabled); settings()->resetAttribute(QWebSettings::AcceleratedCompositingEnabled); - m_drt->layoutTestController()->setCaretBrowsingEnabled(false); - m_drt->layoutTestController()->setAuthorAndUserStylesEnabled(true); - m_drt->layoutTestController()->setFrameFlatteningEnabled(false); - m_drt->layoutTestController()->setMockScrollbarsEnabled(false); - m_drt->layoutTestController()->setSmartInsertDeleteEnabled(true); - m_drt->layoutTestController()->setSelectTrailingWhitespaceEnabled(false); - m_drt->layoutTestController()->setDefersLoading(false); + m_drt->testRunner()->setCaretBrowsingEnabled(false); + m_drt->testRunner()->setAuthorAndUserStylesEnabled(true); + m_drt->testRunner()->setFrameFlatteningEnabled(false); + m_drt->testRunner()->setMockScrollbarsEnabled(false); + m_drt->testRunner()->setSmartInsertDeleteEnabled(true); + m_drt->testRunner()->setSelectTrailingWhitespaceEnabled(false); + m_drt->testRunner()->setDefersLoading(false); // globalSettings must be reset explicitly. - m_drt->layoutTestController()->setXSSAuditorEnabled(false); + m_drt->testRunner()->setXSSAuditorEnabled(false); QWebSettings::setMaximumPagesInCache(0); // reset to default settings()->setUserStyleSheetUrl(QUrl()); // reset to default @@ -232,12 +232,12 @@ void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) { switch (feature) { case Notifications: - if (!m_drt->layoutTestController()->ignoreReqestForPermission()) + if (!m_drt->testRunner()->ignoreReqestForPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); break; case Geolocation: - if (m_drt->layoutTestController()->isGeolocationPermissionSet()) - if (m_drt->layoutTestController()->geolocationPermission()) + if (m_drt->testRunner()->isGeolocationPermissionSet()) + if (m_drt->testRunner()->geolocationPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); else setFeaturePermission(frame, feature, PermissionDeniedByUser); @@ -265,9 +265,9 @@ void WebPage::permissionSet(QWebPage::Feature feature) switch (feature) { case Geolocation: { - Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet()); + Q_ASSERT(m_drt->testRunner()->isGeolocationPermissionSet()); foreach (QWebFrame* frame, m_pendingGeolocationRequests) - if (m_drt->layoutTestController()->geolocationPermission()) + if (m_drt->testRunner()->geolocationPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); else setFeaturePermission(frame, feature, PermissionDeniedByUser); @@ -330,8 +330,8 @@ bool WebPage::javaScriptPrompt(QWebFrame*, const QString& msg, const QString& de bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type) { - if (m_drt->layoutTestController()->waitForPolicy()) - m_drt->layoutTestController()->notifyDone(); + if (m_drt->testRunner()->waitForPolicy()) + m_drt->testRunner()->notifyDone(); return QWebPage::acceptNavigationRequest(frame, request, type); } @@ -339,7 +339,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& r bool WebPage::supportsExtension(QWebPage::Extension extension) const { if (extension == QWebPage::ErrorPageExtension) - return m_drt->layoutTestController()->shouldHandleErrorPages(); + return m_drt->testRunner()->shouldHandleErrorPages(); return false; } @@ -424,7 +424,7 @@ DumpRenderTree::DumpRenderTree() DumpRenderTreeSupportQt::webPageSetGroupName(m_page, "org.webkit.qt.DumpRenderTree"); m_mainView->setContextMenuPolicy(Qt::NoContextMenu); - m_mainView->resize(QSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)); + m_mainView->resize(QSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight)); // clean up cache by resetting quota. qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota(); @@ -432,7 +432,7 @@ DumpRenderTree::DumpRenderTree() // create our controllers. This has to be done before connectFrame, // as it exports there to the JavaScript DOM window. - m_controller = new LayoutTestController(this); + m_controller = new TestRunner(this); connect(m_controller, SIGNAL(showPage()), this, SLOT(showPage())); connect(m_controller, SIGNAL(hidePage()), this, SLOT(hidePage())); @@ -500,7 +500,7 @@ static void clearHistory(QWebPage* page) void DumpRenderTree::dryRunPrint(QWebFrame* frame) { -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) NullPrinter printer; frame->print(&printer); #endif @@ -509,7 +509,7 @@ void DumpRenderTree::dryRunPrint(QWebFrame* frame) void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) { // reset so that any current loads are stopped - // NOTE: that this has to be done before the layoutTestController is + // NOTE: that this has to be done before the testRunner is // reset or we get timeouts for some tests. m_page->blockSignals(true); m_page->triggerAction(QWebPage::Stop); @@ -519,7 +519,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) for (int i = 0; i < knownOrigins.size(); ++i) knownOrigins[i].setDatabaseQuota(databaseDefaultQuota); - // reset the layoutTestController at this point, so that we under no + // reset the testRunner at this point, so that we under no // circumstance dump (stop the waitUntilDone timer) during the reset // of the DRT. m_controller->reset(); @@ -563,7 +563,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) QLocale::setDefault(QLocale::c()); - layoutTestController()->setDeveloperExtrasEnabled(true); + testRunner()->setDeveloperExtrasEnabled(true); #ifndef Q_OS_WINCE setlocale(LC_ALL, ""); #endif @@ -599,21 +599,21 @@ void DumpRenderTree::open(const QUrl& url) resetToConsistentStateBeforeTesting(url); if (isWebInspectorTest(m_page->mainFrame()->url())) - layoutTestController()->closeWebInspector(); + testRunner()->closeWebInspector(); if (isWebInspectorTest(url)) - layoutTestController()->showWebInspector(); + testRunner()->showWebInspector(); if (isDumpAsTextTest(url)) - layoutTestController()->dumpAsText(); + testRunner()->dumpAsText(); if (isGlobalHistoryTest(url)) - layoutTestController()->dumpHistoryCallbacks(); + testRunner()->dumpHistoryCallbacks(); // W3C SVG tests expect to be 480x360 bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1"); - int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth; - int height = isW3CTest ? 360 : LayoutTestController::maxViewHeight; + int width = isW3CTest ? 480 : TestRunner::maxViewWidth; + int height = isW3CTest ? 360 : TestRunner::maxViewHeight; m_mainView->resize(QSize(width, height)); m_page->setPreferredContentsSize(QSize()); m_page->setViewportSize(QSize(width, height)); @@ -876,7 +876,7 @@ QString DumpRenderTree::dumpBackForwardList(QWebPage* page) return result; } -static const char *methodNameStringForFailedTest(LayoutTestController *controller) +static const char *methodNameStringForFailedTest(TestRunner *controller) { const char *errorMessage; if (controller->shouldDumpAsText()) @@ -1010,7 +1010,7 @@ void DumpRenderTree::connectFrame(QWebFrame *frame) { connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(initJSObjects())); connect(frame, SIGNAL(provisionalLoad()), - layoutTestController(), SLOT(provisionalLoad())); + testRunner(), SLOT(provisionalLoad())); } void DumpRenderTree::dumpDatabaseQuota(QWebFrame* frame, const QString& dbName) diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h index a9cf3cd73..710f17343 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h @@ -55,7 +55,7 @@ QT_END_NAMESPACE class QWebFrame; -class LayoutTestController; +class TestRunner; class DumpRenderTreeSupportQt; class EventSender; class TextInputController; @@ -85,7 +85,7 @@ public: void closeRemainingWindows(); void resetToConsistentStateBeforeTesting(const QUrl&); - LayoutTestController *layoutTestController() const { return m_controller; } + TestRunner *testRunner() const { return m_controller; } EventSender *eventSender() const { return m_eventSender; } TextInputController *textInputController() const { return m_textInputController; } QString persistentStoragePath() const { return m_persistentStoragePath; } @@ -138,7 +138,7 @@ private: QString dumpFramesAsText(QWebFrame* frame); QString dumpBackForwardList(QWebPage* page); QString dumpFrameScrollPosition(QWebFrame* frame); - LayoutTestController *m_controller; + TestRunner *m_controller; bool m_dumpPixelsForCurrentTest; QString m_expectedHash; @@ -168,7 +168,7 @@ class NetworkAccessManager : public QNetworkAccessManager { public: NetworkAccessManager(QObject* parent); -private slots: +private Q_SLOTS: #ifndef QT_NO_OPENSSL void sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&); #endif @@ -198,7 +198,7 @@ public: void permissionSet(QWebPage::Feature feature); -public slots: +public Q_SLOTS: bool shouldInterruptJavaScript() { return false; } void requestPermission(QWebFrame* frame, QWebPage::Feature feature); void cancelPermission(QWebFrame* frame, QWebPage::Feature feature); @@ -207,7 +207,7 @@ protected: bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type); bool isTextOutputEnabled() { return m_drt->isTextOutputEnabled(); } -private slots: +private Q_SLOTS: void setViewGeometry(const QRect&); private: diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h index 4ec6f92bb..1c4db0208 100644 --- a/Tools/DumpRenderTree/qt/EventSenderQt.h +++ b/Tools/DumpRenderTree/qt/EventSenderQt.h @@ -54,7 +54,7 @@ public: virtual bool eventFilter(QObject* watched, QEvent* event); void resetClickCount() { m_clickCount = 0; } -public slots: +public Q_SLOTS: void mouseDown(int button = 0, const QStringList& modifiers = QStringList()); void mouseUp(int button = 0); void mouseMoveTo(int x, int y); diff --git a/Tools/DumpRenderTree/qt/GCControllerQt.h b/Tools/DumpRenderTree/qt/GCControllerQt.h index d3c83b9fe..bcc9f2347 100644 --- a/Tools/DumpRenderTree/qt/GCControllerQt.h +++ b/Tools/DumpRenderTree/qt/GCControllerQt.h @@ -40,7 +40,7 @@ class GCController : public QObject public: GCController(QWebPage* parent); -public slots: +public Q_SLOTS: void collect() const; void collectOnAlternateThread(bool waitUntilDone) const; unsigned int getJSObjectCount() const; diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp index 44d6da6a9..f35fe2614 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp @@ -27,10 +27,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" -#include "LayoutTestControllerQt.h" -#include "DumpRenderTreeSupportQt.h" +#include "TestRunnerQt.h" #include "DumpRenderTreeQt.h" +#include "DumpRenderTreeSupportQt.h" #include "WorkQueue.h" #include "WorkQueueItemQt.h" #include <QCoreApplication> @@ -38,7 +38,7 @@ #include <QLocale> #include <qwebsettings.h> -LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt) +TestRunner::TestRunner(WebCore::DumpRenderTree* drt) : QObject() , m_drt(drt) , m_shouldTimeout(true) @@ -48,7 +48,7 @@ LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt) DumpRenderTreeSupportQt::dumpNotification(true); } -void LayoutTestController::reset() +void TestRunner::reset() { m_hasDumped = false; m_loadFinished = false; @@ -99,7 +99,7 @@ void LayoutTestController::reset() emit hidePage(); } -void LayoutTestController::processWork() +void TestRunner::processWork() { // qDebug() << ">>>processWork"; @@ -111,7 +111,7 @@ void LayoutTestController::processWork() } // Called on loadFinished on WebPage -void LayoutTestController::maybeDump(bool /*success*/) +void TestRunner::maybeDump(bool /*success*/) { // This can happen on any of the http/tests/security/window-events-*.html tests, where the test opens @@ -142,7 +142,7 @@ void LayoutTestController::maybeDump(bool /*success*/) } } -void LayoutTestController::waitUntilDone() +void TestRunner::waitUntilDone() { //qDebug() << ">>>>waitForDone"; m_waitForDone = true; @@ -153,12 +153,12 @@ void LayoutTestController::waitUntilDone() m_timeoutTimer.start(m_timeout, this); } -void LayoutTestController::setViewModeMediaFeature(const QString& mode) +void TestRunner::setViewModeMediaFeature(const QString& mode) { m_drt->webPage()->setProperty("_q_viewMode", mode); } -int LayoutTestController::webHistoryItemCount() +int TestRunner::webHistoryItemCount() { if (!m_webHistory) return -1; @@ -168,12 +168,12 @@ int LayoutTestController::webHistoryItemCount() return m_webHistory->count() - 1; } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { m_webHistory = m_drt->webPage()->history(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { qDebug() << ">>>>notifyDone"; @@ -197,49 +197,49 @@ void LayoutTestController::notifyDone() m_waitForPolicy = false; } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return m_drt->windowCount(); } -void LayoutTestController::grantDesktopNotificationPermission(const QString& origin) +void TestRunner::grantDesktopNotificationPermission(const QString& origin) { QWebFrame* frame = m_drt->webPage()->mainFrame(); m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser); m_desktopNotificationAllowedOrigins.append(origin); } -void LayoutTestController::ignoreDesktopNotificationPermissionRequests() +void TestRunner::ignoreDesktopNotificationPermissionRequests() { m_ignoreDesktopNotification = true; } -bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin) +bool TestRunner::checkDesktopNotificationPermission(const QString& origin) { return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin); } -void LayoutTestController::simulateDesktopNotificationClick(const QString& title) +void TestRunner::simulateDesktopNotificationClick(const QString& title) { DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title); } -void LayoutTestController::display() +void TestRunner::display() { emit showPage(); } -void LayoutTestController::displayInvalidatedRegion() +void TestRunner::displayInvalidatedRegion() { display(); } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { m_drt->webPage()->history()->clear(); } -QString LayoutTestController::pathToLocalResource(const QString& url) +QString TestRunner::pathToLocalResource(const QString& url) { QString localTmpUrl(QLatin1String("file:///tmp/LayoutTests")); @@ -256,82 +256,82 @@ QString LayoutTestController::pathToLocalResource(const QString& url) return url; } -void LayoutTestController::dumpEditingCallbacks() +void TestRunner::dumpEditingCallbacks() { qDebug() << ">>>dumpEditingCallbacks"; DumpRenderTreeSupportQt::dumpEditingCallbacks(true); } -void LayoutTestController::dumpFrameLoadCallbacks() +void TestRunner::dumpFrameLoadCallbacks() { DumpRenderTreeSupportQt::dumpFrameLoader(true); } -void LayoutTestController::dumpProgressFinishedCallback() +void TestRunner::dumpProgressFinishedCallback() { DumpRenderTreeSupportQt::dumpProgressFinishedCallback(true); } -void LayoutTestController::dumpUserGestureInFrameLoadCallbacks() +void TestRunner::dumpUserGestureInFrameLoadCallbacks() { DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true); } -void LayoutTestController::dumpResourceLoadCallbacks() +void TestRunner::dumpResourceLoadCallbacks() { DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(true); } -void LayoutTestController::dumpResourceResponseMIMETypes() +void TestRunner::dumpResourceResponseMIMETypes() { DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true); } -void LayoutTestController::dumpWillCacheResponse() +void TestRunner::dumpWillCacheResponse() { DumpRenderTreeSupportQt::dumpWillCacheResponseCallbacks(true); } -void LayoutTestController::dumpHistoryCallbacks() +void TestRunner::dumpHistoryCallbacks() { DumpRenderTreeSupportQt::dumpHistoryCallbacks(true); } -void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled) +void TestRunner::setWillSendRequestReturnsNullOnRedirect(bool enabled) { DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled); } -void LayoutTestController::setWillSendRequestReturnsNull(bool enabled) +void TestRunner::setWillSendRequestReturnsNull(bool enabled) { DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(enabled); } -void LayoutTestController::setWillSendRequestClearHeader(const QStringList& headers) +void TestRunner::setWillSendRequestClearHeader(const QStringList& headers) { DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers); } -void LayoutTestController::setDeferMainResourceDataLoad(bool defer) +void TestRunner::setDeferMainResourceDataLoad(bool defer) { DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(defer); } -void LayoutTestController::queueBackNavigation(int howFarBackward) +void TestRunner::queueBackNavigation(int howFarBackward) { //qDebug() << ">>>queueBackNavigation" << howFarBackward; for (int i = 0; i != howFarBackward; ++i) WorkQueue::shared()->queue(new BackItem(1, m_drt->webPage())); } -void LayoutTestController::queueForwardNavigation(int howFarForward) +void TestRunner::queueForwardNavigation(int howFarForward) { //qDebug() << ">>>queueForwardNavigation" << howFarForward; for (int i = 0; i != howFarForward; ++i) WorkQueue::shared()->queue(new ForwardItem(1, m_drt->webPage())); } -void LayoutTestController::queueLoad(const QString& url, const QString& target) +void TestRunner::queueLoad(const QString& url, const QString& target) { //qDebug() << ">>>queueLoad" << url << target; QUrl mainResourceUrl = m_drt->webPage()->mainFrame()->url(); @@ -339,7 +339,7 @@ void LayoutTestController::queueLoad(const QString& url, const QString& target) WorkQueue::shared()->queue(new LoadItem(absoluteUrl, target, m_drt->webPage())); } -void LayoutTestController::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL) +void TestRunner::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL) { if (failingURL.isEmpty()) WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, m_drt->webPage())); @@ -347,32 +347,32 @@ void LayoutTestController::queueLoadHTMLString(const QString& content, const QSt WorkQueue::shared()->queue(new LoadAlternateHTMLStringItem(content, baseURL, failingURL, m_drt->webPage())); } -void LayoutTestController::queueReload() +void TestRunner::queueReload() { //qDebug() << ">>>queueReload"; WorkQueue::shared()->queue(new ReloadItem(m_drt->webPage())); } -void LayoutTestController::queueLoadingScript(const QString& script) +void TestRunner::queueLoadingScript(const QString& script) { //qDebug() << ">>>queueLoadingScript" << script; WorkQueue::shared()->queue(new LoadingScriptItem(script, m_drt->webPage())); } -void LayoutTestController::queueNonLoadingScript(const QString& script) +void TestRunner::queueNonLoadingScript(const QString& script) { //qDebug() << ">>>queueNonLoadingScript" << script; WorkQueue::shared()->queue(new NonLoadingScriptItem(script, m_drt->webPage())); } -void LayoutTestController::provisionalLoad() +void TestRunner::provisionalLoad() { QWebFrame* frame = qobject_cast<QWebFrame*>(sender()); if (!m_topLoadingFrame && !m_hasDumped) m_topLoadingFrame = frame; } -void LayoutTestController::timerEvent(QTimerEvent *ev) +void TestRunner::timerEvent(QTimerEvent *ev) { if (ev->timerId() == m_timeoutTimer.timerId()) { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; @@ -383,144 +383,144 @@ void LayoutTestController::timerEvent(QTimerEvent *ev) QObject::timerEvent(ev); } -QString LayoutTestController::encodeHostName(const QString& host) +QString TestRunner::encodeHostName(const QString& host) { QString encoded = QString::fromLatin1(QUrl::toAce(host + QLatin1String(".no"))); encoded.truncate(encoded.length() - 3); // strip .no return encoded; } -QString LayoutTestController::decodeHostName(const QString& host) +QString TestRunner::decodeHostName(const QString& host) { QString decoded = QUrl::fromAce(host.toLatin1() + QByteArray(".no")); decoded.truncate(decoded.length() - 3); return decoded; } -void LayoutTestController::setMediaType(const QString& type) +void TestRunner::setMediaType(const QString& type) { DumpRenderTreeSupportQt::setMediaType(m_drt->webPage()->mainFrame(), type); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { DumpRenderTreeSupportQt::webInspectorClose(m_drt->webPage()); m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false); } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enabled); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); DumpRenderTreeSupportQt::webInspectorShow(m_drt->webPage()); } -void LayoutTestController::evaluateInWebInspector(long callId, const QString& script) +void TestRunner::evaluateInWebInspector(long callId, const QString& script) { DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->webPage(), callId, script); } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled); } -void LayoutTestController::setMockScrollbarsEnabled(bool enabled) +void TestRunner::setMockScrollbarsEnabled(bool enabled) { DumpRenderTreeSupportQt::setMockScrollbarsEnabled(m_drt->webPage(), enabled); } -void LayoutTestController::goBack() +void TestRunner::goBack() { DumpRenderTreeSupportQt::goBack(m_drt->webPage()); } -void LayoutTestController::setDefersLoading(bool flag) +void TestRunner::setDefersLoading(bool flag) { DumpRenderTreeSupportQt::setDefersLoading(m_drt->webPage(), flag); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, enabled); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, enabled); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota) +void TestRunner::setAppCacheMaximumSize(unsigned long long quota) { m_drt->webPage()->settings()->setOfflineWebApplicationCacheQuota(quota); } -void LayoutTestController::setAutofilled(const QWebElement& element, bool isAutofilled) +void TestRunner::setAutofilled(const QWebElement& element, bool isAutofilled) { return DumpRenderTreeSupportQt::setAutofilled(element, isAutofilled); } -void LayoutTestController::setValueForUser(const QWebElement& element, const QString& value) +void TestRunner::setValueForUser(const QWebElement& element, const QString& value) { DumpRenderTreeSupportQt::setValueForUser(element, value); } -void LayoutTestController::setFixedContentsSize(int width, int height) +void TestRunner::setFixedContentsSize(int width, int height) { m_topLoadingFrame->page()->setPreferredContentsSize(QSize(width, height)); } -void LayoutTestController::setPrivateBrowsingEnabled(bool enable) +void TestRunner::setPrivateBrowsingEnabled(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, enable); } -void LayoutTestController::setSpatialNavigationEnabled(bool enable) +void TestRunner::setSpatialNavigationEnabled(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, enable); } -void LayoutTestController::setPopupBlockingEnabled(bool enable) +void TestRunner::setPopupBlockingEnabled(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, !enable); } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { // FIXME: Implement } -void LayoutTestController::setPOSIXLocale(const QString& locale) +void TestRunner::setPOSIXLocale(const QString& locale) { QLocale qlocale(locale); QLocale::setDefault(qlocale); } -void LayoutTestController::setWindowIsKey(bool isKey) +void TestRunner::setWindowIsKey(bool isKey) { m_drt->switchFocus(isKey); } -void LayoutTestController::setMainFrameIsFirstResponder(bool isFirst) +void TestRunner::setMainFrameIsFirstResponder(bool isFirst) { //FIXME: only need this for the moment: https://bugs.webkit.org/show_bug.cgi?id=32990 } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enable) +void TestRunner::setJavaScriptCanAccessClipboard(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, enable); } -void LayoutTestController::setXSSAuditorEnabled(bool enable) +void TestRunner::setXSSAuditorEnabled(bool enable) { // Set XSSAuditingEnabled globally so that windows created by the test inherit it too. // resetSettings() will call this to reset the page and global setting to false again. @@ -530,7 +530,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enable) m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditingEnabled, enable); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& animationName, +bool TestRunner::pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId) { @@ -539,7 +539,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& an return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& propertyName, +bool TestRunner::pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId) { @@ -548,59 +548,59 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& p return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId); } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { QWebFrame* frame = m_drt->webPage()->mainFrame(); Q_ASSERT(frame); return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false); } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { DumpRenderTreeSupportQt::clearAllApplicationCaches(); } -void LayoutTestController::clearApplicationCacheForOrigin(const QString& url) +void TestRunner::clearApplicationCacheForOrigin(const QString& url) { // FIXME: Implement to support deleting all application caches for an origin. } -long long LayoutTestController::localStorageDiskUsageForOrigin(const QString& originIdentifier) +long long TestRunner::localStorageDiskUsageForOrigin(const QString& originIdentifier) { // FIXME: Implement to support getting disk usage in bytes for an origin. return 0; } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { if (!m_topLoadingFrame) return; m_topLoadingFrame->securityOrigin().setApplicationCacheQuota(quota); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(const QString& origin) +long long TestRunner::applicationCacheDiskUsageForOrigin(const QString& origin) { // FIXME: Implement to support getting disk usage by all application caches for an origin. return 0; } -QStringList LayoutTestController::originsWithApplicationCache() +QStringList TestRunner::originsWithApplicationCache() { // FIXME: Implement to get origins that have application caches. return QStringList(); } -void LayoutTestController::setCacheModel(int model) +void TestRunner::setCacheModel(int model) { // qwebsetting doesn't have matched setting yet : // WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER @@ -610,41 +610,41 @@ void LayoutTestController::setCacheModel(int model) // FIXME: Implement. } -void LayoutTestController::setDatabaseQuota(int size) +void TestRunner::setDatabaseQuota(int size) { if (!m_topLoadingFrame) return; m_topLoadingFrame->securityOrigin().setDatabaseQuota(size); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { QWebDatabase::removeAllDatabases(); } -void LayoutTestController::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) { DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) { DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains); } -void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive) { DumpRenderTreeSupportQt::setCustomPolicyDelegate(enabled, permissive); } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setCustomPolicyDelegate(true); m_waitForPolicy = true; waitUntilDone(); } -void LayoutTestController::overridePreference(const QString& name, const QVariant& value) +void TestRunner::overridePreference(const QString& name, const QVariant& value) { QWebSettings* settings = m_topLoadingFrame->page()->settings(); @@ -673,11 +673,11 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian else if (name == "WebKitAcceleratedCompositingEnabled") settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, value.toBool()); else - printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n", + printf("ERROR: TestRunner::overridePreference() does not support the '%s' preference\n", name.toLatin1().data()); } -void LayoutTestController::setUserStyleSheetLocation(const QString& url) +void TestRunner::setUserStyleSheetLocation(const QString& url) { QByteArray urlData = pathToLocalResource(url).toLatin1(); m_userStyleSheetLocation = QUrl::fromEncoded(urlData, QUrl::StrictMode); @@ -686,17 +686,17 @@ void LayoutTestController::setUserStyleSheetLocation(const QString& url) setUserStyleSheetEnabled(true); } -void LayoutTestController::setCaretBrowsingEnabled(bool value) +void TestRunner::setCaretBrowsingEnabled(bool value) { DumpRenderTreeSupportQt::setCaretBrowsingEnabled(m_drt->webPage(), value); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool value) +void TestRunner::setAuthorAndUserStylesEnabled(bool value) { DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(m_drt->webPage(), value); } -void LayoutTestController::setUserStyleSheetEnabled(bool enabled) +void TestRunner::setUserStyleSheetEnabled(bool enabled) { m_userStyleSheetEnabled = enabled; @@ -706,27 +706,27 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled) m_drt->webPage()->settings()->setUserStyleSheetUrl(QUrl()); } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme) { DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme); } -int LayoutTestController::workerThreadCount() +int TestRunner::workerThreadCount() { return DumpRenderTreeSupportQt::workerThreadCount(); } -int LayoutTestController::numberOfPages(float width, float height) +int TestRunner::numberOfPages(float width, float height) { return DumpRenderTreeSupportQt::numberOfPages(m_drt->webPage()->mainFrame(), width, height); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return DumpRenderTreeSupportQt::shouldClose(m_drt->webPage()->mainFrame()); } -void LayoutTestController::setScrollbarPolicy(const QString& orientation, const QString& policy) +void TestRunner::setScrollbarPolicy(const QString& orientation, const QString& policy) { Qt::Orientation o; Qt::ScrollBarPolicy p; @@ -750,52 +750,52 @@ void LayoutTestController::setScrollbarPolicy(const QString& orientation, const m_drt->webPage()->mainFrame()->setScrollBarPolicy(o, p); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool enable) +void TestRunner::setSmartInsertDeleteEnabled(bool enable) { DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(m_drt->webPage(), enable); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool enable) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool enable) { DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(m_drt->webPage(), enable); } -void LayoutTestController::execCommand(const QString& name, const QString& value) +void TestRunner::execCommand(const QString& name, const QString& value) { DumpRenderTreeSupportQt::executeCoreCommandByName(m_drt->webPage(), name, value); } -bool LayoutTestController::isCommandEnabled(const QString& name) const +bool TestRunner::isCommandEnabled(const QString& name) const { return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name); } -bool LayoutTestController::findString(const QString& string, const QStringList& optionArray) +bool TestRunner::findString(const QString& string, const QStringList& optionArray) { return DumpRenderTreeSupportQt::findString(m_drt->webPage(), string, optionArray); } -QString LayoutTestController::markerTextForListItem(const QWebElement& listItem) +QString TestRunner::markerTextForListItem(const QWebElement& listItem) { return DumpRenderTreeSupportQt::markerTextForListItem(listItem); } -QVariantMap LayoutTestController::computedStyleIncludingVisitedInfo(const QWebElement& element) const +QVariantMap TestRunner::computedStyleIncludingVisitedInfo(const QWebElement& element) const { return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(element); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const QString& elementId) +bool TestRunner::elementDoesAutoCompleteForElementWithId(const QString& elementId) { return DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(m_drt->webPage()->mainFrame(), elementId); } -void LayoutTestController::authenticateSession(const QString&, const QString&, const QString&) +void TestRunner::authenticateSession(const QString&, const QString&, const QString&) { // FIXME: If there is a concept per-session (per-process) credential storage, the credentials should be added to it for later use. } -void LayoutTestController::setIconDatabaseEnabled(bool enable) +void TestRunner::setIconDatabaseEnabled(bool enable) { if (enable && !m_drt->persistentStoragePath().isEmpty()) QWebSettings::setIconDatabasePath(m_drt->persistentStoragePath()); @@ -803,14 +803,14 @@ void LayoutTestController::setIconDatabaseEnabled(bool enable) QWebSettings::setIconDatabasePath(QString()); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { QList<WebCore::WebPage*> pages = m_drt->getAllPages(); foreach (WebCore::WebPage* page, pages) DumpRenderTreeSupportQt::setMockDeviceOrientation(page, canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); QList<WebCore::WebPage*> pages = m_drt->getAllPages(); @@ -818,7 +818,7 @@ void LayoutTestController::setGeolocationPermission(bool allow) DumpRenderTreeSupportQt::setMockGeolocationPermission(page, allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { int pendingPermissionCount = 0; QList<WebCore::WebPage*> pages = m_drt->getAllPages(); @@ -828,133 +828,133 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests() return pendingPermissionCount; } -void LayoutTestController::setGeolocationPermissionCommon(bool allow) +void TestRunner::setGeolocationPermissionCommon(bool allow) { m_isGeolocationPermissionSet = true; m_geolocationPermission = allow; } -void LayoutTestController::setMockGeolocationError(int code, const QString& message) +void TestRunner::setMockGeolocationError(int code, const QString& message) { QList<WebCore::WebPage*> pages = m_drt->getAllPages(); foreach (WebCore::WebPage* page, pages) DumpRenderTreeSupportQt::setMockGeolocationError(page, code, message); } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { QList<WebCore::WebPage*> pages = m_drt->getAllPages(); foreach (WebCore::WebPage* page, pages) DumpRenderTreeSupportQt::setMockGeolocationPosition(page, latitude, longitude, accuracy); } -void LayoutTestController::addMockSpeechInputResult(const QString& result, double confidence, const QString& language) +void TestRunner::addMockSpeechInputResult(const QString& result, double confidence, const QString& language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(const QString& inputElement) +void TestRunner::startSpeechInput(const QString& inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script) { // FIXME: Implement. } -void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script) +void TestRunner::evaluateScriptInIsolatedWorld(int worldID, const QString& script) { DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->webPage()->mainFrame(), worldID, script); } -QString LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) +QString TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) { return DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(m_drt->webPage()->mainFrame(), pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft); } -QString LayoutTestController::pageProperty(const QString& propertyName, int pageNumber) +QString TestRunner::pageProperty(const QString& propertyName, int pageNumber) { return DumpRenderTreeSupportQt::pageProperty(m_drt->webPage()->mainFrame(), propertyName, pageNumber); } -void LayoutTestController::addUserStyleSheet(const QString& sourceCode) +void TestRunner::addUserStyleSheet(const QString& sourceCode) { DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->webPage(), sourceCode); } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { QWebHistory* history = m_drt->webPage()->history(); history->clear(); DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true); } -void LayoutTestController::addURLToRedirect(const QString& origin, const QString& destination) +void TestRunner::addURLToRedirect(const QString& origin, const QString& destination) { DumpRenderTreeSupportQt::addURLToRedirect(origin, destination); } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { DumpRenderTreeSupportQt::setMinimumTimerInterval(m_drt->webPage(), minimumTimerInterval); } -void LayoutTestController::originsWithLocalStorage() +void TestRunner::originsWithLocalStorage() { // FIXME: Implement. } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { // FIXME: Implement. } -void LayoutTestController::deleteLocalStorageForOrigin(const QString& originIdentifier) +void TestRunner::deleteLocalStorageForOrigin(const QString& originIdentifier) { // FIXME: Implement. } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { // FIXME: Implement. } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { // FIXME: Implement. } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement this. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement this. } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { // FIXME: Implement this. } -QString LayoutTestController::layerTreeAsText() +QString TestRunner::layerTreeAsText() { return DumpRenderTreeSupportQt::layerTreeAsText(m_drt->webPage()->mainFrame()); } -void LayoutTestController::setTextDirection(const QString& directionName) +void TestRunner::setTextDirection(const QString& directionName) { if (directionName == "auto") m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionDefault); @@ -964,7 +964,7 @@ void LayoutTestController::setTextDirection(const QString& directionName) m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionLeftToRight); } -void LayoutTestController::setAlwaysAcceptCookies(bool accept) +void TestRunner::setAlwaysAcceptCookies(bool accept) { QWebSettings* globalSettings = QWebSettings::globalSettings(); if (accept) @@ -975,7 +975,7 @@ void LayoutTestController::setAlwaysAcceptCookies(bool accept) } } -void LayoutTestController::setAlwaysBlockCookies(bool block) +void TestRunner::setAlwaysBlockCookies(bool block) { QWebSettings* globalSettings = QWebSettings::globalSettings(); if (block) @@ -984,5 +984,5 @@ void LayoutTestController::setAlwaysBlockCookies(bool block) globalSettings->setThirdPartyCookiePolicy(QWebSettings::AlwaysAllowThirdPartyCookies); } -const unsigned LayoutTestController::maxViewWidth = 800; -const unsigned LayoutTestController::maxViewHeight = 600; +const unsigned TestRunner::maxViewWidth = 800; +const unsigned TestRunner::maxViewHeight = 600; diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h b/Tools/DumpRenderTree/qt/TestRunnerQt.h index 6626f8471..52d512ca0 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.h @@ -27,17 +27,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayoutTestControllerQt_h -#define LayoutTestControllerQt_h +#ifndef TestRunnerQt_h +#define TestRunnerQt_h #include <QBasicTimer> #include <QObject> #include <QSize> #include <QString> -#include <QtDebug> #include <QTimer> #include <QTimerEvent> #include <QVariant> +#include <QtDebug> #include <qwebdatabase.h> #include <qwebelement.h> @@ -49,15 +49,16 @@ class QWebFrame; class DumpRenderTreeSupportQt; namespace WebCore { - class DumpRenderTree; +class DumpRenderTree; } -class LayoutTestController : public QObject { + +class TestRunner : public QObject { Q_OBJECT Q_PROPERTY(int webHistoryItemCount READ webHistoryItemCount) Q_PROPERTY(int workerThreadCount READ workerThreadCount) Q_PROPERTY(bool globalFlag READ globalFlag WRITE setGlobalFlag) public: - LayoutTestController(WebCore::DumpRenderTree* drt); + TestRunner(WebCore::DumpRenderTree*); bool shouldDisallowIncreaseForApplicationCacheQuota() const { return m_disallowIncreaseForApplicationCacheQuota; } bool shouldDumpAsText() const { return m_textDump; } @@ -86,14 +87,14 @@ public: protected: void timerEvent(QTimerEvent*); -signals: +Q_SIGNALS: void done(); void showPage(); void hidePage(); void geolocationPermissionSet(); -public slots: +public Q_SLOTS: void maybeDump(bool ok); void disallowIncreaseForApplicationCacheQuota() { m_disallowIncreaseForApplicationCacheQuota = true; } void dumpAsText() { m_textDump = true; } @@ -131,7 +132,7 @@ public slots: void queueLoadingScript(const QString& script); void queueNonLoadingScript(const QString& script); void provisionalLoad(); - void setCloseRemainingWindowsWhenComplete(bool = false) {} + void setCloseRemainingWindowsWhenComplete(bool = false) { } int windowCount(); void grantDesktopNotificationPermission(const QString& origin); void ignoreDesktopNotificationPermissionRequests(); @@ -144,41 +145,41 @@ public slots: void dumpTitleChanges() { m_dumpTitleChanges = true; } QString encodeHostName(const QString& host); QString decodeHostName(const QString& host); - void dumpSelectionRect() const {} + void dumpSelectionRect() const { } void setDeveloperExtrasEnabled(bool); void setAsynchronousSpellCheckingEnabled(bool); void showWebInspector(); void closeWebInspector(); void evaluateInWebInspector(long callId, const QString& script); void removeAllVisitedLinks(); - void setMediaType(const QString& type); - void setFrameFlatteningEnabled(bool enable); - void setMockScrollbarsEnabled(bool enable); + void setMediaType(const QString&); + void setFrameFlatteningEnabled(bool); + void setMockScrollbarsEnabled(bool); void setAllowUniversalAccessFromFileURLs(bool enable); void setAllowFileAccessFromFileURLs(bool enable); void setAppCacheMaximumSize(unsigned long long quota); void setAutofilled(const QWebElement&, bool enable); void setValueForUser(const QWebElement&, const QString& value); void setFixedContentsSize(int width, int height); - void setPrivateBrowsingEnabled(bool enable); - void setSpatialNavigationEnabled(bool enabled); + void setPrivateBrowsingEnabled(bool); + void setSpatialNavigationEnabled(bool); void setPluginsEnabled(bool flag); - void setPopupBlockingEnabled(bool enable); + void setPopupBlockingEnabled(bool); void setPOSIXLocale(const QString& locale); void resetLoadFinished() { m_loadFinished = false; } - void setWindowIsKey(bool isKey); - void setMainFrameIsFirstResponder(bool isFirst); + void setWindowIsKey(bool); + void setMainFrameIsFirstResponder(bool); void setDeferMainResourceDataLoad(bool); void setJavaScriptCanAccessClipboard(bool enable); - void setXSSAuditorEnabled(bool enable); - void setCaretBrowsingEnabled(bool enable); + void setXSSAuditorEnabled(bool); + void setCaretBrowsingEnabled(bool); void setAuthorAndUserStylesEnabled(bool); void setViewModeMediaFeature(const QString& mode); - void setSmartInsertDeleteEnabled(bool enable); - void setSelectTrailingWhitespaceEnabled(bool enable); + void setSmartInsertDeleteEnabled(bool); + void setSelectTrailingWhitespaceEnabled(bool); void execCommand(const QString& name, const QString& value = QString()); bool isCommandEnabled(const QString& name) const; - bool findString(const QString& string, const QStringList& optionArray); + bool findString(const QString&, const QStringList& optionArray); bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId); bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId); @@ -194,32 +195,32 @@ public slots: void clearAllApplicationCaches(); void clearApplicationCacheForOrigin(const QString& url); - void setApplicationCacheOriginQuota(unsigned long long quota); + void setApplicationCacheOriginQuota(unsigned long long); QStringList originsWithApplicationCache(); long long applicationCacheDiskUsageForOrigin(const QString&); void setCacheModel(int); void setDatabaseQuota(int size); void clearAllDatabases(); - void setIconDatabaseEnabled(bool enable); + void setIconDatabaseEnabled(bool); void setCustomPolicyDelegate(bool enabled, bool permissive = false); void waitForPolicyDelegate(); void overridePreference(const QString& name, const QVariant& value); void setUserStyleSheetLocation(const QString& url); - void setUserStyleSheetEnabled(bool enabled); + void setUserStyleSheetEnabled(bool); void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme); int workerThreadCount(); int numberOfPages(float width = maxViewWidth, float height = maxViewHeight); bool callShouldCloseOnWebView(); // For now, this is a no-op. This may change depending on outcome of // https://bugs.webkit.org/show_bug.cgi?id=33333 - void setCallCloseOnWebViews() {} + void setCallCloseOnWebViews() { } // This is a no-op - it allows us to pass // plugins/get-url-that-the-resource-load-delegate-will-disallow.html // which is a Mac-specific test. - void addDisallowedURL(const QString&) {} + void addDisallowedURL(const QString&) { } void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma); @@ -239,8 +240,8 @@ public slots: void setAutomaticLinkDetectionEnabled(bool); - // Empty stub method to keep parity with object model exposed by global LayoutTestController. - void abortModal() {} + // Empty stub method to keep parity with object model exposed by global TestRunner. + void abortModal() { } void addURLToRedirect(const QString& origin, const QString& destination); @@ -251,7 +252,7 @@ public slots: void setScrollbarPolicy(const QString& orientation, const QString& policy); QString markerTextForListItem(const QWebElement& listItem); - QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element) const; + QVariantMap computedStyleIncludingVisitedInfo(const QWebElement&) const; // Simulate a request an embedding application could make, populating per-session credential storage. void authenticateSession(const QString& url, const QString& username, const QString& password); @@ -277,7 +278,7 @@ public slots: void setAlwaysAcceptCookies(bool); void setAlwaysBlockCookies(bool); -private slots: +private Q_SLOTS: void processWork(); private: @@ -317,4 +318,4 @@ private: int m_timeout; }; -#endif // LayoutTestControllerQt_h +#endif // TestRunnerQt_h diff --git a/Tools/DumpRenderTree/qt/TextInputControllerQt.h b/Tools/DumpRenderTree/qt/TextInputControllerQt.h index 572abfd7c..294027340 100644 --- a/Tools/DumpRenderTree/qt/TextInputControllerQt.h +++ b/Tools/DumpRenderTree/qt/TextInputControllerQt.h @@ -40,7 +40,7 @@ class TextInputController : public QObject { public: TextInputController(QWebPage* parent); -public slots: +public Q_SLOTS: void doCommand(const QString& command); void setMarkedText(const QString& string, int start, int end); // bool hasMarkedText(); diff --git a/Tools/DumpRenderTree/qt/main.cpp b/Tools/DumpRenderTree/qt/main.cpp index 410ac7c35..0d37ee819 100644 --- a/Tools/DumpRenderTree/qt/main.cpp +++ b/Tools/DumpRenderTree/qt/main.cpp @@ -119,6 +119,7 @@ int main(int argc, char* argv[]) QApplication::setGraphicsSystem("raster"); QApplication::setStyle(new QWindowsStyle); + QApplication::setDesktopSettingsAware(false); QApplication app(argc, argv); app.setQuitOnLastWindowClosed(false); diff --git a/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp b/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp index 830afd3c4..a7bfc6d44 100644 --- a/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp +++ b/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp @@ -32,7 +32,7 @@ #include "DRTDesktopNotificationPresenter.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <JavaScriptCore/JSStringRef.h> #include <JavaScriptCore/JSStringRefBSTR.h> #include <WebCore/NotificationClient.h> @@ -125,7 +125,7 @@ HRESULT STDMETHODCALLTYPE DRTDesktopNotificationPresenter::checkNotificationPerm { #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) JSStringRef jsOrigin = JSStringCreateWithBSTR(origin); - bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin); + bool allowed = ::gTestRunner->checkDesktopNotificationPermission(jsOrigin); if (allowed) *result = WebCore::NotificationClient::PermissionAllowed; diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp index 312430d56..ad1726dc9 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp @@ -32,10 +32,10 @@ #include "EditingDelegate.h" #include "FrameLoadDelegate.h" #include "HistoryDelegate.h" -#include "LayoutTestController.h" #include "PixelDumpSupport.h" #include "PolicyDelegate.h" #include "ResourceLoadDelegate.h" +#include "TestRunner.h" #include "UIDelegate.h" #include "WebCoreTestSupport.h" #include "WorkQueueItem.h" @@ -105,7 +105,7 @@ COMPtr<HistoryDelegate> sharedHistoryDelegate; IWebFrame* frame; HWND webViewWindow; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; UINT_PTR waitToDumpWatchdog = 0; @@ -424,7 +424,7 @@ void dumpFrameScrollPosition(IWebFrame* frame) printf("scrolled to %.f,%.f\n", (double)scrollPosition.cx, (double)scrollPosition.cy); } - if (::gLayoutTestController->dumpChildFrameScrollPositions()) { + if (::gTestRunner->dumpChildFrameScrollPositions()) { COMPtr<IEnumVARIANT> enumKids; if (FAILED(frame->childFrames(&enumKids))) return; @@ -481,7 +481,7 @@ static wstring dumpFramesAsText(IWebFrame* frame) SysFreeString(innerText); - if (::gLayoutTestController->dumpChildFramesAsText()) { + if (::gTestRunner->dumpChildFramesAsText()) { COMPtr<IEnumVARIANT> enumKids; if (FAILED(frame->childFrames(&enumKids))) return L""; @@ -713,8 +713,8 @@ void dump() if (SUCCEEDED(dataSource->response(&response)) && response) { BSTR mimeType; if (SUCCEEDED(response->MIMEType(&mimeType)) && !_tcscmp(mimeType, TEXT("text/plain"))) { - ::gLayoutTestController->setDumpAsText(true); - ::gLayoutTestController->setGeneratePixelResults(false); + ::gTestRunner->setDumpAsText(true); + ::gTestRunner->setGeneratePixelResults(false); } SysFreeString(mimeType); } @@ -726,18 +726,18 @@ void dump() ::InvalidateRect(webViewWindow, 0, TRUE); ::SendMessage(webViewWindow, WM_PAINT, 0, 0); - if (::gLayoutTestController->dumpAsText()) { + if (::gTestRunner->dumpAsText()) { wstring result = dumpFramesAsText(frame); resultString = SysAllocStringLen(result.data(), result.size()); } else { COMPtr<IWebFramePrivate> framePrivate; if (FAILED(frame->QueryInterface(&framePrivate))) goto fail; - framePrivate->renderTreeAsExternalRepresentation(gLayoutTestController->isPrinting(), &resultString); + framePrivate->renderTreeAsExternalRepresentation(gTestRunner->isPrinting(), &resultString); } if (!resultString) - printf("ERROR: nil result from %s", ::gLayoutTestController->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation"); + printf("ERROR: nil result from %s", ::gTestRunner->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation"); else { unsigned stringLength = SysStringLen(resultString); int bufferSize = ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, 0, 0, 0, 0); @@ -745,10 +745,10 @@ void dump() ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, buffer, bufferSize + 1, 0, 0); fwrite(buffer, 1, bufferSize, stdout); free(buffer); - if (!::gLayoutTestController->dumpAsText()) + if (!::gTestRunner->dumpAsText()) dumpFrameScrollPosition(frame); } - if (::gLayoutTestController->dumpBackForwardList()) + if (::gTestRunner->dumpBackForwardList()) dumpBackForwardListForAllWindows(); } @@ -760,10 +760,10 @@ void dump() } if (dumpPixelsForCurrentTest - && gLayoutTestController->generatePixelResults() - && !gLayoutTestController->dumpDOMAsWebArchive() - && !gLayoutTestController->dumpSourceAsWebArchive()) - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + && gTestRunner->generatePixelResults() + && !gTestRunner->dumpDOMAsWebArchive() + && !gTestRunner->dumpSourceAsWebArchive()) + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); printf("#EOF\n"); // terminate the (possibly empty) pixels block fflush(stdout); @@ -893,7 +893,7 @@ static void resetWebViewToConsistentStateBeforeTesting() if (SUCCEEDED(webView->preferences(&preferences))) resetDefaultsToConsistentValues(preferences.get()); - if (gLayoutTestController) { + if (gTestRunner) { JSGlobalContextRef context = frame->globalContext(); WebCoreTestSupport::resetInternalsObject(context); } @@ -934,15 +934,15 @@ static void resetWebViewToConsistentStateBeforeTesting() static void sizeWebViewForCurrentTest() { - bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos); + bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos); unsigned width; unsigned height; if (isSVGW3CTest) { width = 480; height = 360; } else { - width = LayoutTestController::maxViewWidth; - height = LayoutTestController::maxViewHeight; + width = TestRunner::maxViewWidth; + height = TestRunner::maxViewHeight; } ::SetWindowPos(webViewWindow, 0, 0, 0, width, height, SWP_NOMOVE); @@ -977,22 +977,22 @@ static void runTest(const string& inputLine) CFRelease(url); - ::gLayoutTestController = LayoutTestController::create(pathOrURL, command.expectedPixelHash); + ::gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash); done = false; topLoadingFrame = 0; sizeWebViewForCurrentTest(); - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); COMPtr<IWebView> webView; if (SUCCEEDED(frame->webView(&webView))) { COMPtr<IWebViewPrivate> viewPrivate; if (SUCCEEDED(webView->QueryInterface(&viewPrivate))) { if (shouldLogHistoryDelegates(pathOrURL.c_str())) { - gLayoutTestController->setDumpHistoryDelegateCallbacks(true); + gTestRunner->setDumpHistoryDelegateCallbacks(true); viewPrivate->setHistoryDelegate(sharedHistoryDelegate.get()); } else viewPrivate->setHistoryDelegate(0); @@ -1005,13 +1005,13 @@ static void runTest(const string& inputLine) resetWebViewToConsistentStateBeforeTesting(); if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(pathOrURL.c_str())) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); } if (shouldDumpAsText(pathOrURL.c_str())) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } prevTestBFItem = 0; @@ -1049,15 +1049,15 @@ static void runTest(const string& inputLine) } if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); } resetWebViewToConsistentStateBeforeTesting(); frame->stopLoading(); - if (::gLayoutTestController->closeRemainingWindowsWhenComplete()) { + if (::gTestRunner->closeRemainingWindowsWhenComplete()) { Vector<HWND> windows = openWindows(); unsigned size = windows.size(); for (unsigned i = 0; i < size; i++) { @@ -1073,7 +1073,7 @@ static void runTest(const string& inputLine) exit: SysFreeString(urlBStr); - ::gLayoutTestController.clear(); + ::gTestRunner.clear(); return; } @@ -1197,8 +1197,8 @@ WindowToWebViewMap& windowToWebViewMap() IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow) { - unsigned maxViewWidth = LayoutTestController::maxViewWidth; - unsigned maxViewHeight = LayoutTestController::maxViewHeight; + unsigned maxViewWidth = TestRunner::maxViewWidth; + unsigned maxViewHeight = TestRunner::maxViewHeight; HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT("DumpRenderTree"), WS_POPUP, -maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0); diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.vcproj b/Tools/DumpRenderTree/win/DumpRenderTree.vcproj index 7e242a1cd..cde6d5b0b 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.vcproj +++ b/Tools/DumpRenderTree/win/DumpRenderTree.vcproj @@ -438,15 +438,15 @@ > </File> <File - RelativePath="..\LayoutTestController.cpp" + RelativePath="..\TestRunner.cpp" > </File> <File - RelativePath="..\LayoutTestController.h" + RelativePath="..\TestRunner.h" > </File> <File - RelativePath=".\LayoutTestControllerWin.cpp" + RelativePath=".\TestRunnerWin.cpp" > </File> <File diff --git a/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj b/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj index 72050b14b..de8a1db62 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj +++ b/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj @@ -50,6 +50,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -111,6 +112,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -172,6 +174,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -233,6 +236,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -295,6 +299,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -356,6 +361,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" diff --git a/Tools/DumpRenderTree/win/EditingDelegate.cpp b/Tools/DumpRenderTree/win/EditingDelegate.cpp index d08db1430..0975c54d4 100644 --- a/Tools/DumpRenderTree/win/EditingDelegate.cpp +++ b/Tools/DumpRenderTree/win/EditingDelegate.cpp @@ -30,7 +30,7 @@ #include "EditingDelegate.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <WebCore/COMPtr.h> #include <wtf/Assertions.h> #include <wtf/Platform.h> @@ -128,7 +128,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldBeginEditingInDOMRange( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -145,7 +145,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldEndEditingInDOMRange( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -164,7 +164,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertNode( TEXT("WebViewInsertActionDropped"), }; - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n"), dumpPath(node), dump(range), insertactionstring[action]); return S_OK; @@ -188,7 +188,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertText( TEXT("WebViewInsertActionDropped"), }; - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n"), text ? text : TEXT(""), dump(range), insertactionstring[action]); *result = m_acceptsEditing; @@ -205,7 +205,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldDeleteDOMRange( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldDeleteDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -234,7 +234,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeSelectedDOMRange( TEXT("TRUE") }; - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n"), dump(currentRange), dump(proposedRange), affinitystring[selectionAffinity], boolstring[stillSelecting]); *result = m_acceptsEditing; @@ -252,7 +252,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldApplyStyle( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n"), TEXT("'style description'")/*[[style description] UTF8String]*/, dump(range)); *result = m_acceptsEditing; @@ -270,7 +270,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeTypingStyle( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n"), TEXT("'currentStyle description'"), TEXT("'proposedStyle description'")); *result = m_acceptsEditing; @@ -287,7 +287,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: doPlatformCommand:%s\n"), command ? command : TEXT("")); *result = m_acceptsEditing; @@ -297,7 +297,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing( /* [in] */ IWebNotification* notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT("")); @@ -309,7 +309,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT("")); @@ -321,7 +321,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidEndEditing:%s\n"), name ? name : TEXT("")); @@ -333,7 +333,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n"), name ? name : TEXT("")); @@ -345,7 +345,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidChangeSelection:%s\n"), name ? name : TEXT("")); diff --git a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp index dcf5da18c..28d1317a6 100644 --- a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp +++ b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp @@ -34,7 +34,7 @@ #include "DumpRenderTree.h" #include "EventSender.h" #include "GCController.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "TextInputController.h" #include "WebCoreTestSupport.h" #include "WorkQueueItem.h" @@ -122,7 +122,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didStartProvisionalLoadForFrame( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didStartProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); // Make sure we only set this once per test. If it gets cleared, and then set again, we might @@ -137,7 +137,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveServerRedirectForProvisio /* [in] */ IWebView *webView, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); return S_OK; @@ -148,7 +148,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailProvisionalLoadWithError( /* [in] */ IWebError *error, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailProvisionalLoadWithError\n", descriptionSuitableForTestResult(frame).c_str()); locationChangeDone(error, frame); @@ -159,7 +159,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCommitLoadForFrame( /* [in] */ IWebView *webView, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didCommitLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); COMPtr<IWebViewPrivate> webViewPrivate; @@ -176,10 +176,10 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveTitle( /* [in] */ BSTR title, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didReceiveTitle: %S\n", descriptionSuitableForTestResult(frame).c_str(), title); - if (::gLayoutTestController->dumpTitleChanges() && !done) + if (::gTestRunner->dumpTitleChanges() && !done) printf("TITLE CHANGED: %S\n", title ? title : L""); return S_OK; } @@ -188,7 +188,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didChangeIcons( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpIconChanges()) + if (!done && gTestRunner->dumpIconChanges()) printf("%s - didChangeIcons\n", descriptionSuitableForTestResult(frame).c_str()); return S_OK; @@ -201,7 +201,7 @@ void FrameLoadDelegate::processWork() return; // if we finish all the commands, we're ready to dump state - if (WorkQueue::shared()->processWork() && !::gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !::gTestRunner->waitToDump()) dump(); } @@ -240,7 +240,7 @@ void FrameLoadDelegate::locationChangeDone(IWebError*, IWebFrame* frame) topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); - if (::gLayoutTestController->waitToDump()) + if (::gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) { @@ -257,7 +257,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishLoadForFrame( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); locationChangeDone(0, frame); @@ -269,7 +269,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailLoadWithError( /* [in] */ IWebError* error, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailLoadWithError\n", descriptionSuitableForTestResult(frame).c_str()); locationChangeDone(error, frame); @@ -283,7 +283,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::willPerformClientRedirectToURL( /* [in] */ DATE fireDate, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - willPerformClientRedirectToURL: %S \n", descriptionSuitableForTestResult(frame).c_str(), urlSuitableForTestResult(std::wstring(url, ::SysStringLen(url))).c_str()); @@ -294,7 +294,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCancelClientRedirectForFrame( /* [in] */ IWebView *webView, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didCancelClientRedirectForFrame\n", descriptionSuitableForTestResult(frame).c_str()); return S_OK; @@ -360,7 +360,7 @@ void FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld(IWebFrame* f JSValueRef exception = 0; - ::gLayoutTestController->makeWindowObject(context, windowObject, &exception); + ::gTestRunner->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); m_gcController->makeWindowObject(context, windowObject, &exception); @@ -384,7 +384,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishDocumentLoadForFrame( /* [in] */ IWebView *sender, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); if (!done) { @@ -408,7 +408,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didHandleOnloadEventsForFrame( /* [in] */ IWebView *sender, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didHandleOnloadEventsForFrame\n", descriptionSuitableForTestResult(frame).c_str()); @@ -425,7 +425,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFirstVisuallyNonEmptyLayoutInFra HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didDisplayInsecureContent( /* [in] */ IWebView *sender) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didDisplayInsecureContent\n"); return S_OK; @@ -435,7 +435,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didRunInsecureContent( /* [in] */ IWebView *sender, /* [in] */ IWebSecurityOrigin *origin) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didRunInsecureContent\n"); return S_OK; diff --git a/Tools/DumpRenderTree/win/HistoryDelegate.cpp b/Tools/DumpRenderTree/win/HistoryDelegate.cpp index 8a41facfc..ab92b0928 100644 --- a/Tools/DumpRenderTree/win/HistoryDelegate.cpp +++ b/Tools/DumpRenderTree/win/HistoryDelegate.cpp @@ -28,7 +28,7 @@ #include "DumpRenderTree.h" #include "DumpRenderTreeWin.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <string> #include <WebKit/WebKit.h> @@ -80,7 +80,7 @@ ULONG HistoryDelegate::Release(void) // IWebHistoryDelegate HRESULT HistoryDelegate::didNavigateWithNavigationData(IWebView* webView, IWebNavigationData* navigationData, IWebFrame* webFrame) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; BSTR urlBSTR; @@ -151,7 +151,7 @@ HRESULT HistoryDelegate::didNavigateWithNavigationData(IWebView* webView, IWebNa HRESULT HistoryDelegate::didPerformClientRedirectFromURL(IWebView*, BSTR sourceURL, BSTR destinationURL, IWebFrame*) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; wstring source; @@ -168,7 +168,7 @@ HRESULT HistoryDelegate::didPerformClientRedirectFromURL(IWebView*, BSTR sourceU HRESULT HistoryDelegate::didPerformServerRedirectFromURL(IWebView* webView, BSTR sourceURL, BSTR destinationURL, IWebFrame* webFrame) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; wstring source; @@ -185,7 +185,7 @@ HRESULT HistoryDelegate::didPerformServerRedirectFromURL(IWebView* webView, BSTR HRESULT HistoryDelegate::updateHistoryTitle(IWebView* webView, BSTR titleBSTR, BSTR urlBSTR) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; wstring url; @@ -202,7 +202,7 @@ HRESULT HistoryDelegate::updateHistoryTitle(IWebView* webView, BSTR titleBSTR, B HRESULT HistoryDelegate::populateVisitedLinksForWebView(IWebView* webView) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; BSTR urlBSTR; @@ -214,7 +214,7 @@ HRESULT HistoryDelegate::populateVisitedLinksForWebView(IWebView* webView) url = urlSuitableForTestResult(wstringFromBSTR(urlBSTR)); SysFreeString(urlBSTR); - if (gLayoutTestController->dumpVisitedLinksCallback()) + if (gTestRunner->dumpVisitedLinksCallback()) printf("Asked to populate visited links for WebView \"%S\"\n", url.c_str()); return S_OK; diff --git a/Tools/DumpRenderTree/win/PolicyDelegate.cpp b/Tools/DumpRenderTree/win/PolicyDelegate.cpp index 7d87c4539..5d7177e53 100644 --- a/Tools/DumpRenderTree/win/PolicyDelegate.cpp +++ b/Tools/DumpRenderTree/win/PolicyDelegate.cpp @@ -30,7 +30,7 @@ #include "PolicyDelegate.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <string> using std::wstring; diff --git a/Tools/DumpRenderTree/win/PolicyDelegate.h b/Tools/DumpRenderTree/win/PolicyDelegate.h index c808dc9c4..b6036fead 100644 --- a/Tools/DumpRenderTree/win/PolicyDelegate.h +++ b/Tools/DumpRenderTree/win/PolicyDelegate.h @@ -31,7 +31,7 @@ #include <WebKit/WebKit.h> -class LayoutTestController; +class TestRunner; class PolicyDelegate : public IWebPolicyDelegate { public: @@ -71,12 +71,12 @@ public: // PolicyDelegate void setPermissive(bool permissive) { m_permissiveDelegate = permissive; } - void setControllerToNotifyDone(LayoutTestController* controller) { m_controllerToNotifyDone = controller; } + void setControllerToNotifyDone(TestRunner* controller) { m_controllerToNotifyDone = controller; } private: ULONG m_refCount; bool m_permissiveDelegate; - LayoutTestController* m_controllerToNotifyDone; + TestRunner* m_controllerToNotifyDone; }; #endif // PolicyDelegate_h diff --git a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp index 26b722a4e..90b9ae0fc 100644 --- a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp +++ b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp @@ -30,7 +30,7 @@ #include "ResourceLoadDelegate.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <WebKit/WebKitCOMAPI.h> #include <comutil.h> #include <sstream> @@ -209,7 +209,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::identifierForInitialRequest( /* [in] */ IWebDataSource* dataSource, /* [in] */ unsigned long identifier) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { BSTR urlStr; if (FAILED(request->URL(&urlStr))) return E_FAIL; @@ -238,26 +238,26 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest( /* [in] */ IWebDataSource* dataSource, /* [retval][out] */ IWebURLRequest **newRequest) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - willSendRequest %S redirectResponse %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(request).c_str(), descriptionSuitableForTestResult(redirectResponse).c_str()); } - if (!done && !gLayoutTestController->deferMainResourceDataLoad()) { + if (!done && !gTestRunner->deferMainResourceDataLoad()) { COMPtr<IWebDataSourcePrivate> dataSourcePrivate(Query, dataSource); if (!dataSourcePrivate) return E_FAIL; dataSourcePrivate->setDeferMainResourceDataLoad(FALSE); } - if (!done && gLayoutTestController->willSendRequestReturnsNull()) { + if (!done && gTestRunner->willSendRequestReturnsNull()) { *newRequest = 0; return S_OK; } - if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && redirectResponse) { + if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && redirectResponse) { printf("Returning null for this redirect\n"); *newRequest = 0; return S_OK; @@ -265,7 +265,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest( IWebMutableURLRequest* requestCopy = 0; request->mutableCopy(&requestCopy); - const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders(); + const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders(); for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) { BSTR bstrHeader = BSTRFromString(*header); requestCopy->setValue(0, bstrHeader); @@ -286,14 +286,14 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveAuthenticationChalleng if (!challenge || FAILED(challenge->sender(&sender))) return E_FAIL; - if (!gLayoutTestController->handlesAuthenticationChallenges()) { + if (!gTestRunner->handlesAuthenticationChallenges()) { printf("%S - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet\n", descriptionSuitableForTestResult(identifier).c_str()); sender->continueWithoutCredentialForAuthenticationChallenge(challenge); return S_OK; } - const char* user = gLayoutTestController->authenticationUsername().c_str(); - const char* password = gLayoutTestController->authenticationPassword().c_str(); + const char* user = gTestRunner->authenticationUsername().c_str(); + const char* password = gTestRunner->authenticationPassword().c_str(); printf("%S - didReceiveAuthenticationChallenge - Responding with %s:%s\n", descriptionSuitableForTestResult(identifier).c_str(), user, password); @@ -312,12 +312,12 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveResponse( /* [in] */ IWebURLResponse* response, /* [in] */ IWebDataSource* dataSource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - didReceiveResponse %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(response).c_str()); } - if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) { + if (!done && gTestRunner->dumpResourceResponseMIMETypes()) { BSTR mimeTypeBSTR; if (FAILED(response->MIMEType(&mimeTypeBSTR))) E_FAIL; @@ -344,7 +344,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFinishLoadingFromDataSource( /* [in] */ unsigned long identifier, /* [in] */ IWebDataSource* dataSource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - didFinishLoading\n", descriptionSuitableForTestResult(identifier).c_str()); } @@ -360,7 +360,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFailLoadingWithError( /* [in] */ IWebError* error, /* [in] */ IWebDataSource* dataSource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - didFailLoadingWithError: %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(error, identifier).c_str()); diff --git a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/Tools/DumpRenderTree/win/TestRunnerWin.cpp index ffc3d26dc..a2c15e30d 100644 --- a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/Tools/DumpRenderTree/win/TestRunnerWin.cpp @@ -27,7 +27,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "DumpRenderTree.h" #include "EditingDelegate.h" @@ -42,8 +42,8 @@ #include <WebKit/WebKit.h> #include <WebKit/WebKitCOMAPI.h> #include <comutil.h> -#include <shlwapi.h> #include <shlguid.h> +#include <shlwapi.h> #include <shobjidl.h> #include <string> #include <wtf/Assertions.h> @@ -56,7 +56,7 @@ using std::wstring; static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath); -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -79,12 +79,12 @@ LayoutTestController::~LayoutTestController() editingDelegate->setAcceptsEditing(TRUE); } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { // FIXME: Implement! } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -110,7 +110,7 @@ void LayoutTestController::clearBackForwardList() backForwardList->goToItem(item.get()); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -125,19 +125,19 @@ bool LayoutTestController::callShouldCloseOnWebView() return result; } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { // FIXME: Implement! return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { // FIXME: Implement! return 0; } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -150,17 +150,17 @@ void LayoutTestController::disableImageLoading() preferences->setLoadsImagesAutomatically(FALSE); } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { COMPtr<IWebHistory> history; if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history)))) @@ -173,13 +173,13 @@ void LayoutTestController::keepWebHistory() history->setOptionalSharedHistory(sharedHistory.get()); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { // FIXME: Implement this. return JSValueMakeUndefined(context); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -194,7 +194,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const return textValueJS; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -221,7 +221,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -232,7 +232,7 @@ void LayoutTestController::waitForPolicyDelegate() webView->setPolicyDelegate(policyDelegate); } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { COMPtr<IWebHistory> history; if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history)))) @@ -253,7 +253,7 @@ size_t LayoutTestController::webHistoryItemCount() return count; } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { COMPtr<IWebWorkersPrivate> workers; if (FAILED(WebKitCreateInstance(CLSID_WebWorkersPrivate, 0, __uuidof(workers), reinterpret_cast<void**>(&workers)))) @@ -264,13 +264,13 @@ unsigned LayoutTestController::workerThreadCount() const return count; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() const +JSRetainPtr<JSStringRef> TestRunner::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win")); return platformName; } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { // Same as on mac. This can be shared. if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) @@ -278,7 +278,7 @@ void LayoutTestController::notifyDone() m_waitToDump = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) { wstring input(JSStringGetCharactersPtr(url), JSStringGetLength(url)); @@ -301,7 +301,7 @@ static wstring jsStringRefToWString(JSStringRef jsStr) return buffer.data(); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { COMPtr<IWebDataSource> dataSource; if (FAILED(frame->dataSource(&dataSource))) @@ -329,7 +329,7 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -347,7 +347,7 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing) editingDelegate->setAcceptsEditing(acceptsEditing); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { if (alwaysAcceptCookies == m_alwaysAcceptCookies) return; @@ -357,7 +357,7 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) m_alwaysAcceptCookies = alwaysAcceptCookies; } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -374,7 +374,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) prefsPrivate->setAuthorAndUserStylesEnabled(flag); } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -395,7 +395,7 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb autofillElement->setAutofilled(autofilled); } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -408,55 +408,55 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis webView->setPolicyDelegate(0); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { // FIXME: Implement for DeviceOrientation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=30335. } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { // FIXME: Implement for Geolocation layout tests. setGeolocationPermissionCommon(allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { // FIXME: Implement for Geolocation layout tests. return -1; } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) { // See also <rdar://problem/6480108> COMPtr<IWebIconDatabase> iconDatabase; @@ -469,12 +469,12 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) iconDatabase->setEnabled(iconDatabaseEnabled); } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { // FIXME: Implement! } -void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) +void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -487,7 +487,7 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled preferences->setPrivateBrowsingEnabled(privateBrowsingEnabled); } -void LayoutTestController::setXSSAuditorEnabled(bool enabled) +void TestRunner::setXSSAuditorEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -504,7 +504,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled) prefsPrivate->setXSSAuditorEnabled(enabled); } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -521,12 +521,12 @@ void LayoutTestController::setFrameFlatteningEnabled(bool enabled) prefsPrivate->setFrameFlatteningEnabled(enabled); } -void LayoutTestController::setSpatialNavigationEnabled(bool enabled) +void TestRunner::setSpatialNavigationEnabled(bool enabled) { // FIXME: Implement for SpatialNavigation layout tests. } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -543,7 +543,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) prefsPrivate->setAllowUniversalAccessFromFileURLs(enabled); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -560,7 +560,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) prefsPrivate->setAllowFileAccessFromFileURLs(enabled); } -void LayoutTestController::setPopupBlockingEnabled(bool enabled) +void TestRunner::setPopupBlockingEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -573,12 +573,12 @@ void LayoutTestController::setPopupBlockingEnabled(bool enabled) preferences->setJavaScriptCanOpenWindowsAutomatically(!enabled); } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { // FIXME: Implement } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -595,7 +595,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) prefsPrivate->setJavaScriptCanAccessClipboard(enabled); } -void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle) +void TestRunner::setTabKeyCyclesThroughElements(bool shouldCycle) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -608,12 +608,12 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle) viewPrivate->setTabKeyCyclesThroughElements(shouldCycle ? TRUE : FALSE); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { // FIXME: Implement! } -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -623,7 +623,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool flag) if (FAILED(webView->preferences(&preferences))) return; - preferences->setUserStyleSheetEnabled(flag); + preferences->setUserStyleSheetEnabled(flag); } bool appendComponentToPath(wstring& path, const wstring& component) @@ -681,7 +681,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath) { wstring fileProtocol = L"file://"; bool isFileProtocol = cygwinPath.find(fileProtocol) != string::npos; - if (cygwinPath[isFileProtocol ? 7 : 0] != '/') // ensure path is absolute + if (cygwinPath[isFileProtocol ? 7 : 0] != '/') // ensure path is absolute return false; // Get the Root path. @@ -733,7 +733,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath) return true; } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setUserStyleSheetLocation(JSStringRef jsURL) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -777,7 +777,7 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL) SysFreeString(resultPathBSTR); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -800,23 +800,23 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef elem domInputElement->setValueForUser(valueBSTR); } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { // FIXME: implement } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) { RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL)); ::setPersistentUserStyleSheetLocation(urlString.get()); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { ::setPersistentUserStyleSheetLocation(0); } -void LayoutTestController::setWindowIsKey(bool flag) +void TestRunner::setWindowIsKey(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -833,7 +833,7 @@ void LayoutTestController::setWindowIsKey(bool flag) ::SendMessage(webViewWindow, flag ? WM_SETFOCUS : WM_KILLFOCUS, (WPARAM)::GetDesktopWindow(), 0); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -846,7 +846,7 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) viewEditing->setSmartInsertDeleteEnabled(flag ? TRUE : FALSE); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -863,22 +863,22 @@ static const CFTimeInterval waitToDumpWatchdogInterval = 30.0; static void CALLBACK waitUntilDoneWatchdogFired(HWND, UINT, UINT_PTR, DWORD) { - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { m_waitToDump = waitUntilDone; if (m_waitToDump && !waitToDumpWatchdog) waitToDumpWatchdog = SetTimer(0, 0, waitToDumpWatchdogInterval * 1000, waitUntilDoneWatchdogFired); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return openWindows().size(); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { COMPtr<IDOMDocument> document; if (FAILED(frame->DOMDocument(&document))) @@ -904,7 +904,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef i return autoCompletes; } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { wstring wName = jsStringRefToWString(name); wstring wValue = jsStringRefToWString(value); @@ -925,51 +925,51 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) SysFreeString(valueBSTR); } -bool LayoutTestController::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */) +bool TestRunner::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */) { // FIXME: Implement return false; } -void LayoutTestController::setCacheModel(int) +void TestRunner::setCacheModel(int) { // FIXME: Implement } -bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) +bool TestRunner::isCommandEnabled(JSStringRef /*name*/) { - printf("ERROR: LayoutTestController::isCommandEnabled() not implemented\n"); + printf("ERROR: TestRunner::isCommandEnabled() not implemented\n"); return false; } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { // FIXME: Implement to support application cache quotas. } -void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef origin) +void TestRunner::clearApplicationCacheForOrigin(JSStringRef origin) { // FIXME: Implement to support deleting all application cache for an origin. } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { // FIXME: Implement to support application cache quotas. } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that have application caches. return JSValueMakeUndefined(context); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name) { // FIXME: Implement to get disk usage by all application caches for an origin. return 0; } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { COMPtr<IWebDatabaseManager> databaseManager; COMPtr<IWebDatabaseManager> tmpDatabaseManager; @@ -981,7 +981,7 @@ void LayoutTestController::clearAllDatabases() databaseManager->deleteAllDatabases(); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1002,7 +1002,7 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value SysFreeString(valueBSTR); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { COMPtr<IWebDatabaseManager> databaseManager; COMPtr<IWebDatabaseManager> tmpDatabaseManager; @@ -1015,17 +1015,17 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota) databaseManager->setQuota(TEXT("file:///"), quota); } -void LayoutTestController::goBack() +void TestRunner::goBack() { // FIXME: implement to enable loader/navigation-while-deferring-loads.html } -void LayoutTestController::setDefersLoading(bool) +void TestRunner::setDefersLoading(bool) { // FIXME: implement to enable loader/navigation-while-deferring-loads.html } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1036,12 +1036,12 @@ void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidd SysFreeString(schemeBSTR); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { - printf("ERROR: LayoutTestController::setAppCacheMaximumSize() not implemented\n"); + printf("ERROR: TestRunner::setAppCacheMaximumSize() not implemented\n"); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { COMPtr<IDOMDocument> document; if (FAILED(frame->DOMDocument(&document))) @@ -1066,7 +1066,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return SUCCEEDED(hr) && wasRunning; } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { COMPtr<IDOMDocument> document; if (FAILED(frame->DOMDocument(&document))) @@ -1091,7 +1091,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return SUCCEEDED(hr) && wasRunning; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1110,7 +1110,7 @@ static _bstr_t bstrT(JSStringRef jsString) return _bstr_t(JSStringCopyBSTR(jsString), false); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1119,7 +1119,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi webView->addOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1128,12 +1128,12 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr webView->removeOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains); } -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) { // FIXME: implement } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1147,7 +1147,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1160,7 +1160,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0); } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1177,12 +1177,12 @@ void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) prefsPrivate->setDeveloperExtrasEnabled(enabled); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1197,7 +1197,7 @@ void LayoutTestController::showWebInspector() inspector->show(); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1214,7 +1214,7 @@ void LayoutTestController::closeWebInspector() inspector->close(); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1253,12 +1253,12 @@ unsigned worldIDForWorld(IWebScriptWorld* world) return 0; } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1283,7 +1283,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj SysFreeString(result); } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { COMPtr<IWebHistory> history; if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history)))) @@ -1300,7 +1300,7 @@ void LayoutTestController::removeAllVisitedLinks() sharedHistoryPrivate->removeAllVisitedLinks(); } -int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) +int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1312,24 +1312,24 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh return pageNumber; } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { // FIXME: Implement this. return JSRetainPtr<JSStringRef>(); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { // FIXME: implement return JSRetainPtr<JSStringRef>(); } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1347,56 +1347,56 @@ void LayoutTestController::apiTestGoToCurrentBackForwardItem() webView->goToBackForwardItem(item.get(), &success); } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { } -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { } -void LayoutTestController::setSerializeHTTPLoads(bool) +void TestRunner::setSerializeHTTPLoads(bool) { // FIXME: Implement. } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { // FIXME: Implement. } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { // FIXME: Implement. } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { // FIXME: Implement. } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { // FIXME: Implement. return JSValueMakeUndefined(context); } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) { // FIXME: Implement to support getting local storage disk usage for an origin. return 0; } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) { // FIXME: Implement. } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1409,7 +1409,7 @@ void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) viewPrivate->setMinimumTimerInterval(minimumTimerInterval); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1418,53 +1418,53 @@ void LayoutTestController::setTextDirection(JSStringRef direction) framePrivate->setTextDirection(bstrT(direction).GetBSTR()); } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { // FIXME: Implement. } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement this. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement this. } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::setStorageDatabaseIdleInterval(double) +void TestRunner::setStorageDatabaseIdleInterval(double) { // FIXME: Implement this. } diff --git a/Tools/DumpRenderTree/win/UIDelegate.cpp b/Tools/DumpRenderTree/win/UIDelegate.cpp index 6eb880c2c..fd6a8f842 100644 --- a/Tools/DumpRenderTree/win/UIDelegate.cpp +++ b/Tools/DumpRenderTree/win/UIDelegate.cpp @@ -32,9 +32,8 @@ #include "DumpRenderTree.h" #include "DraggingInfo.h" #include "EventSender.h" -#include "LayoutTestController.h" #include "DRTDesktopNotificationPresenter.h" - +#include "TestRunner.h" #include <WebCore/COMPtr.h> #include <wtf/Assertions.h> #include <wtf/PassOwnPtr.h> @@ -472,7 +471,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::runBeforeUnloadConfirmPanelWithMessage( if (!result) return E_POINTER; printf("CONFIRM NAVIGATION: %S\n", message ? message : L""); - *result = !gLayoutTestController->shouldStayOnPageAfterHandlingBeforeUnload(); + *result = !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload(); return S_OK; } @@ -537,7 +536,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::createWebViewWithRequest( /* [in] */ IWebURLRequest *request, /* [retval][out] */ IWebView **newWebView) { - if (!::gLayoutTestController->canOpenWindows()) + if (!::gTestRunner->canOpenWindows()) return E_FAIL; *newWebView = createWebViewAndOffscreenWindow(); return S_OK; @@ -588,7 +587,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::exceededDatabaseQuota( origin->host(&host); origin->port(&port); - if (!done && gLayoutTestController->dumpDatabaseCallbacks()) + if (!done && gTestRunner->dumpDatabaseCallbacks()) printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%S, %S, %i} database:%S\n", protocol, host, port, databaseIdentifier); SysFreeString(protocol); @@ -633,7 +632,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewDidInvalidate( HRESULT STDMETHODCALLTYPE UIDelegate::setStatusText(IWebView*, BSTR text) { - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text ? toUTF8(text).c_str() : ""); return S_OK; } diff --git a/Tools/DumpRenderTree/wscript b/Tools/DumpRenderTree/wscript index b32929450..b1a0356fa 100644 --- a/Tools/DumpRenderTree/wscript +++ b/Tools/DumpRenderTree/wscript @@ -41,10 +41,10 @@ include_paths = [ ] sources = [ 'DumpRenderTreeCommon.cpp', - 'LayoutTestController.cpp', + 'TestRunner.cpp', 'WorkQueue.cpp', 'wx/DumpRenderTreeWx.cpp', - 'wx/LayoutTestControllerWx.cpp', + 'wx/TestRunnerWx.cpp', 'wx/WorkQueueItemWx.cpp' ] diff --git a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp index 45b852d88..0f8788504 100644 --- a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp +++ b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp @@ -29,7 +29,7 @@ #include "config.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "WorkQueue.h" #include "WorkQueueItem.h" @@ -59,7 +59,7 @@ using namespace WebKit; FILE* logOutput; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; static WebView* webView; static wxTimer* idleTimer; @@ -95,7 +95,7 @@ public: if (event.GetState() == WEBVIEW_LOAD_ONLOAD_HANDLED) { done = true; - if (!gLayoutTestController->waitToDump() || notified) { + if (!gTestRunner->waitToDump() || notified) { dump(); } } @@ -128,14 +128,14 @@ public: void OnReceivedTitleEvent(WebViewReceivedTitleEvent& event) { - if (gLayoutTestController->dumpTitleChanges() && !done) + if (gTestRunner->dumpTitleChanges() && !done) wxFprintf(stdout, "TITLE CHANGED: %S\n", event.GetTitle()); } void OnWindowObjectClearedEvent(WebViewWindowObjectClearedEvent& event) { JSValueRef exception = 0; - gLayoutTestController->makeWindowObject(event.GetJSContext(), event.GetWindowObject(), &exception); + gTestRunner->makeWindowObject(event.GetJSContext(), event.GetWindowObject(), &exception); } private: @@ -155,7 +155,7 @@ LayoutWebViewEventHandler* eventHandler = 0; static wxString dumpFramesAsText(WebFrame* frame) { // TODO: implement this. leaving this here so we don't forget this case. - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { } return frame->GetInnerText(); @@ -166,15 +166,15 @@ void dump() if (!done) return; - if (gLayoutTestController->waitToDump() && !notified) + if (gTestRunner->waitToDump() && !notified) return; if (dumpTree) { const char* result = 0; - bool dumpAsText = gLayoutTestController->dumpAsText(); + bool dumpAsText = gTestRunner->dumpAsText(); wxString str; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) str = dumpFramesAsText(webView->GetMainFrame()); else str = webView->GetMainFrame()->GetExternalRepresentation(); @@ -182,7 +182,7 @@ void dump() result = str.ToUTF8(); if (!result) { const char* errorMessage; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) errorMessage = "WebFrame::GetInnerText"; else errorMessage = "WebFrame::GetExternalRepresentation"; @@ -191,7 +191,7 @@ void dump() printf("%s\n", result); } - if (gLayoutTestController->dumpBackForwardList()) { + if (gTestRunner->dumpBackForwardList()) { // FIXME: not implemented } @@ -204,9 +204,9 @@ void dump() } if (dumpPixelsForCurrentTest - && gLayoutTestController->generatePixelResults() - && !gLayoutTestController->dumpDOMAsWebArchive() - && !gLayoutTestController->dumpSourceAsWebArchive()) { + && gTestRunner->generatePixelResults() + && !gTestRunner->dumpDOMAsWebArchive() + && !gTestRunner->dumpSourceAsWebArchive()) { // FIXME: Add support for dumping pixels fflush(stdout); } @@ -215,7 +215,7 @@ void dump() fflush(stdout); fflush(stderr); - gLayoutTestController.clear(); + gTestRunner.clear(); } static void runTest(const wxString inputLine) @@ -232,8 +232,8 @@ static void runTest(const wxString inputLine) if (http == string::npos) pathOrURL.insert(0, "file://"); - gLayoutTestController = LayoutTestController::create(pathOrURL, command.expectedPixelHash); - if (!gLayoutTestController) { + gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash); + if (!gTestRunner) { wxTheApp->ExitMainLoop(); } diff --git a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp deleted file mode 100644 index fef8f4b09..000000000 --- a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/* - * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com> - * - * 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 "LayoutTestController.h" - -#include "DumpRenderTree.h" -#include "WorkQueue.h" -#include "WorkQueueItem.h" -#include <JavaScriptCore/JSRetainPtr.h> -#include <JavaScriptCore/JSStringRef.h> - -#include <stdio.h> - - - -LayoutTestController::~LayoutTestController() -{ - // FIXME: implement -} - -void LayoutTestController::addDisallowedURL(JSStringRef url) -{ - // FIXME: implement -} - -void LayoutTestController::clearBackForwardList() -{ -} - -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) -{ - // FIXME: implement - return 0; -} - -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) -{ - // FIXME: implement - return 0; -} - -void LayoutTestController::dispatchPendingLoadRequests() -{ - // FIXME: Implement for testing fix for 6727495 -} - -void LayoutTestController::display() -{ -} - -void LayoutTestController::keepWebHistory() -{ - // FIXME: implement -} - -void LayoutTestController::notifyDone() -{ - if (m_waitToDump && !WorkQueue::shared()->count()) - notifyDoneFired(); - m_waitToDump = false; -} - -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) -{ - // Function introduced in r28690. This may need special-casing on Windows. - return JSStringRetain(url); // Do nothing on Unix. -} - -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) -{ - // FIXME: We need to resolve relative URLs here - WorkQueue::shared()->queue(new LoadItem(url, target)); -} - -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) -{ -} - -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) -{ - // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp). -} - -void LayoutTestController::setCustomPolicyDelegate(bool, bool) -{ - // FIXME: implement -} - -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) -{ - // FIXME: implement -} - -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setUserStyleSheetEnabled(bool flag) -{ -} - -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) -{ -} - -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) -{ - // FIXME: implement -} - -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) -{ - // FIXME: implement -} - -void LayoutTestController::setWindowIsKey(bool windowIsKey) -{ - // FIXME: implement -} - -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setWaitToDump(bool waitUntilDone) -{ - static const int timeoutSeconds = 10; - - m_waitToDump = waitUntilDone; -} - -int LayoutTestController::windowCount() -{ - // FIXME: implement - return 1; -} - -void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) -{ - // FIXME: implement -} - -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setXSSAuditorEnabled(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled) -{ - // FIXME: implement -} - -void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) -{ - // FIXME: implement -} - -void LayoutTestController::setPluginsEnabled(bool flag) -{ - // FIXME: Implement -} - -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) -{ - // FIXME: implement - return false; -} - -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) -{ - // FIXME: implement -} - -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) -{ - // FIXME: implement -} - -void LayoutTestController::clearPersistentUserStyleSheet() -{ - // FIXME: implement -} - -void LayoutTestController::clearAllApplicationCaches() -{ - // FIXME: Implement to support application cache quotas. -} - -void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url) -{ - // FIXME: Implement to support deleting all application cache for an origin. -} - -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) -{ - // FIXME: Implement to support getting disk usage in bytes for an origin. - return 0; -} - -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) -{ - // FIXME: Implement to support application cache quotas. -} - -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin) -{ - // FIXME: Implement to support getting disk usage by all application caches for an origin. - return 0; -} - - -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) -{ - // FIXME: Implement to get origins that have application caches. - return 0; -} - -void LayoutTestController::clearAllDatabases() -{ - // FIXME: implement -} - -void LayoutTestController::setDatabaseQuota(unsigned long long quota) -{ - // FIXME: implement -} - -void LayoutTestController::goBack() -{ - // FIXME: implement to enable loader/navigation-while-deferring-loads.html -} - -void LayoutTestController::setDefersLoading(bool) -{ - // FIXME: implement to enable loader/navigation-while-deferring-loads.html -} - -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef) -{ - // FIXME: implement -} - -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) -{ - // FIXME: implement -} - -unsigned LayoutTestController::numberOfActiveAnimations() const -{ - // FIXME: implement - return 0; -} - -unsigned LayoutTestController::workerThreadCount() const -{ - // FIXME: implement - return 0; -} - -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) -{ - // FIXME: implement -} - -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) -{ - // FIXME: implement - return false; -} - -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) -{ - // FIXME: Implement for DeviceOrientation layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=30335. -} - -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) -{ - // FIXME: Implement for Geolocation layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=28264. -} - -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) -{ - // FIXME: Implement for Geolocation layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=28264. -} - -void LayoutTestController::setGeolocationPermission(bool allow) -{ - // FIXME: Implement for Geolocation layout tests. - setGeolocationPermissionCommon(allow); -} - -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() -{ - // FIXME: Implement for Geolocation layout tests. - return -1; -} - -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) -{ - // FIXME: Implement for speech input layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=39485. -} - -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) -{ - // FIXME: Implement for speech input layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=39485. -} - -void LayoutTestController::startSpeechInput(JSContextRef inputElement) -{ - // FIXME: Implement for speech input layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=39485. -} - -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) -{ - // FIXME: implement -} - -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) -{ - // FIXME: implement - return false; -} - -void LayoutTestController::setCacheModel(int) -{ - // FIXME: implement -} - -bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) -{ - // FIXME: implement - return false; -} - -size_t LayoutTestController::webHistoryItemCount() -{ - // FIXME: implement - return 0; -} - -void LayoutTestController::waitForPolicyDelegate() -{ - // FIXME: Implement this. -} - -void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef /* value */) -{ - // FIXME: implement -} - -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) -{ - printf("LayoutTestController::addUserScript not implemented.\n"); -} - -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) -{ - printf("LayoutTestController::addUserStyleSheet not implemented.\n"); -} - -void LayoutTestController::showWebInspector() -{ - // FIXME: Implement this. -} - -void LayoutTestController::closeWebInspector() -{ - // FIXME: Implement this. -} - -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) -{ - // FIXME: Implement this. -} - -void LayoutTestController::removeAllVisitedLinks() -{ - // FIXME: Implement this. -} - -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) -{ - -} - -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) -{ - -} - -void LayoutTestController::disableImageLoading() -{ - -} - -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) -{ - // FIXME: implement -} - -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) -{ - // FIXME: implement -} - -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) -{ - // FIXME: implement -} - -int LayoutTestController::numberOfPages(float, float) -{ - // FIXME: implement - return -1; -} - -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) -{ - -} - -void LayoutTestController::apiTestGoToCurrentBackForwardItem() -{ - -} - -void LayoutTestController::setSpatialNavigationEnabled(bool) -{ - -} - -void LayoutTestController::setWebViewEditable(bool) -{ -} - -bool LayoutTestController::callShouldCloseOnWebView() -{ - return false; -} - -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const -{ - return 0; -} - -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const -{ - return 0; -} - -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef) -{ - return 0; -} - -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) -{ -} - -void LayoutTestController::abortModal() -{ -} - -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const -{ - // FIXME: Implement - return 0; -} - -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const -{ - // FIXME: Implement - return 0; -} - -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) -{ - // FIXME: Implement this. -} - -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) -{ - // FIXME: Implement - return false; -} - -void LayoutTestController::setSerializeHTTPLoads(bool) -{ - // FIXME: Implement. -} - -void LayoutTestController::setMinimumTimerInterval(double interval) { - -} - -void LayoutTestController::syncLocalStorage() -{ - // FIXME: Implement. -} - -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) -{ - // FIXME: Implement. -} - -void LayoutTestController::deleteAllLocalStorage() -{ - // FIXME: Implement. -} - -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) -{ - // FIXME: Implement. - return 0; -} - -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) -{ - // FIXME: Implement. -} - -void LayoutTestController::setTextDirection(JSStringRef direction) -{ - // FIXME: Implement. -} - -void LayoutTestController::addChromeInputField() -{ -} - -void LayoutTestController::removeChromeInputField() -{ -} - -void LayoutTestController::focusWebView() -{ -} - -void LayoutTestController::setBackingScaleFactor(double) -{ -} - -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) -{ - // FIXME: Implement. -} - -void LayoutTestController::resetPageVisibility() -{ - // FIXME: Implement this. -} - -void LayoutTestController::setPageVisibility(const char*) -{ - // FIXME: Implement this. -} - -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) -{ - // FIXME: Implement this. -} - -void LayoutTestController::sendWebIntentResponse(JSStringRef) -{ - // FIXME: Implement this. -} - -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) -{ - // FIXME: Implement this. -} - -void LayoutTestController::setStorageDatabaseIdleInterval(double) -{ - // FIXME: Implement this. -} diff --git a/Tools/DumpRenderTree/wx/TestRunnerWx.cpp b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp new file mode 100644 index 000000000..ee09cb0cc --- /dev/null +++ b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp @@ -0,0 +1,641 @@ +/* + * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com> + * + * 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 "TestRunner.h" + +#include "DumpRenderTree.h" +#include "WorkQueue.h" +#include "WorkQueueItem.h" +#include <JavaScriptCore/JSRetainPtr.h> +#include <JavaScriptCore/JSStringRef.h> + +#include <stdio.h> + + + +TestRunner::~TestRunner() +{ + // FIXME: implement +} + +void TestRunner::addDisallowedURL(JSStringRef url) +{ + // FIXME: implement +} + +void TestRunner::clearBackForwardList() +{ +} + +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) +{ + // FIXME: implement + return 0; +} + +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) +{ + // FIXME: implement + return 0; +} + +void TestRunner::dispatchPendingLoadRequests() +{ + // FIXME: Implement for testing fix for 6727495 +} + +void TestRunner::display() +{ +} + +void TestRunner::keepWebHistory() +{ + // FIXME: implement +} + +void TestRunner::notifyDone() +{ + if (m_waitToDump && !WorkQueue::shared()->count()) + notifyDoneFired(); + m_waitToDump = false; +} + +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) +{ + // Function introduced in r28690. This may need special-casing on Windows. + return JSStringRetain(url); // Do nothing on Unix. +} + +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) +{ + // FIXME: We need to resolve relative URLs here + WorkQueue::shared()->queue(new LoadItem(url, target)); +} + +void TestRunner::setAcceptsEditing(bool acceptsEditing) +{ +} + +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +{ + // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp). +} + +void TestRunner::setCustomPolicyDelegate(bool, bool) +{ + // FIXME: implement +} + +void TestRunner::setMainFrameIsFirstResponder(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) +{ + // FIXME: implement +} + +void TestRunner::setUseDashboardCompatibilityMode(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setUserStyleSheetEnabled(bool flag) +{ +} + +void TestRunner::setUserStyleSheetLocation(JSStringRef path) +{ +} + +void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) +{ + // FIXME: implement +} + +void TestRunner::setViewModeMediaFeature(JSStringRef mode) +{ + // FIXME: implement +} + +void TestRunner::setWindowIsKey(bool windowIsKey) +{ + // FIXME: implement +} + +void TestRunner::setSmartInsertDeleteEnabled(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setWaitToDump(bool waitUntilDone) +{ + static const int timeoutSeconds = 10; + + m_waitToDump = waitUntilDone; +} + +int TestRunner::windowCount() +{ + // FIXME: implement + return 1; +} + +void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) +{ + // FIXME: implement +} + +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setXSSAuditorEnabled(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setFrameFlatteningEnabled(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled) +{ + // FIXME: implement +} + +void TestRunner::setPopupBlockingEnabled(bool popupBlockingEnabled) +{ + // FIXME: implement +} + +void TestRunner::setPluginsEnabled(bool flag) +{ + // FIXME: Implement +} + +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) +{ + // FIXME: implement + return false; +} + +void TestRunner::execCommand(JSStringRef name, JSStringRef value) +{ + // FIXME: implement +} + +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +{ + // FIXME: implement +} + +void TestRunner::clearPersistentUserStyleSheet() +{ + // FIXME: implement +} + +void TestRunner::clearAllApplicationCaches() +{ + // FIXME: Implement to support application cache quotas. +} + +void TestRunner::clearApplicationCacheForOrigin(JSStringRef url) +{ + // FIXME: Implement to support deleting all application cache for an origin. +} + +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) +{ + // FIXME: Implement to support getting disk usage in bytes for an origin. + return 0; +} + +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) +{ + // FIXME: Implement to support application cache quotas. +} + +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef origin) +{ + // FIXME: Implement to support getting disk usage by all application caches for an origin. + return 0; +} + + +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) +{ + // FIXME: Implement to get origins that have application caches. + return 0; +} + +void TestRunner::clearAllDatabases() +{ + // FIXME: implement +} + +void TestRunner::setDatabaseQuota(unsigned long long quota) +{ + // FIXME: implement +} + +void TestRunner::goBack() +{ + // FIXME: implement to enable loader/navigation-while-deferring-loads.html +} + +void TestRunner::setDefersLoading(bool) +{ + // FIXME: implement to enable loader/navigation-while-deferring-loads.html +} + +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef) +{ + // FIXME: implement +} + +void TestRunner::setAppCacheMaximumSize(unsigned long long size) +{ + // FIXME: implement +} + +unsigned TestRunner::numberOfActiveAnimations() const +{ + // FIXME: implement + return 0; +} + +unsigned TestRunner::workerThreadCount() const +{ + // FIXME: implement + return 0; +} + +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) +{ + // FIXME: implement +} + +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +{ + // FIXME: implement + return false; +} + +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +{ + // FIXME: Implement for DeviceOrientation layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=30335. +} + +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +{ + // FIXME: Implement for Geolocation layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=28264. +} + +void TestRunner::setMockGeolocationError(int code, JSStringRef message) +{ + // FIXME: Implement for Geolocation layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=28264. +} + +void TestRunner::setGeolocationPermission(bool allow) +{ + // FIXME: Implement for Geolocation layout tests. + setGeolocationPermissionCommon(allow); +} + +int TestRunner::numberOfPendingGeolocationPermissionRequests() +{ + // FIXME: Implement for Geolocation layout tests. + return -1; +} + +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + +void TestRunner::setMockSpeechInputDumpRect(bool flag) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + +void TestRunner::startSpeechInput(JSContextRef inputElement) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) +{ + // FIXME: implement +} + +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +{ + // FIXME: implement + return false; +} + +void TestRunner::setCacheModel(int) +{ + // FIXME: implement +} + +bool TestRunner::isCommandEnabled(JSStringRef /*name*/) +{ + // FIXME: implement + return false; +} + +size_t TestRunner::webHistoryItemCount() +{ + // FIXME: implement + return 0; +} + +void TestRunner::waitForPolicyDelegate() +{ + // FIXME: Implement this. +} + +void TestRunner::overridePreference(JSStringRef /* key */, JSStringRef /* value */) +{ + // FIXME: implement +} + +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +{ + printf("TestRunner::addUserScript not implemented.\n"); +} + +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) +{ + printf("TestRunner::addUserStyleSheet not implemented.\n"); +} + +void TestRunner::showWebInspector() +{ + // FIXME: Implement this. +} + +void TestRunner::closeWebInspector() +{ + // FIXME: Implement this. +} + +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) +{ + // FIXME: Implement this. +} + +void TestRunner::removeAllVisitedLinks() +{ + // FIXME: Implement this. +} + +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +{ + +} + +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +{ + +} + +void TestRunner::disableImageLoading() +{ + +} + +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +{ + // FIXME: implement +} + +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +{ + // FIXME: implement +} + +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +{ + // FIXME: implement +} + +int TestRunner::numberOfPages(float, float) +{ + // FIXME: implement + return -1; +} + +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +{ + +} + +void TestRunner::apiTestGoToCurrentBackForwardItem() +{ + +} + +void TestRunner::setSpatialNavigationEnabled(bool) +{ + +} + +void TestRunner::setWebViewEditable(bool) +{ +} + +bool TestRunner::callShouldCloseOnWebView() +{ + return false; +} + +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + return 0; +} + +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +{ + return 0; +} + +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef) +{ + return 0; +} + +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +{ +} + +void TestRunner::abortModal() +{ +} + +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const +{ + // FIXME: Implement + return 0; +} + +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +{ + // FIXME: Implement + return 0; +} + +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) +{ + // FIXME: Implement this. +} + +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +{ + // FIXME: Implement + return false; +} + +void TestRunner::setSerializeHTTPLoads(bool) +{ + // FIXME: Implement. +} + +void TestRunner::setMinimumTimerInterval(double interval) +{ + +} + +void TestRunner::syncLocalStorage() +{ + // FIXME: Implement. +} + +void TestRunner::observeStorageTrackerNotifications(unsigned number) +{ + // FIXME: Implement. +} + +void TestRunner::deleteAllLocalStorage() +{ + // FIXME: Implement. +} + +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) +{ + // FIXME: Implement. + return 0; +} + +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) +{ + // FIXME: Implement. +} + +void TestRunner::setTextDirection(JSStringRef direction) +{ + // FIXME: Implement. +} + +void TestRunner::addChromeInputField() +{ +} + +void TestRunner::removeChromeInputField() +{ +} + +void TestRunner::focusWebView() +{ +} + +void TestRunner::setBackingScaleFactor(double) +{ +} + +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) +{ + // FIXME: Implement. +} + +void TestRunner::resetPageVisibility() +{ + // FIXME: Implement this. +} + +void TestRunner::setPageVisibility(const char*) +{ + // FIXME: Implement this. +} + +void TestRunner::setAutomaticLinkDetectionEnabled(bool) +{ + // FIXME: Implement this. +} + +void TestRunner::sendWebIntentResponse(JSStringRef) +{ + // FIXME: Implement this. +} + +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +{ + // FIXME: Implement this. +} + +void TestRunner::setStorageDatabaseIdleInterval(double) +{ + // FIXME: Implement this. +} diff --git a/Tools/EWebLauncher/CMakeLists.txt b/Tools/EWebLauncher/CMakeLists.txt index f2c263f33..3c489a4fd 100644 --- a/Tools/EWebLauncher/CMakeLists.txt +++ b/Tools/EWebLauncher/CMakeLists.txt @@ -14,8 +14,8 @@ SET(EWebLauncher_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${SQLITE_LIBRARIES} - ${Glib_LIBRARIES} - ${LIBSOUP24_LIBRARIES} + ${GLIB_LIBRARIES} + ${LIBSOUP_LIBRARIES} ) SET(EWebLauncher_INCLUDE_DIRECTORIES @@ -24,8 +24,8 @@ SET(EWebLauncher_INCLUDE_DIRECTORIES ${EDJE_INCLUDE_DIRS} ${EFLDEPS_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} - ${Glib_INCLUDE_DIRS} - ${LIBSOUP24_INCLUDE_DIRS} + ${GLIB_INCLUDE_DIRS} + ${LIBSOUP_INCLUDE_DIRS} ) SET(EWebLauncher_LINK_FLAGS @@ -33,7 +33,6 @@ SET(EWebLauncher_LINK_FLAGS ${EDJE_LDFLAGS} ${EFLDEPS_LDFLAGS} ${EVAS_LDFLAGS} - ${LIBSOUP24_LDFLAGS} ) ADD_DEFINITIONS(-DDATA_DIR=\"${THEME_BINARY_DIR}\") diff --git a/Tools/GNUmakefile.am b/Tools/GNUmakefile.am index c1933565c..72ca88d7a 100644 --- a/Tools/GNUmakefile.am +++ b/Tools/GNUmakefile.am @@ -43,7 +43,7 @@ noinst_LTLIBRARIES += libWebCoreInternals.la libWebCoreInternals_la_SOURCES = \ Source/WebCore/bindings/js/JSDOMWrapper.cpp \ Source/WebCore/bindings/js/JSDOMWrapper.h \ - Source/WebCore/testing/FastMallocStatistics.h \ + Source/WebCore/testing/MallocStatistics.h \ Source/WebCore/testing/Internals.cpp \ Source/WebCore/testing/Internals.h \ Source/WebCore/testing/InternalSettings.cpp \ @@ -54,8 +54,8 @@ libWebCoreInternals_la_SOURCES = \ Source/WebCore/testing/js/WebCoreTestSupport.h libwebcoreinternals_built_sources += \ - DerivedSources/WebCore/JSFastMallocStatistics.cpp \ - DerivedSources/WebCore/JSFastMallocStatistics.h \ + DerivedSources/WebCore/JSMallocStatistics.cpp \ + DerivedSources/WebCore/JSMallocStatistics.h \ DerivedSources/WebCore/JSInternals.cpp \ DerivedSources/WebCore/JSInternals.h \ DerivedSources/WebCore/JSInternalSettings.cpp \ @@ -119,8 +119,8 @@ Programs_DumpRenderTree_SOURCES = \ Tools/DumpRenderTree/GCController.cpp \ Tools/DumpRenderTree/GCController.h \ Tools/DumpRenderTree/JavaScriptThreading.h \ - Tools/DumpRenderTree/LayoutTestController.cpp \ - Tools/DumpRenderTree/LayoutTestController.h \ + Tools/DumpRenderTree/TestRunner.cpp \ + Tools/DumpRenderTree/TestRunner.h \ Tools/DumpRenderTree/PixelDumpSupport.cpp \ Tools/DumpRenderTree/PixelDumpSupport.h \ Tools/DumpRenderTree/WorkQueue.cpp \ @@ -140,7 +140,7 @@ Programs_DumpRenderTree_SOURCES = \ Tools/DumpRenderTree/gtk/EventSender.h \ Tools/DumpRenderTree/gtk/EventSender.cpp \ Tools/DumpRenderTree/gtk/GCControllerGtk.cpp \ - Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp \ + Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp \ Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \ Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.cpp \ Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.h \ diff --git a/Tools/MIDLWrapper/MIDLWrapper.vcproj b/Tools/MIDLWrapper/MIDLWrapper.vcproj index d9ab9f93f..598f9ec68 100644 --- a/Tools/MIDLWrapper/MIDLWrapper.vcproj +++ b/Tools/MIDLWrapper/MIDLWrapper.vcproj @@ -60,6 +60,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" OutputFile="$(OutDir)\midl.exe" LinkIncremental="2" GenerateDebugInformation="true" @@ -134,6 +135,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" OutputFile="$(OutDir)\midl.exe" LinkIncremental="1" GenerateDebugInformation="true" diff --git a/Tools/MiniBrowser/efl/CMakeLists.txt b/Tools/MiniBrowser/efl/CMakeLists.txt index ae359a668..753c4495a 100644 --- a/Tools/MiniBrowser/efl/CMakeLists.txt +++ b/Tools/MiniBrowser/efl/CMakeLists.txt @@ -25,7 +25,7 @@ SET(MiniBrowser_LIBRARIES ${EFLDEPS_LIBRARIES} ${EVAS_LIBRARIES} ${FONTCONFIG_LIBRARIES} - ${LIBSOUP24_LIBRARIES} + ${LIBSOUP_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${OPENGL_LIBRARIES} @@ -37,13 +37,12 @@ SET(MiniBrowser_LINK_FLAGS ${EDJE_LDFLAGS} ${EFLDEPS_LDFLAGS} ${EVAS_LDFLAGS} - ${LIBSOUP24_LDFLAGS} ) IF (ENABLE_GLIB_SUPPORT) LIST(APPEND MiniBrowser_LIBRARIES - ${Glib_LIBRARIES} - ${Gthread_LIBRARIES} + ${GLIB_LIBRARIES} + ${GLIB_GTHREAD_LIBRARIES} ) ENDIF () diff --git a/Tools/MiniBrowser/mac/AppDelegate.m b/Tools/MiniBrowser/mac/AppDelegate.m index a620c798e..285736175 100644 --- a/Tools/MiniBrowser/mac/AppDelegate.m +++ b/Tools/MiniBrowser/mac/AppDelegate.m @@ -35,17 +35,17 @@ static NSString *defaultURL = @"http://www.webkit.org/"; @implementation BrowserAppDelegate -void didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo) +void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo) { CFStringRef cfMessageName = WKStringCopyCFString(0, messageName); WKTypeID typeID = WKGetTypeID(messageBody); if (typeID == WKStringGetTypeID()) { CFStringRef cfMessageBody = WKStringCopyCFString(0, (WKStringRef)messageBody); - LOG(@"ContextInjectedBundleClient - didRecieveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody); + LOG(@"ContextInjectedBundleClient - didReceiveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody); CFRelease(cfMessageBody); } else { - LOG(@"ContextInjectedBundleClient - didRecieveMessage - MessageName: %@ (MessageBody Unhandeled)\n", cfMessageName); + LOG(@"ContextInjectedBundleClient - didReceiveMessage - MessageName: %@ (MessageBody Unhandled)\n", cfMessageName); } CFRelease(cfMessageName); @@ -130,7 +130,7 @@ static void populateVisitedLinks(WKContextRef context, const void *clientInfo) WKContextInjectedBundleClient bundleClient = { kWKContextInjectedBundleClientCurrentVersion, 0, /* clientInfo */ - didRecieveMessageFromInjectedBundle, + didReceiveMessageFromInjectedBundle, 0, /* didReceiveSynchronousMessageFromInjectedBundle */ 0 /* getInjectedBundleInitializationUserData */ }; diff --git a/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m b/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m index 509038a9c..46a8c1cbf 100644 --- a/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m +++ b/Tools/MiniBrowser/mac/WebBundle/WebBundleMain.m @@ -73,17 +73,17 @@ void willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clien LOG(@"WKBundleClient - willDestroyPage\n"); } -void didRecieveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo) +void didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo) { CFStringRef cfMessageName = WKStringCopyCFString(0, messageName); WKTypeID typeID = WKGetTypeID(messageBody); if (typeID == WKStringGetTypeID()) { CFStringRef cfMessageBody = WKStringCopyCFString(0, (WKStringRef)messageBody); - LOG(@"WKBundleClient - didRecieveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody); + LOG(@"WKBundleClient - didReceiveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody); CFRelease(cfMessageBody); } else { - LOG(@"WKBundleClient - didRecieveMessage - MessageName: %@ (MessageBody Unhandeled)\n", cfMessageName); + LOG(@"WKBundleClient - didReceiveMessage - MessageName: %@ (MessageBody Unhandled)\n", cfMessageName); } CFRelease(cfMessageName); @@ -99,7 +99,7 @@ void WKBundleInitialize(WKBundleRef bundle, WKTypeRef initializationUserData) didCreatePage, willDestroyPage, 0, // didInitializePageGroup - didRecieveMessage + didReceiveMessage }; WKBundleSetClient(bundle, &client); } diff --git a/Tools/MiniBrowser/qt/BrowserWindow.h b/Tools/MiniBrowser/qt/BrowserWindow.h index 1e7f7f52d..0f30e2c99 100644 --- a/Tools/MiniBrowser/qt/BrowserWindow.h +++ b/Tools/MiniBrowser/qt/BrowserWindow.h @@ -50,13 +50,13 @@ public: void updateVisualMockTouchPoints(const QList<QTouchEvent::TouchPoint>& touchPoints); -public slots: +public Q_SLOTS: BrowserWindow* newWindow(const QString& url = "about:blank"); -protected slots: +protected Q_SLOTS: void screenshot(); -private slots: +private Q_SLOTS: void onTitleChanged(QString); private: diff --git a/Tools/MiniBrowser/qt/MiniBrowserApplication.h b/Tools/MiniBrowser/qt/MiniBrowserApplication.h index aa6ecdef3..3dc380aec 100644 --- a/Tools/MiniBrowser/qt/MiniBrowserApplication.h +++ b/Tools/MiniBrowser/qt/MiniBrowserApplication.h @@ -75,7 +75,7 @@ public: } } -signals: +Q_SIGNALS: void touchMockingEnabledChanged(); private: diff --git a/Tools/MiniBrowser/qt/UrlLoader.h b/Tools/MiniBrowser/qt/UrlLoader.h index 01e67c3bd..8ac58dfdd 100644 --- a/Tools/MiniBrowser/qt/UrlLoader.h +++ b/Tools/MiniBrowser/qt/UrlLoader.h @@ -41,15 +41,15 @@ class UrlLoader : public QObject { public: UrlLoader(BrowserWindow*, const QString&, int, int); -public slots: +public Q_SLOTS: void loadNext(); -private slots: +private Q_SLOTS: void checkIfFinished(); void frameLoadStarted(); void frameLoadFinished(); -signals: +Q_SIGNALS: void pageLoadFinished(); private: diff --git a/Tools/QtTestBrowser/QtTestBrowser.pro b/Tools/QtTestBrowser/QtTestBrowser.pro index 5c123f90f..4d64af9e8 100644 --- a/Tools/QtTestBrowser/QtTestBrowser.pro +++ b/Tools/QtTestBrowser/QtTestBrowser.pro @@ -42,7 +42,8 @@ WEBKIT += wtf webcore DESTDIR = $$ROOT_BUILD_DIR/bin -QT += network webkit printsupport widgets +QT += network webkit widgets +contains(DEFINES, HAVE_QTPRINTSUPPORT=1): QT += printsupport macx:QT += xml diff --git a/Tools/QtTestBrowser/cookiejar.h b/Tools/QtTestBrowser/cookiejar.h index 6e5e73b93..da62fb829 100644 --- a/Tools/QtTestBrowser/cookiejar.h +++ b/Tools/QtTestBrowser/cookiejar.h @@ -44,12 +44,12 @@ public: void setDiskStorageEnabled(bool); -public slots: +public Q_SLOTS: void scheduleSaveToDisk(); void loadFromDisk(); void reset(); -private slots: +private Q_SLOTS: void saveToDisk(); private: diff --git a/Tools/QtTestBrowser/fpstimer.h b/Tools/QtTestBrowser/fpstimer.h index eed1198af..256745aa8 100644 --- a/Tools/QtTestBrowser/fpstimer.h +++ b/Tools/QtTestBrowser/fpstimer.h @@ -43,7 +43,7 @@ public Q_SLOTS: void start(); void stop(); -protected slots: +protected Q_SLOTS: virtual void timerEvent(QTimerEvent*); private: diff --git a/Tools/QtTestBrowser/launcherwindow.cpp b/Tools/QtTestBrowser/launcherwindow.cpp index 4fc90d702..caa79c994 100644 --- a/Tools/QtTestBrowser/launcherwindow.cpp +++ b/Tools/QtTestBrowser/launcherwindow.cpp @@ -51,6 +51,9 @@ #ifndef QT_NO_SHORTCUT #include <QMenuBar> #endif +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) +#include <QPrintPreviewDialog> +#endif #include <QSlider> #include <QSplitter> #include <QStatusBar> @@ -237,7 +240,7 @@ void LauncherWindow::createChrome() fileMenu->addAction("Close Window", this, SLOT(close()), QKeySequence::Close); fileMenu->addSeparator(); fileMenu->addAction("Take Screen Shot...", this, SLOT(screenshot())); -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) fileMenu->addAction(tr("Print..."), this, SLOT(print()), QKeySequence::Print); #endif fileMenu->addSeparator(); @@ -724,7 +727,7 @@ void LauncherWindow::toggleZoomTextOnly(bool b) void LauncherWindow::print() { -#if !defined(QT_NO_PRINTER) +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) QPrintPreviewDialog dlg(this); connect(&dlg, SIGNAL(paintRequested(QPrinter*)), page()->mainFrame(), SLOT(print(QPrinter*))); diff --git a/Tools/QtTestBrowser/launcherwindow.h b/Tools/QtTestBrowser/launcherwindow.h index 348bf127d..69ebe65d2 100644 --- a/Tools/QtTestBrowser/launcherwindow.h +++ b/Tools/QtTestBrowser/launcherwindow.h @@ -39,10 +39,6 @@ #include <QtOpenGL/QGLWidget> #endif -#if !defined(QT_NO_PRINTER) -#include <QPrintPreviewDialog> -#endif - #include <QDebug> #include <cstdio> @@ -125,7 +121,7 @@ public: bool eventFilter(QObject* obj, QEvent* event); -protected slots: +protected Q_SLOTS: void loadStarted(); void loadFinished(); @@ -188,12 +184,12 @@ protected slots: void fileDownloadFinished(); #endif -public slots: +public Q_SLOTS: LauncherWindow* newWindow(); LauncherWindow* cloneWindow(); void updateFPS(int fps); -signals: +Q_SIGNALS: void enteredFullScreenMode(bool on); private: diff --git a/Tools/QtTestBrowser/locationedit.h b/Tools/QtTestBrowser/locationedit.h index 54d8a6835..dae069d7b 100644 --- a/Tools/QtTestBrowser/locationedit.h +++ b/Tools/QtTestBrowser/locationedit.h @@ -44,10 +44,10 @@ public: void setPageIcon(const QIcon&); -public slots: +public Q_SLOTS: void setProgress(int progress); -private slots: +private Q_SLOTS: void reset(); protected: diff --git a/Tools/QtTestBrowser/mainwindow.h b/Tools/QtTestBrowser/mainwindow.h index a6a1bd29d..203695247 100644 --- a/Tools/QtTestBrowser/mainwindow.h +++ b/Tools/QtTestBrowser/mainwindow.h @@ -55,7 +55,7 @@ public: WebPage* page() const; void setPage(WebPage*); -protected slots: +protected Q_SLOTS: void setAddressUrl(const QString& url); void setAddressUrl(const QUrl& url); void openFile(); diff --git a/Tools/QtTestBrowser/urlloader.h b/Tools/QtTestBrowser/urlloader.h index 8ce24c0d0..84254090f 100644 --- a/Tools/QtTestBrowser/urlloader.h +++ b/Tools/QtTestBrowser/urlloader.h @@ -41,15 +41,15 @@ class UrlLoader : public QObject { public: UrlLoader(QWebFrame* frame, const QString& inputFileName, int timeoutSeconds, int extraTimeSeconds); -public slots: +public Q_SLOTS: void loadNext(); -private slots: +private Q_SLOTS: void checkIfFinished(); void frameLoadStarted(); void frameLoadFinished(); -signals: +Q_SIGNALS: void pageLoadFinished(); private: diff --git a/Tools/QtTestBrowser/webinspector.h b/Tools/QtTestBrowser/webinspector.h index c24ecbf9c..c75bbdc2f 100644 --- a/Tools/QtTestBrowser/webinspector.h +++ b/Tools/QtTestBrowser/webinspector.h @@ -36,7 +36,7 @@ class WebInspector : public QWebInspector { public: WebInspector(QWidget* parent = 0) : QWebInspector(parent) {} -signals: +Q_SIGNALS: void visibleChanged(bool nowVisible); protected: diff --git a/Tools/QtTestBrowser/webpage.h b/Tools/QtTestBrowser/webpage.h index 01f3f6a86..9f98212d0 100644 --- a/Tools/QtTestBrowser/webpage.h +++ b/Tools/QtTestBrowser/webpage.h @@ -52,7 +52,7 @@ public: QString userAgentForUrl(const QUrl& url) const; void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; } -public slots: +public Q_SLOTS: void openUrlInDefaultBrowser(const QUrl& url = QUrl()); void setUserAgent(const QString& ua) { m_userAgent = ua; } bool shouldInterruptJavaScript(); diff --git a/Tools/QtTestBrowser/webview.h b/Tools/QtTestBrowser/webview.h index b50b764e6..56a61688a 100644 --- a/Tools/QtTestBrowser/webview.h +++ b/Tools/QtTestBrowser/webview.h @@ -94,14 +94,14 @@ public: GraphicsWebView* graphicsWebView() const { return m_item; } -public slots: +public Q_SLOTS: void updateFrameRate(); void animatedFlip(); void animatedYFlip(); void contentsSizeChanged(const QSize&); void scrollRequested(int, int); -signals: +Q_SIGNALS: void currentFPSUpdated(int fps); private: diff --git a/Tools/Scripts/VCSUtils.pm b/Tools/Scripts/VCSUtils.pm index 4da78720a..6bba77407 100644 --- a/Tools/Scripts/VCSUtils.pm +++ b/Tools/Scripts/VCSUtils.pm @@ -383,7 +383,7 @@ sub svnRevisionForDirectory($) my $svnInfo = `$command`; ($revision) = ($svnInfo =~ m/Revision: (\d+).*/g); } elsif (isGitDirectory($dir)) { - my $command = "git log --grep='git-svn-id: ' -n 1 | grep git-svn-id:"; + my $command = "git log --grep=\"git-svn-id: \" -n 1 | grep git-svn-id:"; $command = "LC_ALL=C $command" if !isWindows(); $command = "cd $dir && $command"; my $gitLog = `$command`; diff --git a/Tools/Scripts/old-run-webkit-tests b/Tools/Scripts/old-run-webkit-tests index 18ae056a1..e6415da4d 100755 --- a/Tools/Scripts/old-run-webkit-tests +++ b/Tools/Scripts/old-run-webkit-tests @@ -2560,11 +2560,21 @@ my @testsFound; sub isUsedInReftest($) { my $filename = $_[0]; - if ($filename =~ /-$expectedTag(-$mismatchTag)?\.html$/) { + my @extensions = ('html','shtml','xml','xhtml','htm','php','svg','mht','pl'); + my $extensionsJoined = join("|", @extensions); + my $extensionExpression = "-$expectedTag(-$mismatchTag)?\\.(".$extensionsJoined.")\$"; + + if ($filename =~ /$extensionExpression/) { return 1; } my $base = stripExtension($filename); - return (-f "$base-$expectedTag.html" || -f "$base-$expectedTag-$mismatchTag.html"); + + foreach my $extension (@extensions) { + if (-f "$base-$expectedTag.$extension" || -f "$base-$expectedTag-$mismatchTag.$extension") { + return 1; + } + } + return 0; } sub directoryFilter diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests index 4f1d4c15f..776f4cde3 100755 --- a/Tools/Scripts/run-gtk-tests +++ b/Tools/Scripts/run-gtk-tests @@ -67,8 +67,6 @@ 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/next", "Test fails ", 91083), - SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/previous", "Test fails", 91083), SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810), 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), diff --git a/Tools/Scripts/update-webkit-chromium b/Tools/Scripts/update-webkit-chromium index a5c242442..b21d09ec5 100755 --- a/Tools/Scripts/update-webkit-chromium +++ b/Tools/Scripts/update-webkit-chromium @@ -1,5 +1,4 @@ #!/usr/bin/perl -w - # Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -59,26 +58,10 @@ if (! -e ".gclient") { "--spec=solutions=[{'name':'./','url':None}]") == 0 or die $!; } -# When building WebKit's Chromium port for Android, we need the Android NDK as -# it will allow us to cross-compile all sources to the target architecture. +# When building Chromium for Android, the envsetup.sh script needs to be +# executed prior to project file generation. We need to tell gyp_webkit to do +# that, as it's a Chromium file and may not be available yet right now. if (isChromiumAndroid()) { - if (! -e "android-ndk-r7b") { - print "Installing the Android NDK, version 7b...\n"; - my $host_os = isLinux() ? "linux" : "darwin"; - my $result = system("curl", "-o", "android-ndk-r7b.tar.bz2", "http://dl.google.com/android/ndk/android-ndk-r7b-" . $host_os . "-x86.tar.bz2"); - die "Couldn't download the Android NDK." if $result; - - $result = system("tar", "jx", "-f", "android-ndk-r7b.tar.bz2"); - die "Couldn't extract the Android NDK." if $result; - } - - my $androidNdkRoot = sourceDir() . "/Source/WebKit/chromium/android-ndk-r7b"; - - # Attempt to replace the NDK's linker with a 64-bit version if the host - # OS is Linux. This will significantly speed up link times. - chromiumInstall64BitAndroidLinkerIfNeeded($androidNdkRoot) if isLinux(); - - $ENV{ANDROID_NDK_ROOT} = $androidNdkRoot; $ENV{WEBKIT_ANDROID_BUILD} = 1; } diff --git a/Tools/Scripts/update-webkit-libs-jhbuild b/Tools/Scripts/update-webkit-libs-jhbuild index 48343fb30..51605bded 100755 --- a/Tools/Scripts/update-webkit-libs-jhbuild +++ b/Tools/Scripts/update-webkit-libs-jhbuild @@ -41,6 +41,56 @@ if (!$getOptionsResult) { } } +sub getMD5HashForFile($) +{ + my $file = shift; + + open(FILE_CONTENTS, $file); + + my $contents = ""; + while (<FILE_CONTENTS>) { + $contents .= $_; + } + + close(FILE_CONTENTS); + + return md5_hex($contents); +} + +sub jhbuildConfigurationChanged() +{ + foreach my $file (qw(jhbuildrc jhbuild.modules)) { + my $path = join('/', getJhbuildPath(), $file . '.md5sum'); + if (! -e $path) { + return 1; + } + + # Get the md5 sum of the file we're testing, look in the right platform directory. + my $actualFile = join('/', sourceDir(), 'Tools', $platform, $file); + my $currentSum = getMD5HashForFile($actualFile); + + # Get our previous record. + open(PREVIOUS_MD5, $path); + chomp(my $previousSum = <PREVIOUS_MD5>); + close(PREVIOUS_MD5); + + if ($previousSum ne $currentSum) { + return 1; + } + } +} + +sub saveJhbuildMd5() { + # Save md5sum for jhbuild-related files.saveJhbuildMd5(); + foreach my $file (qw(jhbuildrc jhbuild.modules)) { + my $source = join('/', sourceDir(), "Tools", $platform, $file); + my $destination = join('/', getJhbuildPath(), $file); + open(SUM, ">$destination" . ".md5sum"); + print SUM getMD5HashForFile($source); + close(SUM); + } +} + sub runJhbuild { my $command = shift; @@ -49,10 +99,30 @@ sub runJhbuild system(@jhbuildArgs) == 0 or die "Running jhbuild-wrapper " . $command . " failed.\n"; } +sub cleanJhbuild() +{ + runJhbuild("clean"); + + # If the configuration changed, dependencies may have been removed. + # Since we lack a granular way of uninstalling those we wipe out the + # jhbuild root and start from scratch. + my $jhbuildPath = getJhbuildPath(); + if (system("rm -rf $jhbuildPath/Root") ne 0) { + die "Cleaning jhbuild root failed!"; + } +} + delete $ENV{AR_FLAGS} if exists $ENV{AR_FLAGS}; chdir(relativeScriptsDir() . "/../jhbuild") or die $!; my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+" ); + +if (-e getJhbuildPath() && jhbuildConfigurationChanged()) { + cleanJhbuild(); +} + print "Updating " . $prettyPlatform{$platform} . " port dependencies using jhbuild...\n"; runJhbuild("build"); + +saveJhbuildMd5(); diff --git a/Tools/Scripts/update-webkitefl-libs b/Tools/Scripts/update-webkitefl-libs index cbdb55ca7..30b2104ab 100755 --- a/Tools/Scripts/update-webkitefl-libs +++ b/Tools/Scripts/update-webkitefl-libs @@ -20,4 +20,4 @@ use lib $FindBin::Bin; use webkitdirs; my $scriptsDir = relativeScriptsDir(); -system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--efl", sys.argv) == 0 or die $!; +system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--efl") == 0 or die $!; diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm index e5bf957c0..19c6c0046 100755 --- a/Tools/Scripts/webkitdirs.pm +++ b/Tools/Scripts/webkitdirs.pm @@ -1894,23 +1894,6 @@ sub autotoolsFlag($$) return $prefix . '-' . $feature; } -sub getMD5HashForFile($) -{ - my $file = shift; - - open(FILE_CONTENTS, $file); - - # Read the whole file. - my $contents = ""; - while (<FILE_CONTENTS>) { - $contents .= $_; - } - - close(FILE_CONTENTS); - - return md5_hex($contents); -} - sub runAutogenForAutotoolsProjectIfNecessary($@) { my ($dir, $prefix, $sourceDir, $project, @buildArgs) = @_; @@ -1954,7 +1937,7 @@ sub runAutogenForAutotoolsProjectIfNecessary($@) # Prefix the command with jhbuild run. unshift(@buildArgs, "$relSourceDir/autogen.sh"); - unshift(@buildArgs, "$sourceDir/Tools/gtk/run-with-jhbuild"); + unshift(@buildArgs, jhbuildWrapperPrefixIfNeeded()); if (system(@buildArgs) ne 0) { die "Calling autogen.sh failed!\n"; } @@ -1965,58 +1948,6 @@ sub getJhbuildPath() return join('/', baseProductDir(), "Dependencies"); } -sub jhbuildConfigurationChanged() -{ - foreach my $file (qw(jhbuildrc.md5sum jhbuild.modules.md5sum)) { - my $path = join('/', getJhbuildPath(), $file); - if (! -e $path) { - return 1; - } - - # Get the md5 sum of the file we're testing, look in the right platform directory. - $file =~ m/(.+)\.md5sum/; - my $platformDir = isEfl() ? 'efl' : 'gtk'; - my $actualFile = join('/', $sourceDir, 'Tools', $platformDir, $1); - my $currentSum = getMD5HashForFile($actualFile); - - # Get our previous record. - open(PREVIOUS_MD5, $path); - chomp(my $previousSum = <PREVIOUS_MD5>); - close(PREVIOUS_MD5); - - if ($previousSum ne $currentSum) { - return 1; - } - } -} - -sub saveJhbuildMd5() { - my $platform = isEfl() ? 'efl' : 'gtk'; - # Save md5sum for jhbuild-related files. - foreach my $file (qw(jhbuildrc jhbuild.modules)) { - my $source = join('/', $sourceDir, "Tools", $platform, $file); - my $destination = join('/', getJhbuildPath(), $file); - open(SUM, ">$destination" . ".md5sum"); - print SUM getMD5HashForFile($source); - close(SUM); - } -} - -sub cleanJhbuild() { - # If the configuration changed, dependencies may have been removed. - # Since we lack a granular way of uninstalling those we wipe out the - # jhbuild root and start from scratch. - my $jhbuildPath = getJhbuildPath(); - if (system("rm -rf $jhbuildPath/Root") ne 0) { - die "Cleaning jhbuild root failed!"; - } - - my $platform = isEfl() ? 'efl' : 'gtk'; - if (system("perl $sourceDir/Tools/jhbuild/jhbuild-wrapper --$platform clean") ne 0) { - die "Cleaning jhbuild modules failed!"; - } -} - sub mustReRunAutogen($@) { my ($sourceDir, $filename, @currentArguments) = @_; @@ -2106,33 +2037,19 @@ sub buildAutotoolsProject($@) # Enable unstable features when building through build-webkit. push @buildArgs, "--enable-unstable-features"; - # We might need to update jhbuild dependencies. - my $needUpdate = 0; - if (jhbuildConfigurationChanged()) { - cleanJhbuild(); - $needUpdate = 1; - } - if (checkForArgumentAndRemoveFromArrayRef("--update-gtk", \@buildArgs)) { - $needUpdate = 1; - } - - if ($needUpdate) { # Force autogen to run, to catch the possibly updated libraries. system("rm -f previous-autogen-arguments.txt"); system("perl", "$sourceDir/Tools/Scripts/update-webkitgtk-libs") == 0 or die $!; } - saveJhbuildMd5(); - # If GNUmakefile exists, don't run autogen.sh unless its arguments # have changed. The makefile should be smart enough to track autotools # dependencies and re-run autogen.sh when build files change. runAutogenForAutotoolsProjectIfNecessary($dir, $prefix, $sourceDir, $project, @buildArgs); - my $gtkScriptsPath = "$sourceDir/Tools/gtk"; - my $runWithJhbuild = "$gtkScriptsPath/run-with-jhbuild"; + my $runWithJhbuild = jhbuildWrapperPrefixIfNeeded(); if (system("$runWithJhbuild $make $makeArgs") ne 0) { die "\nFailed to build WebKit using '$make'!\n"; } @@ -2140,7 +2057,7 @@ sub buildAutotoolsProject($@) chdir ".." or die; if ($project eq 'WebKit' && !isCrossCompilation()) { - my @docGenerationOptions = ($runWithJhbuild, "$gtkScriptsPath/generate-gtkdoc", "--skip-html"); + my @docGenerationOptions = ($runWithJhbuild, "$sourceDir/Tools/gtk/generate-gtkdoc", "--skip-html"); push(@docGenerationOptions, productDir()); if (system(@docGenerationOptions)) { @@ -2153,9 +2070,14 @@ sub buildAutotoolsProject($@) sub jhbuildWrapperPrefixIfNeeded() { - if (isEfl()) { - return File::Spec->catfile(sourceDir(), "Tools", "efl", "run-with-jhbuild"); + if (-e getJhbuildPath()) { + if (isEfl()) { + return File::Spec->catfile(sourceDir(), "Tools", "efl", "run-with-jhbuild"); + } elsif (isGtk()) { + return File::Spec->catfile(sourceDir(), "Tools", "gtk", "run-with-jhbuild"); + } } + return ""; } @@ -2195,15 +2117,6 @@ sub generateBuildSystemFromCMakeProject $ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse " . ($ENV{'CXXFLAGS'} || ""); } - if (isEfl() && jhbuildConfigurationChanged()) { - cleanJhbuild(); - system("perl", "$sourceDir/Tools/Scripts/update-webkitefl-libs") == 0 or die $!; - } - - if (isEfl()) { - saveJhbuildMd5(); - } - # We call system("cmake @args") instead of system("cmake", @args) so that @args is # parsed for shell metacharacters. my $wrapper = jhbuildWrapperPrefixIfNeeded() . " "; @@ -2247,6 +2160,11 @@ sub buildCMakeProjectOrExit($$$$@) exit(exitStatus(cleanCMakeGeneratedProject())) if $clean; + if (isEfl() && checkForArgumentAndRemoveFromARGV("--update-efl")) { + system("perl", "$sourceDir/Tools/Scripts/update-webkitefl-libs") == 0 or die $!; + } + + $returnCode = exitStatus(generateBuildSystemFromCMakeProject($port, $prefixPath, @cmakeArgs)); exit($returnCode) if $returnCode; $returnCode = exitStatus(buildCMakeGeneratedProject($makeArgs)); @@ -2618,49 +2536,6 @@ sub buildChromium($@) return $result; } -sub chromiumInstall64BitAndroidLinkerIfNeeded -{ - my ($androidNdkRoot) = @_; - - # Resolve the toolchain version through glob(). - my $linkerDirPrefix = glob("$androidNdkRoot/toolchains/arm-linux-androideabi-*/prebuilt/linux-x86"); - - my $linkerDirname1 = "$linkerDirPrefix/bin"; - my $linkerBasename1 = "arm-linux-androideabi-ld"; - my $linkerDirname2 = "$linkerDirPrefix/arm-linux-androideabi/bin"; - my $linkerBasename2 = "ld"; - my $newLinker = "arm-linux-androideabi-ld.e4df3e0a5bb640ccfa2f30ee67fe9b3146b152d6"; - - # Do not continue if the new linker is not (yet) available. - if (! -e "third_party/aosp/$newLinker") { - return; - } - - chromiumReplaceAndroidLinkerIfNeeded($linkerDirname1, $linkerBasename1, $newLinker); - chromiumReplaceAndroidLinkerIfNeeded($linkerDirname2, $linkerBasename2, $newLinker); -} - -sub chromiumReplaceAndroidLinkerIfNeeded -{ - my ($linkerDirname, $linkerBasename, $newLinker) = @_; - - # If the destination directory does not exist, or the linker has already - # been installed, replacing it will not be necessary. - if (! -d "$linkerDirname" || -e "$linkerDirname/$newLinker") { - return; - } - - print "Installing 64-bit Android linker in $linkerDirname..\n"; - system("cp", "third_party/aosp/$newLinker", "$linkerDirname/$newLinker"); - system("mv", "$linkerDirname/$linkerBasename", "$linkerDirname/$linkerBasename.orig"); - system("ln", "-s", "$newLinker", "$linkerDirname/$linkerBasename"); - - if (! -e "$linkerDirname/$newLinker") { - print "Unable to copy the linker.\n"; - exit 1; - } -} - sub appleApplicationSupportPath { open INSTALL_DIR, "</proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Apple\ Inc./Apple\ Application\ Support/InstallDir"; diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 930947828..4ed314e4f 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -50,6 +50,7 @@ my ( $channelMessagingSupport, $cspNextSupport, $css3FlexboxSupport, + $css3TextDecorationSupport, $cssBoxDecorationBreakSupport, $cssExclusionsSupport, $cssFiltersSupport, @@ -135,6 +136,7 @@ my ( $webSocketsSupport, $webTimingSupport, $workersSupport, + $xhrResponseBlobSupport, $xsltSupport, ); @@ -169,6 +171,9 @@ my @features = ( { option => "css3-flexbox", desc => "Toggle CSS3 Flexbox support", define => "ENABLE_CSS3_FLEXBOX", default => 1, value => \$css3FlexboxSupport }, + { option => "css3-text-decoration", desc => "Toggle CSS3 Text Decoration support", + define => "ENABLE_CSS3_TEXT_DECORATION", default => 0, value => \$css3TextDecorationSupport }, + { option => "css-hierarchies", desc => "Toggle CSS Hierarchy support", define => "ENABLE_CSS_HIERARCHIES", default => 0, value => \$cssHierarchiesSupport }, @@ -415,6 +420,9 @@ my @features = ( { option => "workers", desc => "Toggle Workers support", define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$workersSupport }, + { option => "xhr-response-blob", desc => "Toggle XHR Response BLOB support", + define => "ENABLE_XHR_RESPONSE_BLOB", default => isBlackBerry(), value => \$xhrResponseBlobSupport }, + { option => "xslt", desc => "Toggle XSLT support", define => "ENABLE_XSLT", default => 1, value => \$xsltSupport }, ); diff --git a/Tools/Scripts/webkitpy/common/config/build.py b/Tools/Scripts/webkitpy/common/config/build.py index fcb5e62c3..2ecacc7ad 100644 --- a/Tools/Scripts/webkitpy/common/config/build.py +++ b/Tools/Scripts/webkitpy/common/config/build.py @@ -37,7 +37,7 @@ def _should_file_trigger_build(target_platform, file): # and start using it for their bots. Someone familiar with each platform # will have to figure out what the right set of directories/patterns is for # that platform. - assert(target_platform in ("mac-leopard", "mac-lion", "mac-snowleopard", "win")) + assert(target_platform in ("mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard", "win")) directories = [ # Directories that shouldn't trigger builds on any bots. @@ -68,9 +68,9 @@ def _should_file_trigger_build(target_platform, file): ("gtk", ["gtk"]), ("mac", ["chromium-mac", "mac"]), ("mac-leopard", ["mac-leopard"]), - ("mac-lion", ["mac", "win"]), + ("mac-lion", ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]), ("mac-snowleopard", ["mac-leopard", "mac-snowleopard"]), - ("mac-wk2", ["mac-lion", "mac-snowleopard", "win"]), + ("mac-wk2", ["mac-lion", "mac-snowleopard", "mac-mountainlion", "win"]), ("objc", ["mac"]), ("qt", ["qt"]), ("skia", ["chromium"]), diff --git a/Tools/Scripts/webkitpy/common/config/build_unittest.py b/Tools/Scripts/webkitpy/common/config/build_unittest.py index bdc340489..c496179e4 100644 --- a/Tools/Scripts/webkitpy/common/config/build_unittest.py +++ b/Tools/Scripts/webkitpy/common/config/build_unittest.py @@ -31,7 +31,7 @@ class ShouldBuildTest(unittest.TestCase): (["GNUmakefile.am", "Source/WebCore/GNUmakefile.am"], ["gtk"]), (["Websites/bugs.webkit.org/foo", "Source/WebCore/bar"], ["*"]), (["Websites/bugs.webkit.org/foo"], []), - (["Source/JavaScriptCore/JavaScriptCore.xcodeproj/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard"]), + (["Source/JavaScriptCore/JavaScriptCore.xcodeproj/foo"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]), (["Source/JavaScriptCore/JavaScriptCore.vcproj/foo", "Source/WebKit2/win/WebKit2.vcproj", "Source/WebKit/win/WebKit.sln", "Tools/WebKitTestRunner/Configurations/WebKitTestRunnerCommon.vsprops"], ["win"]), (["LayoutTests/platform/mac/foo", "Source/WebCore/bar"], ["*"]), (["LayoutTests/foo"], ["*"]), @@ -41,17 +41,17 @@ class ShouldBuildTest(unittest.TestCase): (["LayoutTests/platform/mac-leopard/foo"], ["mac-leopard"]), (["LayoutTests/platform/mac-lion/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]), (["LayoutTests/platform/mac-snowleopard/foo"], ["mac-leopard", "mac-snowleopard"]), - (["LayoutTests/platform/mac-wk2/Skipped"], ["mac-lion", "mac-snowleopard", "win"]), - (["LayoutTests/platform/mac/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]), + (["LayoutTests/platform/mac-wk2/Skipped"], ["mac-lion", "mac-mountainlion", "mac-snowleopard", "win"]), + (["LayoutTests/platform/mac/foo"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard", "win"]), (["LayoutTests/platform/win-xp/foo"], ["win"]), (["LayoutTests/platform/win-wk2/foo"], ["win"]), (["LayoutTests/platform/win/foo"], ["win"]), - (["Source/WebCore.exp.in", "Source/WebKit/mac/WebKit.exp"], ["mac-leopard", "mac-lion", "mac-snowleopard"]), - (["Source/WebCore/mac/foo"], ["chromium-mac", "mac-leopard", "mac-lion", "mac-snowleopard"]), + (["Source/WebCore.exp.in", "Source/WebKit/mac/WebKit.exp"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]), + (["Source/WebCore/mac/foo"], ["chromium-mac", "mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]), (["Source/WebCore/win/foo"], ["chromium-win", "win"]), - (["Source/WebCore/platform/graphics/gpu/foo"], ["mac-leopard", "mac-lion", "mac-snowleopard"]), + (["Source/WebCore/platform/graphics/gpu/foo"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]), (["Source/WebCore/platform/wx/wxcode/win/foo"], []), - (["Source/WebCore/rendering/RenderThemeMac.mm", "Source/WebCore/rendering/RenderThemeMac.h"], ["mac-leopard", "mac-lion", "mac-snowleopard"]), + (["Source/WebCore/rendering/RenderThemeMac.mm", "Source/WebCore/rendering/RenderThemeMac.h"], ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard"]), (["Source/WebCore/rendering/RenderThemeChromiumLinux.h"], ["chromium-linux"]), (["Source/WebCore/rendering/RenderThemeWinCE.h"], []), (["Tools/BuildSlaveSupport/build.webkit.org-config/public_html/LeaksViewer/LeaksViewer.js"], []), @@ -61,7 +61,7 @@ class ShouldBuildTest(unittest.TestCase): for files, platforms in self._should_build_tests: # FIXME: We should test more platforms here once # build._should_file_trigger_build is implemented for them. - for platform in ["mac-leopard", "mac-lion", "mac-snowleopard", "win"]: + for platform in ["mac-leopard", "mac-lion", "mac-mountainlion", "mac-snowleopard", "win"]: should_build = platform in platforms or "*" in platforms self.assertEqual(build.should_build(platform, files), should_build, "%s should%s have built but did%s (files: %s)" % (platform, "" if should_build else "n't", "n't" if should_build else "", str(files))) diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index ddfddf9a9..4c2216289 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -131,6 +131,7 @@ contributors_who_are_not_committers = [ Contributor("Eric Penner", "epenner@chromium.org", "epenner"), 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("Grace Kloba", "klobag@chromium.org", "klobag"), Contributor("Greg Simon", "gregsimon@chromium.org", "gregsimon"), Contributor("Gregg Tavares", ["gman@google.com", "gman@chromium.org"], "gman"), @@ -143,6 +144,7 @@ contributors_who_are_not_committers = [ Contributor("John Bauman", ["jbauman@chromium.org", "jbauman@google.com"], "jbauman"), Contributor("John Mellor", "johnme@chromium.org", "johnme"), Contributor("Kulanthaivel Palanichamy", "kulanthaivel@codeaurora.org", "kvel"), + Contributor("Kiran Muppala", "cmuppala@apple.com", "kiranm"), Contributor(u"Michael Br\u00fcning", "michael.bruning@nokia.com", "mibrunin"), Contributor("Mihai Balan", "mibalan@adobe.com", "miChou"), Contributor("Min Qin", "qinmin@chromium.org"), @@ -153,6 +155,7 @@ contributors_who_are_not_committers = [ Contributor("Pravin D", "pravind.2k4@gmail.com", 'pravind'), Contributor("Radar WebKit Bug Importer", "webkit-bug-importer@group.apple.com"), Contributor("Raul Hudea", "rhudea@adobe.com", "rhudea"), + Contributor("Roger Fong", "roger_fong@apple.com", "rfong"), Contributor("Roland Takacs", "rtakacs@inf.u-szeged.hu", "rtakacs"), Contributor(u"Sami Ky\u00f6stil\u00e4", "skyostil@chromium.org", "skyostil"), Contributor("Szilard Ledan-Muntean", "szledan@inf.u-szeged.hu", "szledan"), @@ -161,6 +164,7 @@ contributors_who_are_not_committers = [ 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"), Contributor("Wyatt Carss", ["wcarss@chromium.org", "wcarss@google.com"], "wcarss"), Contributor("Zeev Lieber", "zlieber@chromium.org"), Contributor("Zoltan Arvai", "zarvai@inf.u-szeged.hu", "azbest_hu"), diff --git a/Tools/Scripts/webkitpy/common/config/ports.py b/Tools/Scripts/webkitpy/common/config/ports.py index 1d76b4218..884380e65 100644 --- a/Tools/Scripts/webkitpy/common/config/ports.py +++ b/Tools/Scripts/webkitpy/common/config/ports.py @@ -160,6 +160,7 @@ class EflPort(DeprecatedPort): def build_webkit_command(self, build_style=None): command = super(EflPort, self).build_webkit_command(build_style=build_style) command.append("--efl") + command.append("--update-efl") command.append(super(EflPort, self).makeArgs()) return command diff --git a/Tools/Scripts/webkitpy/common/config/ports_unittest.py b/Tools/Scripts/webkitpy/common/config/ports_unittest.py index df5bf7352..272052339 100644 --- a/Tools/Scripts/webkitpy/common/config/ports_unittest.py +++ b/Tools/Scripts/webkitpy/common/config/ports_unittest.py @@ -46,6 +46,11 @@ class DeprecatedPortTest(unittest.TestCase): self.assertEquals(GtkPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--gtk", "--update-gtk", DeprecatedPort().makeArgs()]) self.assertEquals(GtkPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--gtk", "--update-gtk", DeprecatedPort().makeArgs()]) + def test_efl_port(self): + self.assertEquals(EflPort().flag(), "--port=efl") + self.assertEquals(EflPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--efl", "--update-efl", DeprecatedPort().makeArgs()]) + self.assertEquals(EflPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--efl", "--update-efl", DeprecatedPort().makeArgs()]) + def test_qt_port(self): self.assertEquals(QtPort().flag(), "--port=qt") self.assertEquals(QtPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests")) diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist index e5c9c2776..ce7b7fe9a 100755 --- a/Tools/Scripts/webkitpy/common/config/watchlist +++ b/Tools/Scripts/webkitpy/common/config/watchlist @@ -212,7 +212,9 @@ "Battery": { "filename": r"Source/WebCore/Modules/battery", }, - + "WTF": { + "filename": r"Source/WTF/wtf", + }, }, "CC_RULES": { # Note: All email addresses listed must be registered with bugzilla. @@ -257,6 +259,7 @@ "WebIDL": [ "abarth@webkit.org", "ojan@chromium.org" ], "WebKitGTKTranslations": [ "gns@gnome.org", "mrobinson@webkit.org" ], "webkitpy": [ "abarth@webkit.org", "ojan@chromium.org", "dpranke@chromium.org" ], + "WTF": [ "benjamin@webkit.org",], }, "MESSAGE_RULES": { "ChromiumPublicApi": [ "Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, " 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 ae3422561..a9df942da 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py @@ -315,12 +315,19 @@ class Worker(object): test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input) def _run_test(self, test_input): + self._batch_count += 1 + + stop_when_done = False + if self._batch_size > 0 and self._batch_count >= self._batch_size: + self._batch_count = 0 + stop_when_done = True + self._update_test_input(test_input) test_timeout_sec = self._timeout(test_input) start = time.time() self._caller.post('started_test', test_input, test_timeout_sec) - result = self._run_test_with_timeout(test_input, test_timeout_sec) + result = self._run_test_with_timeout(test_input, test_timeout_sec, stop_when_done) elapsed_time = time.time() - start self._caller.post('finished_test', result, elapsed_time) @@ -359,13 +366,12 @@ class Worker(object): _log.debug("%s killing driver" % self._name) driver.stop() - def _run_test_with_timeout(self, test_input, timeout): + def _run_test_with_timeout(self, test_input, timeout, stop_when_done): if self._options.run_singly: - return self._run_test_in_another_thread(test_input, timeout) - return self._run_test_in_this_thread(test_input) + return self._run_test_in_another_thread(test_input, timeout, stop_when_done) + return self._run_test_in_this_thread(test_input, stop_when_done) def _clean_up_after_test(self, test_input, result): - self._batch_count += 1 test_name = test_input.test_name self._tests_run_file.write(test_name + "\n") @@ -385,11 +391,7 @@ class Worker(object): else: _log.debug("%s %s passed" % (self._name, test_name)) - if self._batch_size > 0 and self._batch_count >= self._batch_size: - self._kill_driver() - self._batch_count = 0 - - def _run_test_in_another_thread(self, test_input, thread_timeout_sec): + def _run_test_in_another_thread(self, test_input, thread_timeout_sec, stop_when_done): """Run a test in a separate thread, enforcing a hard time limit. Since we can only detect the termination of a thread, not any internal @@ -412,7 +414,7 @@ class Worker(object): self.result = None def run(self): - self.result = worker._run_single_test(driver, test_input) + self.result = worker._run_single_test(driver, test_input, stop_when_done) thread = SingleTestThread() thread.start() @@ -435,7 +437,7 @@ class Worker(object): result = test_results.TestResult(test_input.test_name, failures=[], test_run_time=0) return result - def _run_test_in_this_thread(self, test_input): + def _run_test_in_this_thread(self, test_input, stop_when_done): """Run a single test file using a shared DumpRenderTree process. Args: @@ -447,11 +449,11 @@ class Worker(object): self._kill_driver() if not self._driver: self._driver = self._port.create_driver(self._worker_number) - return self._run_single_test(self._driver, test_input) + return self._run_single_test(self._driver, test_input, stop_when_done) - def _run_single_test(self, driver, test_input): + def _run_single_test(self, driver, test_input, stop_when_done): return single_test_runner.run_single_test(self._port, self._options, - test_input, driver, self._name) + test_input, driver, self._name, stop_when_done) class TestShard(object): diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py index b36130ded..7379d97c3 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py @@ -41,15 +41,15 @@ from webkitpy.layout_tests.models.test_results import TestResult _log = logging.getLogger(__name__) -def run_single_test(port, options, test_input, driver, worker_name): - runner = SingleTestRunner(options, port, driver, test_input, worker_name) +def run_single_test(port, options, test_input, driver, worker_name, stop_when_done): + runner = SingleTestRunner(options, port, driver, test_input, worker_name, stop_when_done) return runner.run() class SingleTestRunner(object): (ALONGSIDE_TEST, PLATFORM_DIR, VERSION_DIR, UPDATE) = ('alongside', 'platform', 'version', 'update') - def __init__(self, options, port, driver, test_input, worker_name): + def __init__(self, options, port, driver, test_input, worker_name, stop_when_done): self._options = options self._port = port self._filesystem = port.host.filesystem @@ -59,6 +59,7 @@ class SingleTestRunner(object): self._test_name = test_input.test_name self._should_run_pixel_test = test_input.should_run_pixel_test self._reference_files = test_input.reference_files + self._stop_when_done = stop_when_done if self._reference_files: # Detect and report a test which has a wrong combination of expectation files. @@ -102,7 +103,7 @@ class SingleTestRunner(object): return self._run_compare_test() def _run_compare_test(self): - driver_output = self._driver.run_test(self._driver_input()) + driver_output = self._driver.run_test(self._driver_input(), self._stop_when_done) expected_driver_output = self._expected_driver_output() if self._options.ignore_metrics: @@ -116,7 +117,7 @@ class SingleTestRunner(object): return test_result def _run_rebaseline(self): - driver_output = self._driver.run_test(self._driver_input()) + driver_output = self._driver.run_test(self._driver_input(), self._stop_when_done) failures = self._handle_error(driver_output) test_result_writer.write_test_result(self._filesystem, self._port, self._test_name, driver_output, None, failures) # FIXME: It the test crashed or timed out, it might be better to avoid @@ -265,7 +266,10 @@ class SingleTestRunner(object): elif driver_output.image_hash != expected_driver_output.image_hash: diff_result = self._port.diff_image(driver_output.image, expected_driver_output.image) err_str = diff_result[2] - if err_str: + # FIXME: see https://bugs.webkit.org/show_bug.cgi?id=94277 and + # https://bugs.webkit.org/show_bug.cgi?id=81962; ImageDiff doesn't + # seem to be working with WTR properly and tons of tests are failing. + if err_str and not self._options.webkit_test_runner: _log.warning(' %s : %s' % (self._test_name, err_str)) failures.append(test_failures.FailureImageHashMismatch()) driver_output.error = (driver_output.error or '') + err_str @@ -279,7 +283,7 @@ class SingleTestRunner(object): return failures def _run_reftest(self): - test_output = self._driver.run_test(self._driver_input()) + test_output = self._driver.run_test(self._driver_input(), self._stop_when_done) total_test_time = 0 reference_output = None test_result = None @@ -293,7 +297,7 @@ class SingleTestRunner(object): putAllMismatchBeforeMatch = sorted for expectation, reference_filename in putAllMismatchBeforeMatch(self._reference_files): reference_test_name = self._port.relative_test_filename(reference_filename) - reference_output = self._driver.run_test(DriverInput(reference_test_name, self._timeout, test_output.image_hash, should_run_pixel_test=True)) + reference_output = self._driver.run_test(DriverInput(reference_test_name, self._timeout, test_output.image_hash, should_run_pixel_test=True), self._stop_when_done) test_result = self._compare_output_with_reference(test_output, reference_output, reference_filename, expectation == '!=') if (expectation == '!=' and test_result.failures) or (expectation == '==' and not test_result.failures): @@ -316,6 +320,10 @@ class SingleTestRunner(object): if failures: return TestResult(self._test_name, failures, total_test_time, has_stderr) + if self._options.webkit_test_runner and not self._options.pixel_tests: + # don't check pixel results for WTR/WK2; they're broken. + return TestResult(self._test_name, failures, total_test_time, has_stderr) + if not driver_output1.image_hash and not driver_output2.image_hash: failures.append(test_failures.FailureReftestNoImagesGenerated(reference_filename)) elif mismatch: diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py index bab741839..d3015dbdd 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py @@ -206,10 +206,14 @@ class TestExpectationParser(object): self._allow_rebaseline_modifier = allow_rebaseline_modifier def parse(self, filename, expectations_string): - expectations = TestExpectationParser._tokenize_list(filename, expectations_string) - for expectation_line in expectations: - self._parse_line(expectation_line) - return expectations + expectation_lines = [] + line_number = 0 + for line in expectations_string.split("\n"): + line_number += 1 + test_expectation = self._tokenize_line(filename, line, line_number) + self._parse_line(test_expectation) + expectation_lines.append(test_expectation) + return expectation_lines def expectation_for_skipped_test(self, test_name): expectation_line = TestExpectationLine() @@ -231,8 +235,6 @@ class TestExpectationParser(object): if not expectation_line.name: return - self._check_modifiers_against_expectations(expectation_line) - expectation_line.is_file = self._port.test_isfile(expectation_line.name) if not expectation_line.is_file and self._check_path_does_not_exist(expectation_line): return @@ -251,7 +253,14 @@ class TestExpectationParser(object): has_wontfix = False has_bugid = False parsed_specifiers = set() - for modifier in expectation_line.modifiers: + + modifiers = [modifier.lower() for modifier in expectation_line.modifiers] + expectations = [expectation.lower() for expectation in expectation_line.expectations] + + if self.SLOW_MODIFIER in modifiers and self.TIMEOUT_EXPECTATION in expectations: + expectation_line.warnings.append('A test can not be both SLOW and TIMEOUT. If it times out indefinitely, then it should be just TIMEOUT.') + + for modifier in modifiers: if modifier in TestExpectations.MODIFIERS: expectation_line.parsed_modifiers.append(modifier) if modifier == self.WONTFIX_MODIFIER: @@ -268,7 +277,7 @@ class TestExpectationParser(object): if not expectation_line.parsed_bug_modifiers and not has_wontfix and not has_bugid: expectation_line.warnings.append('Test lacks BUG modifier.') - if self._allow_rebaseline_modifier and self.REBASELINE_MODIFIER in expectation_line.modifiers: + if self._allow_rebaseline_modifier and self.REBASELINE_MODIFIER in modifiers: expectation_line.warnings.append('REBASELINE should only be used for running rebaseline.py. Cannot be checked in.') expectation_line.matching_configurations = self._test_configuration_converter.to_config_set(parsed_specifiers, expectation_line.warnings) @@ -283,10 +292,6 @@ class TestExpectationParser(object): result.add(expectation) expectation_line.parsed_expectations = result - def _check_modifiers_against_expectations(self, expectation_line): - if self.SLOW_MODIFIER in expectation_line.modifiers and self.TIMEOUT_EXPECTATION in expectation_line.expectations: - expectation_line.warnings.append('A test can not be both SLOW and TIMEOUT. If it times out indefinitely, then it should be just TIMEOUT.') - def _check_path_does_not_exist(self, expectation_line): # WebKit's way of skipping tests is to add a -disabled suffix. # So we should consider the path existing if the path or the @@ -324,7 +329,7 @@ class TestExpectationParser(object): expectation_line.matching_tests.append(expectation_line.path) @classmethod - def _tokenize(cls, filename, expectation_string, line_number): + def _tokenize_line(cls, filename, expectation_string, line_number): """Tokenizes a line from TestExpectations and returns an unparsed TestExpectationLine instance. The format of a test expectation line is: @@ -364,20 +369,9 @@ class TestExpectationParser(object): return expectation_line @classmethod - def _tokenize_list(cls, filename, expectations_string): - """Returns a list of TestExpectationLines, one for each line in expectations_string.""" - expectation_lines = [] - line_number = 0 - for line in expectations_string.split("\n"): - line_number += 1 - expectation_lines.append(cls._tokenize(filename, line, line_number)) - return expectation_lines - - @classmethod def _split_space_separated(cls, space_separated_string): """Splits a space-separated string into an array.""" - # FIXME: Lower-casing is necessary to support legacy code. Need to eliminate. - return [part.strip().lower() for part in space_separated_string.strip().split(' ')] + return [part.strip() for part in space_separated_string.strip().split(' ')] class TestExpectationLine(object): @@ -857,7 +851,7 @@ class TestExpectations(object): def without_rebaseline_modifier(expectation): return not (not expectation.is_invalid() and expectation.name in except_these_tests and - "rebaseline" in expectation.modifiers and + 'rebaseline' in expectation.parsed_modifiers and filename == expectation.filename) return TestExpectationSerializer.list_to_string(filter(without_rebaseline_modifier, self._expectations)) 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 b65151d72..9fc118360 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py @@ -488,7 +488,7 @@ class RebaseliningTest(Base): class TestExpectationParserTests(unittest.TestCase): def _tokenize(self, line): - return TestExpectationParser._tokenize('path', line, 0) + return TestExpectationParser._tokenize_line('path', line, 0) def test_tokenize_blank(self): expectation = self._tokenize('') @@ -529,15 +529,15 @@ class TestExpectationParserTests(unittest.TestCase): def test_tokenize_valid_with_comment(self): expectation = self._tokenize('FOO : bar = BAZ //Qux.') self.assertEqual(expectation.comment, 'Qux.') - self.assertEqual(str(expectation.modifiers), '[\'foo\']') - self.assertEqual(str(expectation.expectations), '[\'baz\']') + self.assertEqual(str(expectation.modifiers), "['FOO']") + self.assertEqual(str(expectation.expectations), "['BAZ']") self.assertEqual(len(expectation.warnings), 0) def test_tokenize_valid_with_multiple_modifiers(self): expectation = self._tokenize('FOO1 FOO2 : bar = BAZ //Qux.') self.assertEqual(expectation.comment, 'Qux.') - self.assertEqual(str(expectation.modifiers), '[\'foo1\', \'foo2\']') - self.assertEqual(str(expectation.expectations), '[\'baz\']') + self.assertEqual(str(expectation.modifiers), "['FOO1', 'FOO2']") + self.assertEqual(str(expectation.expectations), "['BAZ']") self.assertEqual(len(expectation.warnings), 0) def test_parse_empty_string(self): @@ -560,7 +560,7 @@ class TestExpectationSerializerTests(unittest.TestCase): unittest.TestCase.__init__(self, testFunc) def _tokenize(self, line): - return TestExpectationParser._tokenize('path', line, 0) + return TestExpectationParser._tokenize_line('path', line, 0) def assert_round_trip(self, in_string, expected_string=None): expectation = self._tokenize(in_string) @@ -569,7 +569,9 @@ class TestExpectationSerializerTests(unittest.TestCase): self.assertEqual(expected_string, self._serializer.to_string(expectation)) def assert_list_round_trip(self, in_string, expected_string=None): - expectations = TestExpectationParser._tokenize_list('path', in_string) + host = MockHost() + parser = TestExpectationParser(host.port_factory.get('test-win-xp', None), [], allow_rebaseline_modifier=False) + expectations = parser.parse('path', in_string) if expected_string is None: expected_string = in_string self.assertEqual(expected_string, TestExpectationSerializer.list_to_string(expectations, self._converter)) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py index cf7104c28..c6b5c6802 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/base.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py @@ -60,6 +60,7 @@ from webkitpy.layout_tests.port import driver from webkitpy.layout_tests.port import http_lock from webkitpy.layout_tests.port import image_diff from webkitpy.layout_tests.port import server_process +from webkitpy.layout_tests.port.factory import PortFactory from webkitpy.layout_tests.servers import apache_http_server from webkitpy.layout_tests.servers import http_server from webkitpy.layout_tests.servers import websocket_server @@ -158,6 +159,12 @@ class Port(object): return 50 * 1000 return 35 * 1000 + def driver_stop_timeout(self): + """ Returns the amount of time in seconds to wait before killing the process in driver.stop().""" + # We want to wait for at least 3 seconds, but if we are really slow, we want to be slow on cleanup as + # well (for things like ASAN, Valgrind, etc.) + return 3.0 * float(self.get_option('time_out_ms', '0')) / self.default_timeout_ms() + def wdiff_available(self): if self._wdiff_available is None: self._wdiff_available = self.check_wdiff(logging=False) @@ -198,7 +205,7 @@ class Port(object): def baseline_search_path(self): - return self.get_option('additional_platform_directory', []) + self.default_baseline_search_path() + return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path() def default_baseline_search_path(self): """Return a list of absolute paths to directories to search under for @@ -211,6 +218,14 @@ class Port(object): search_paths.append(self.port_name) return map(self._webkit_baseline_path, search_paths) + @memoized + def _compare_baseline(self): + factory = PortFactory(self.host) + target_port = self.get_option('compare_port') + if target_port: + return factory.get(target_port).default_baseline_search_path() + return [] + def check_build(self, needs_http): """This routine is used to ensure that the build is up to date and all the needed binaries are present.""" @@ -1099,15 +1114,6 @@ class Port(object): def default_configuration(self): return self._config.default_configuration() - def process_kill_time(self): - """ Returns the amount of time in seconds to wait before killing the process. - - Within server_process.stop there is a time delta before the test is explictly - killed. By changing this the time can be extended in case the process needs - more time to cleanly exit on its own. - """ - return 3.0 - # # PROTECTED ROUTINES # diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py index 7106a20f5..64ba6003b 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py @@ -173,6 +173,10 @@ class ChromiumAndroidPort(chromium.ChromiumPort): # marked as slow tests on desktop platforms. return 10 * 1000 + def driver_stop_timeout(self): + # DRT doesn't respond to closing stdin, so we might as well stop the driver immediately. + return 0.0 + def default_child_processes(self): return len(self._get_devices()) @@ -262,7 +266,9 @@ class ChromiumAndroidPort(chromium.ChromiumPort): def create_driver(self, worker_number, no_timeout=False): # We don't want the default DriverProxy which is not compatible with our driver. # See comments in ChromiumAndroidDriver.start(). - return ChromiumAndroidDriver(self, worker_number, pixel_tests=self.get_option('pixel_tests'), no_timeout=no_timeout) + return ChromiumAndroidDriver(self, worker_number, pixel_tests=self.get_option('pixel_tests'), + # Force no timeout to avoid DumpRenderTree timeouts before NRWT. + no_timeout=True) def driver_cmd_line(self): # Override to return the actual DumpRenderTree command line. @@ -545,13 +551,13 @@ class ChromiumAndroidDriver(driver.Driver): not self._file_exists_on_device(self._out_fifo_path) and not self._file_exists_on_device(self._err_fifo_path)) - def run_test(self, driver_input): + def run_test(self, driver_input, stop_when_done): base = self._port.lookup_virtual_test_base(driver_input.test_name) if base: driver_input = copy.copy(driver_input) driver_input.args = self._port.lookup_virtual_test_args(driver_input.test_name) driver_input.test_name = base - return super(ChromiumAndroidDriver, self).run_test(driver_input) + return super(ChromiumAndroidDriver, self).run_test(driver_input, stop_when_done) def start(self, pixel_tests, per_test_args): # Only one driver instance is allowed because of the nature of Android activity. @@ -657,15 +663,10 @@ class ChromiumAndroidDriver(driver.Driver): self._read_stderr_process.kill() self._read_stderr_process = None - # Stop and kill server_process because our pipe reading/writing processes won't quit - # by itself on close of the pipes. - if self._server_process: - self._server_process.stop(kill_directly=True) - self._server_process = None super(ChromiumAndroidDriver, self).stop() if self._forwarder_process: - self._forwarder_process.stop(kill_directly=True) + self._forwarder_process.kill() self._forwarder_process = None if not ChromiumAndroidDriver._loop_with_timeout(self._remove_all_pipes, DRT_START_STOP_TIMEOUT_SECS): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver.py b/Tools/Scripts/webkitpy/layout_tests/port/driver.py index 85049970b..c343c570d 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/driver.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/driver.py @@ -136,7 +136,7 @@ class Driver(object): def __del__(self): self.stop() - def run_test(self, driver_input): + def run_test(self, driver_input, stop_when_done): """Run a single test and return the results. Note that it is okay if a test times out or crashes and leaves @@ -158,14 +158,27 @@ class Driver(object): text, audio = self._read_first_block(deadline) # First block is either text or audio image, actual_image_hash = self._read_optional_image_block(deadline) # The second (optional) block is image data. - # We may not have read all of the output if an error (crash) occured. - # Since some platforms output the stacktrace over error, we should - # dump any buffered error into self.error_from_test. - # FIXME: We may need to also read stderr until the process dies? - self.error_from_test += self._server_process.pop_all_buffered_stderr() + crashed = self.has_crashed() + timed_out = self._server_process.timed_out + if text and ('Timed out waiting for final message from web process' in text): + # FIXME: This is a hack to work around the issues in https://bugs.webkit.org/show_bug.cgi?id=94505. + # We need to either fix the underlying problem in WTR or return a more canonical error. + if not timed_out: + _log.warning("webprocess timed out but WTR didn't, killing WTR") + timed_out = True + else: + _log.warning("webprocess timed out and so did WTR") + + if stop_when_done or crashed or timed_out: + # We call stop() even if we crashed or timed out in order to get any remaining stdout/stderr output. + # In the timeout case, we kill the hung process as well. + out, err = self._server_process.stop(self._port.driver_stop_timeout() if stop_when_done else 0.0) + text += out + self.error_from_test += err + self._server_process = None crash_log = None - if self.has_crashed(): + if crashed: self.error_from_test, crash_log = self._get_crash_log(text, self.error_from_test, newer_than=start_time) # If we don't find a crash log use a placeholder error message instead. @@ -175,15 +188,9 @@ class Driver(object): if self._subprocess_was_unresponsive: crash_log += ' Process failed to become responsive before timing out.' - timeout = self._server_process.timed_out - if timeout: - # DRT doesn't have a built in timer to abort the test, so we might as well - # kill the process directly and not wait for it to shut down cleanly (since it may not). - self._server_process.kill() - return DriverOutput(text, image, actual_image_hash, audio, - crash=self.has_crashed(), test_time=time.time() - test_begin_time, - timeout=timeout, error=self.error_from_test, + crash=crashed, test_time=time.time() - test_begin_time, + timeout=timed_out, error=self.error_from_test, crashed_process_name=self._crashed_process_name, crashed_pid=self._crashed_pid, crash_log=crash_log) @@ -273,7 +280,7 @@ class Driver(object): def stop(self): if self._server_process: - self._server_process.stop() + self._server_process.stop(self._port.driver_stop_timeout()) self._server_process = None if self._driver_tempdir: @@ -476,20 +483,20 @@ class DriverProxy(object): def uri_to_test(self, uri): return self._driver.uri_to_test(uri) - def run_test(self, driver_input): + def run_test(self, driver_input, stop_when_done): base = self._port.lookup_virtual_test_base(driver_input.test_name) if base: virtual_driver_input = copy.copy(driver_input) virtual_driver_input.test_name = base virtual_driver_input.args = self._port.lookup_virtual_test_args(driver_input.test_name) - return self.run_test(virtual_driver_input) + return self.run_test(virtual_driver_input, stop_when_done) pixel_tests_needed = driver_input.should_run_pixel_test cmd_line_key = self._cmd_line_as_key(pixel_tests_needed, driver_input.args) if not cmd_line_key in self._running_drivers: self._running_drivers[cmd_line_key] = self._make_driver(pixel_tests_needed) - return self._running_drivers[cmd_line_key].run_test(driver_input) + return self._running_drivers[cmd_line_key].run_test(driver_input, stop_when_done) def start(self): # FIXME: Callers shouldn't normally call this, since this routine diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py index 5e2019b1b..2457c2ca0 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py @@ -182,7 +182,7 @@ class DriverTest(unittest.TestCase): def has_crashed(self): return self.crashed - def stop(self): + def stop(self, timeout): pass def assert_crash(driver, error_line, crashed, name, pid, unresponsive=False): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl.py b/Tools/Scripts/webkitpy/layout_tests/port/efl.py index e5635744d..9301c4334 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/efl.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/efl.py @@ -94,6 +94,16 @@ class EflPort(Port, PulseAudioSanitizer): dyn_path = self._build_path('lib', 'libwebcore_efl.so') return static_path if self._filesystem.exists(static_path) else dyn_path + def _search_paths(self): + search_paths = [] + if self.get_option('webkit_test_runner'): + search_paths.append(self.port_name + '-wk2') + search_paths.append(self.port_name) + return search_paths + + def expectations_files(self): + return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self._search_paths()])) + def show_results_html_file(self, results_filename): # FIXME: We should find a way to share this implmentation with Gtk, # or teach run-launcher how to call run-safari and move this down to WebKitPort. diff --git a/Tools/Scripts/webkitpy/layout_tests/port/server_process.py b/Tools/Scripts/webkitpy/layout_tests/port/server_process.py index aa1e3024f..b772323b5 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/server_process.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/server_process.py @@ -140,7 +140,7 @@ class ServerProcess(object): try: self._proc.stdin.write(bytes) except IOError, e: - self.stop() + self.stop(0.0) # stop() calls _reset(), so we have to set crashed to True after calling stop(). self._crashed = True @@ -213,12 +213,12 @@ class ServerProcess(object): output, self._error = self._split_string_after_index(self._error, bytes_count) return output - def _wait_for_data_and_update_buffers_using_select(self, deadline): + def _wait_for_data_and_update_buffers_using_select(self, deadline, stopping=False): out_fd = self._proc.stdout.fileno() err_fd = self._proc.stderr.fileno() select_fds = (out_fd, err_fd) try: - read_fds, _, _ = select.select(select_fds, [], select_fds, deadline - time.time()) + read_fds, _, _ = select.select(select_fds, [], select_fds, max(deadline - time.time(), 0)) except select.error, e: # We can ignore EINVAL since it's likely the process just crashed and we'll # figure that out the next time through the loop in _read(). @@ -229,16 +229,22 @@ class ServerProcess(object): try: if out_fd in read_fds: data = self._proc.stdout.read() - if not data: - _log.warning('unexpected EOF of stdout') - self._crashed = True + if not data and not stopping: + if self._proc.poll() is not None: + _log.warning('unexpected EOF of stdout, %s crashed' % self._name) + self._crashed = True + else: + _log.warning('unexpected EOF of stdout, %s still alive' % self._name) self._output += data if err_fd in read_fds: data = self._proc.stderr.read() - if not data: - _log.warning('unexpected EOF of stderr') - self._crashed = True + if not data and not stopping: + if self._proc.poll() is not None: + _log.warning('unexpected EOF on stderr, %s crashed' % self._name) + self._crashed = True + else: + _log.warning('unexpected EOF on stderr, %s is still alive' % self._name) self._error += data except IOError, e: # We can ignore the IOErrors because we will detect if the subporcess crashed @@ -307,41 +313,44 @@ class ServerProcess(object): if not self._proc: self._start() - def stop(self, kill_directly=False): + def stop(self, timeout_secs=3.0): if not self._proc: - return + return (None, None) - # Only bother to check for leaks if the process is still running. + # Only bother to check for leaks or stderr if the process is still running. if self.poll() is None: self._port.check_for_leaks(self.name(), self.pid()) + now = time.time() self._proc.stdin.close() - self._proc.stdout.close() - if self._proc.stderr: - self._proc.stderr.close() - - if kill_directly: - self.kill() + if not timeout_secs: + self._kill() elif not self._host.platform.is_win(): - # Closing stdin/stdout/stderr hangs sometimes on OS X, - # and anyway we don't want to hang the harness if DumpRenderTree - # is buggy, so we wait a couple seconds to give DumpRenderTree a - # chance to clean up, but then force-kill the process if necessary. - timeout = time.time() + self._port.process_kill_time() - while self._proc.poll() is None and time.time() < timeout: + # FIXME: Why aren't we calling this on win? + 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() + self._kill() _log.warning('killed') + + # read any remaining data on the pipes and return it. + if self._use_win32_apis: + self._wait_for_data_and_update_buffers_using_win32_apis(now) + else: + self._wait_for_data_and_update_buffers_using_select(now, stopping=True) + out, err = self._output, self._error self._reset() + return (out, err) def kill(self): - if self._proc: - self._host.executive.kill_process(self._proc.pid) - if self._proc.poll() is not None: - self._proc.wait() - self._reset() + self.stop(0.0) + + def _kill(self): + self._host.executive.kill_process(self._proc.pid) + if self._proc.poll() is not None: + self._proc.wait() def replace_outputs(self, stdout, stderr): assert self._proc diff --git a/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py index db38615e0..48c41e6f2 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py @@ -41,6 +41,8 @@ from webkitpy.common.system.outputcapture import OutputCapture class TrivialMockPort(object): def __init__(self): self.host = MockSystemHost() + self.host.executive.kill_process = lambda x: None + self.host.executive.kill_process = lambda x: None def results_directory(self): return "/mock-results" @@ -77,6 +79,9 @@ class MockProc(object): def poll(self): return 1 + def wait(self): + return 0 + class FakeServerProcess(server_process.ServerProcess): def _start(self): @@ -114,7 +119,7 @@ class TestServerProcess(unittest.TestCase): if line: self.assertEquals(line.strip(), "stderr") - proc.stop() + proc.stop(0) def test_broken_pipe(self): port_obj = TrivialMockPort() diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py index 6302120d2..cccb9ac1d 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/test.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py @@ -525,7 +525,7 @@ class TestDriver(Driver): pixel_tests_flag = '-p' if pixel_tests else '' return [self._port._path_to_driver()] + [pixel_tests_flag] + self._port.get_option('additional_drt_flag', []) + per_test_args - def run_test(self, test_input): + def run_test(self, test_input, stop_when_done): start_time = time.time() test_name = test_input.test_name test_args = test_input.args or [] @@ -563,6 +563,9 @@ class TestDriver(Driver): crash_logs = CrashLogs(self._port.host) crash_log = crash_logs.find_newest_log(crashed_process_name, None) or '' + if stop_when_done: + self.stop() + return DriverOutput(actual_text, test.actual_image, test.actual_checksum, audio, crash=test.crash or test.web_process_crash, crashed_process_name=crashed_process_name, crashed_pid=crashed_pid, crash_log=crash_log, diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index 06b3032ff..ddb0105c2 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -331,6 +331,8 @@ def parse_args(args=None): optparse.make_option("--additional-expectations", action="append", default=[], help="Path to a test_expectations file that will override previous expectations. " "Specify multiple times for multiple sets of overrides."), + optparse.make_option("--compare-port", action="store", default=None, + help="Use the specified port's baselines first"), optparse.make_option("--no-show-results", action="store_false", default=True, dest="show_results", help="Don't launch a browser with results after the tests " 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 ecb58b89d..1f35857c4 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py @@ -147,7 +147,7 @@ def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False, def stop(self): self._current_test_batch = None - def run_test(self, test_input): + def run_test(self, test_input, stop_when_done): if self._current_test_batch is None: self._current_test_batch = [] test_batches.append(self._current_test_batch) @@ -159,7 +159,7 @@ def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False, dirname, filename = filesystem.split(test_name) if include_reference_html or not Port.is_reference_html_file(filesystem, dirname, filename): self._current_test_batch.append(test_name) - return TestDriver.run_test(self, test_input) + return TestDriver.run_test(self, test_input, stop_when_done) class RecordingTestPort(TestPort): def create_driver(self, worker_number): diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest.py b/Tools/Scripts/webkitpy/performance_tests/perftest.py index b111c9b4b..8ef945893 100644 --- a/Tools/Scripts/webkitpy/performance_tests/perftest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftest.py @@ -74,7 +74,7 @@ class PerfTest(object): return self.parse_output(output) def run_single(self, driver, path_or_url, time_out_ms, should_run_pixel_test=False): - return driver.run_test(DriverInput(path_or_url, time_out_ms, image_hash=None, should_run_pixel_test=should_run_pixel_test)) + return driver.run_test(DriverInput(path_or_url, time_out_ms, image_hash=None, should_run_pixel_test=should_run_pixel_test), stop_when_done=False) def run_failed(self, output): if output.text == None or output.error: @@ -112,7 +112,7 @@ class PerfTest(object): return False _description_regex = re.compile(r'^Description: (?P<description>.*)$', re.IGNORECASE) - _result_classes = ['Time', 'JS Heap', 'FastMalloc'] + _result_classes = ['Time', 'JS Heap', 'Malloc'] _result_class_regex = re.compile(r'^(?P<resultclass>' + r'|'.join(_result_classes) + '):') _statistics_keys = ['avg', 'median', 'stdev', 'min', 'max', 'unit'] _score_regex = re.compile(r'^(?P<key>' + r'|'.join(_statistics_keys) + r')\s+(?P<value>[0-9\.]+)\s*(?P<unit>.*)') diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py index 47fe6231c..3b7c609ce 100755 --- a/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py @@ -99,7 +99,7 @@ class TestPageLoadingPerfTest(unittest.TestCase): self._values = values self._index = 0 - def run_test(self, input): + def run_test(self, input, stop_when_done): value = self._values[self._index] self._index += 1 if isinstance(value, str): @@ -141,8 +141,8 @@ class TestReplayPerfTest(unittest.TestCase): def __init__(self, custom_run_test=None): class ReplayTestDriver(TestDriver): - def run_test(self, text_input): - return custom_run_test(text_input) if custom_run_test else None + def run_test(self, text_input, stop_when_done): + return custom_run_test(text_input, stop_when_done) if custom_run_test else None self._custom_driver_class = ReplayTestDriver super(self.__class__, self).__init__(host=MockHost()) @@ -174,7 +174,7 @@ class TestReplayPerfTest(unittest.TestCase): loaded_pages = [] - def run_test(test_input): + def run_test(test_input, stop_when_done): if test_input.test_name != "about:blank": self.assertEqual(test_input.test_name, 'http://some-test/') loaded_pages.append(test_input) @@ -243,7 +243,7 @@ class TestReplayPerfTest(unittest.TestCase): loaded_pages = [] - def run_test(test_input): + def run_test(test_input, stop_when_done): loaded_pages.append(test_input) self._add_file(port, '/path/some-dir', 'some-test.wpr', 'wpr content') return DriverOutput('actual text', 'actual image', 'actual checksum', @@ -270,7 +270,7 @@ class TestReplayPerfTest(unittest.TestCase): output_capture = OutputCapture() output_capture.capture_output() - def run_test(test_input): + def run_test(test_input, stop_when_done): self._add_file(port, '/path/some-dir', 'some-test.wpr', 'wpr content') return DriverOutput('actual text', 'actual image', 'actual checksum', audio=None, crash=False, timeout=False, error=False) diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py index ef459cd69..7e2f05ecd 100755 --- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py @@ -49,7 +49,7 @@ class MainTest(unittest.TestCase): self.assertEquals(stream.buflist, contents) class TestDriver: - def run_test(self, driver_input): + def run_test(self, driver_input, stop_when_done): text = '' timeout = False crash = False @@ -123,7 +123,7 @@ stdev 15000 bytes min 811000 bytes max 848000 bytes -FastMalloc: +Malloc: avg 532000 bytes median 529000 bytes stdev 13000 bytes @@ -274,13 +274,13 @@ max 548000 bytes 'median= 1101.0 ms, stdev= 11.0 ms, min= 1080.0 ms, max= 1120.0 ms', 'RESULT Parser: memory-test: JSHeap= 832000.0 bytes', 'median= 829000.0 bytes, stdev= 15000.0 bytes, min= 811000.0 bytes, max= 848000.0 bytes', - 'RESULT Parser: memory-test: FastMalloc= 532000.0 bytes', + 'RESULT Parser: memory-test: Malloc= 532000.0 bytes', 'median= 529000.0 bytes, stdev= 13000.0 bytes, min= 511000.0 bytes, max= 548000.0 bytes', '', ''])) results = runner.load_output_json()[0]['results'] self.assertEqual(results['Parser/memory-test'], {'min': 1080.0, 'max': 1120.0, 'median': 1101.0, 'stdev': 11.0, 'avg': 1100.0, 'unit': 'ms'}) self.assertEqual(results['Parser/memory-test:JSHeap'], {'min': 811000.0, 'max': 848000.0, 'median': 829000.0, 'stdev': 15000.0, 'avg': 832000.0, 'unit': 'bytes'}) - self.assertEqual(results['Parser/memory-test:FastMalloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes'}) + self.assertEqual(results['Parser/memory-test:Malloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes'}) def _test_run_with_json_output(self, runner, filesystem, upload_suceeds=True, expected_exit_code=0): filesystem.write_text_file(runner._base_path + '/inspector/pass.html', 'some content') diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py index 78cd88250..45c49aab4 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py @@ -2747,6 +2747,10 @@ def check_include_line(filename, file_extension, clean_lines, line_number, inclu error(line_number, 'build/include', 4, 'wtf includes should be <wtf/file.h> instead of "wtf/file.h".') + if filename.find('/chromium/') != -1 and include.startswith('cc/CC'): + error(line_number, 'build/include', 4, + 'cc includes should be "CCFoo.h" instead of "cc/CCFoo.h".') + duplicate_header = include in include_state if duplicate_header: error(line_number, 'build/include', 4, diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py index 339897fe8..a5a94b793 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py @@ -2736,6 +2736,15 @@ class OrderOfIncludesTest(CppStyleTestBase): 'wtf includes should be <wtf/file.h> instead of "wtf/file.h".' ' [build/include] [4]') + def test_check_cc_includes(self): + self.assert_language_rules_check('bar/chromium/foo.cpp', + '#include "config.h"\n' + '#include "foo.h"\n' + '\n' + '#include "cc/CCProxy.h"\n', + 'cc includes should be "CCFoo.h" instead of "cc/CCFoo.h".' + ' [build/include] [4]') + def test_classify_include(self): classify_include = cpp_style._classify_include include_state = cpp_style._IncludeState() diff --git a/Tools/Scripts/webkitpy/tool/commands/perfalizer.py b/Tools/Scripts/webkitpy/tool/commands/perfalizer.py index b9fc6fe5b..ae9f63a65 100644 --- a/Tools/Scripts/webkitpy/tool/commands/perfalizer.py +++ b/Tools/Scripts/webkitpy/tool/commands/perfalizer.py @@ -72,7 +72,7 @@ class PerfalizerTask(PatchAnalysisTask): head_revision = self._tool.scm().head_svn_revision() self._logger('Building WebKit at r%s without the patch' % head_revision) - if not self._build(): + if not self._build_without_patch(): return False if not self._port.check_build(needs_http=False): @@ -96,11 +96,11 @@ class PerfalizerTask(PatchAnalysisTask): filesystem.remove(self._json_path()) self._logger("Running performance tests...") - if self._run_perf_test(self._build_directory_without_patch) < 0: + if self._run_perf_test(self._build_directory_without_patch, 'without %d' % self._patch.id()) < 0: self._logger('Failed to run performance tests without the patch.') return False - if self._run_perf_test(self._build_directory) < 0: + if self._run_perf_test(self._build_directory, 'with %d' % self._patch.id()) < 0: self._logger('Failed to run performance tests with the patch.') return False @@ -129,11 +129,11 @@ class PerfalizerTask(PatchAnalysisTask): def _results_page_path(self): return self._tool.filesystem.join(self._build_directory, 'PerformanceTestResults.html') - def _run_perf_test(self, build_path): + def _run_perf_test(self, build_path, description): filesystem = self._tool.filesystem script_path = filesystem.join(filesystem.dirname(self._tool.path()), 'run-perf-tests') perf_test_runner_args = [script_path, '--no-build', '--no-show-results', '--build-directory', build_path, - '--output-json-path', self._json_path()] + '--output-json-path', self._json_path(), '--description', description] return self._tool.executive.run_and_throw_if_fail(perf_test_runner_args, cwd=self._tool.scm().checkout_root) def run_command(self, command): diff --git a/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py b/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py index f519e3f78..feb7b05b3 100644 --- a/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py @@ -50,7 +50,8 @@ class PerfalizerTaskTest(unittest.TestCase): if args[0] in commands_to_fail: raise ScriptError - def run_perf_test(build_path): + def run_perf_test(build_path, description): + self.assertTrue(description == 'without 10000' or description == 'with 10000') if 'run-perf-tests' in commands_to_fail: return -1 if 'results-page' not in commands_to_fail: diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py index 09b45ba55..115249916 100644 --- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py @@ -217,8 +217,8 @@ class PrintExpectationsTest(unittest.TestCase): def test_csv(self): self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], - ('test-win-xp,failures/expected/image.html,wontfix,image\n' - 'test-win-xp,failures/expected/text.html,wontfix,text\n'), + ('test-win-xp,failures/expected/image.html,WONTFIX,IMAGE\n' + 'test-win-xp,failures/expected/text.html,WONTFIX,TEXT\n'), csv=True) diff --git a/Tools/TestResultServer/static-dashboards/builders.js b/Tools/TestResultServer/static-dashboards/builders.js index f6dbdf564..044f94795 100644 --- a/Tools/TestResultServer/static-dashboards/builders.js +++ b/Tools/TestResultServer/static-dashboards/builders.js @@ -52,14 +52,19 @@ CHROMIUM_LINUX_BUILDER_MASTER = new BuilderMaster('ChromiumLinux', 'http://build CHROMIUMOS_BUILDER_MASTER = new BuilderMaster('ChromiumChromiumOS', 'http://build.chromium.org/p/chromium.chromiumos/'); CHROMIUM_GPU_BUILDER_MASTER = new BuilderMaster('ChromiumGPU', 'http://build.chromium.org/p/chromium.gpu/'); CHROMIUM_GPU_FYI_BUILDER_MASTER = new BuilderMaster('ChromiumGPUFYI', 'http://build.chromium.org/p/chromium.gpu.fyi/'); +CHROMIUM_PERF_AV_BUILDER_MASTER = new BuilderMaster('ChromiumPerfAv', 'http://build.chromium.org/p/chromium.perf_av/'); CHROMIUM_WEBKIT_BUILDER_MASTER = new BuilderMaster('ChromiumWebkit', 'http://build.chromium.org/p/chromium.webkit/'); WEBKIT_BUILDER_MASTER = new BuilderMaster('webkit.org', 'http://build.webkit.org/'); var LEGACY_BUILDER_MASTERS_TO_GROUPS = { 'Chromium': '@DEPS - chromium.org', + 'ChromiumWin': '@DEPS - chromium.org', + 'ChromiumMac': '@DEPS - chromium.org', + 'ChromiumLinux': '@DEPS - chromium.org', 'ChromiumChromiumOS': '@DEPS CrOS - chromium.org', 'ChromiumGPU': '@DEPS - chromium.org', 'ChromiumGPUFYI': '@DEPS FYI - chromium.org', + 'ChromiumPerfAv': '@DEPS - chromium.org', 'ChromiumWebkit': '@ToT - chromium.org', 'webkit.org': '@ToT - webkit.org' }; @@ -131,11 +136,11 @@ function doXHR(url, onLoad, builderGroups, groupName) xhr.send(); } -function requestBuilderList(builderGroups, builderFilter, master, groupName, groupEnum, builderGroup) +function requestBuilderList(builderGroups, builderFilter, master, groupName, builderGroup) { if (!builderGroups[groupName]) builderGroups[groupName] = builderGroup; - var onLoad = partial(onBuilderListLoad, builderGroups, builderFilter, master, groupName, groupEnum); + var onLoad = partial(onBuilderListLoad, builderGroups, builderFilter, master, groupName); doXHR(master.builderJsonPath(), onLoad, builderGroups, groupName); builderGroups[groupName].expectedGroups += 1; } @@ -167,7 +172,7 @@ function isWebkitTestRunner(builder) function isChromiumWebkitTipOfTreeTestRunner(builder) { - return builder.indexOf('Webkit') != -1 && builder.indexOf('Builder') == -1 && builder.indexOf('(deps)') == -1 && builder.indexOf('ASAN') == -1; + return (builder.indexOf('Webkit') != -1 && builder.indexOf('Builder') == -1 && builder.indexOf('(deps)') == -1 && builder.indexOf('ASAN') == -1) || builder.indexOf('(Content Shell)') != -1; } function isChromiumWebkitDepsTestRunner(builder) @@ -191,6 +196,11 @@ function isChromiumTipOfTreeGTestRunner(builder) builder.indexOf('Webkit') == -1 && builder.indexOf('Valgrind') == -1 && builder.indexOf('Chrome Frame') == -1; } +function isChromiumDepsAVTestRunner(builder) +{ + return builder.indexOf('Builder') == -1; +} + function generateBuildersFromBuilderList(builderList, filter) { return builderList.filter(filter).map(function(tester, index) { @@ -201,7 +211,7 @@ function generateBuildersFromBuilderList(builderList, filter) }); } -function onBuilderListLoad(builderGroups, builderFilter, master, groupName, groupEnum, json) +function onBuilderListLoad(builderGroups, builderFilter, master, groupName, json) { var builders = generateBuildersFromBuilderList(Object.keys(json), builderFilter); associateBuildersWithMaster(builders, master); @@ -223,17 +233,17 @@ function loadBuildersList(groupName, testType) { switch(groupName) { case '@DEPS - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT); - requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsGpuTestRunner, CHROMIUM_GPU_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); + requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsGpuTestRunner, CHROMIUM_GPU_BUILDER_MASTER, groupName, builderGroup); break; case '@DEPS FYI - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT); - requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsFyiGpuTestRunner, CHROMIUM_GPU_FYI_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); + requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumDepsFyiGpuTestRunner, CHROMIUM_GPU_FYI_BUILDER_MASTER, groupName, builderGroup); break; case '@ToT - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT); - requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumTipOfTreeGpuTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup); + requestBuilderList(CHROMIUM_GPU_TESTS_BUILDER_GROUPS, isChromiumTipOfTreeGpuTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup); break; } break; @@ -242,17 +252,18 @@ function loadBuildersList(groupName, testType) { switch(groupName) { case '@ToT - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT); - requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup); + requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitTipOfTreeTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup); break; case '@ToT - webkit.org': var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT); - requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isWebkitTestRunner, WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup); + requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isWebkitTestRunner, WEBKIT_BUILDER_MASTER, groupName, builderGroup); break; case '@DEPS - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT); - requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitDepsTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); + requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumWebkitDepsTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup); + requestBuilderList(LAYOUT_TESTS_BUILDER_GROUPS, isChromiumDepsAVTestRunner, CHROMIUM_PERF_AV_BUILDER_MASTER, groupName, builderGroup); break; } break; @@ -261,20 +272,20 @@ function loadBuildersList(groupName, testType) { switch(groupName) { case '@DEPS - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT); - requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); - requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_WIN_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); - requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_MAC_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); - requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_LINUX_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); + requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_BUILDER_MASTER, groupName, builderGroup); + requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_WIN_BUILDER_MASTER, groupName, builderGroup); + requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_MAC_BUILDER_MASTER, groupName, builderGroup); + requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsGTestRunner, CHROMIUM_LINUX_BUILDER_MASTER, groupName, builderGroup); break; case '@DEPS CrOS - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.DEPS_WEBKIT); - requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsCrosGTestRunner, CHROMIUMOS_BUILDER_MASTER, groupName, BuilderGroup.DEPS_WEBKIT, builderGroup); + requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumDepsCrosGTestRunner, CHROMIUMOS_BUILDER_MASTER, groupName, builderGroup); break; case '@ToT - chromium.org': var builderGroup = new BuilderGroup(BuilderGroup.TOT_WEBKIT); - requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumTipOfTreeGTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, BuilderGroup.TOT_WEBKIT, builderGroup); + requestBuilderList(CHROMIUM_GTESTS_BUILDER_GROUPS, isChromiumTipOfTreeGTestRunner, CHROMIUM_WEBKIT_BUILDER_MASTER, groupName, builderGroup); break; } break; diff --git a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js index fec4c4d2c..32d2af225 100644 --- a/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js +++ b/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js @@ -523,9 +523,10 @@ test('generateChromiumWebkitTipOfTreeBuildersFromBuilderList', 1, function() { "Linux Valgrind", "Mac Builder (dbg)", "Mac10.6 Perf", "Mac10.6 Tests", "Vista Perf", "Vista Tests", "Webkit Linux", "Webkit Linux ASAN", "Webkit Linux (dbg)", "Webkit Linux (deps)", "Webkit Linux 32", "Webkit Mac Builder", "Webkit Mac Builder (dbg)", "Webkit Mac Builder (deps)", "Webkit Mac10.6", "Webkit Mac10.6 (dbg)", "Webkit Mac10.6 (deps)", "Webkit Mac10.7", "Webkit Win", "Webkit Win (dbg)(1)", "Webkit Win (dbg)(2)", "Webkit Win (deps)", "Webkit Win Builder", "Webkit Win Builder (dbg)", - "Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder"]; + "Webkit Win Builder (deps)", "Webkit Win7", "Win (dbg)", "Win Builder", + "Linux (Content Shell)"]; var expectedBuilders = [["Webkit Linux", 2], ["Webkit Linux (dbg)"], ["Webkit Linux 32"], ["Webkit Mac10.6"], - ["Webkit Mac10.6 (dbg)"], ["Webkit Mac10.7"], ["Webkit Win"], ["Webkit Win (dbg)(1)"], ["Webkit Win (dbg)(2)"], ["Webkit Win7"]]; + ["Webkit Mac10.6 (dbg)"], ["Webkit Mac10.7"], ["Webkit Win"], ["Webkit Win (dbg)(1)"], ["Webkit Win (dbg)(2)"], ["Webkit Win7"], ["Linux (Content Shell)"]]; deepEqual(generateBuildersFromBuilderList(builderList, isChromiumWebkitTipOfTreeTestRunner), expectedBuilders); }); diff --git a/Tools/TestWebKitAPI/PlatformEfl.cmake b/Tools/TestWebKitAPI/PlatformEfl.cmake index 4c4c90284..62f865ce5 100644 --- a/Tools/TestWebKitAPI/PlatformEfl.cmake +++ b/Tools/TestWebKitAPI/PlatformEfl.cmake @@ -8,7 +8,7 @@ ADD_CUSTOM_TARGET(forwarding-headersSoupForTestWebKitAPI ) SET(ForwardingNetworkHeadersForTestWebKitAPI_NAME forwarding-headersSoupForTestWebKitAPI) -INCLUDE_DIRECTORIES(${LIBSOUP24_INCLUDE_DIRS} +INCLUDE_DIRECTORIES(${LIBSOUP_INCLUDE_DIRS} ${WEBKIT2_DIR}/UIProcess/API/C/soup ${WEBKIT2_DIR}/UIProcess/API/C/efl ${ECORE_INCLUDE_DIRS} diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp b/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp index e84386f18..819a79d0d 100644 --- a/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp +++ b/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp @@ -107,6 +107,13 @@ 'input_jars_paths': [ '<(PRODUCT_DIR)/lib.java/chromium_base.jar', ], + 'conditions': [ + ['inside_chromium_build==1', { + 'ant_build_to_chromium_src': '<(ant_build_out)/../../', + }, { + 'ant_build_to_chromium_src': '<(chromium_src_dir)', + }], + ], }, # Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi. # Not including it because gyp include doesn't support variable in path or under @@ -131,6 +138,7 @@ '"<@(input_jars_paths)"', '--output', '<(PRODUCT_DIR)/TestWebKitAPI_apk', + '--strip-binary=<(android_strip)', '--ant-args', '-DANDROID_SDK=<(android_sdk)', '--ant-args', @@ -143,6 +151,8 @@ '-DANDROID_TOOLCHAIN=<(android_toolchain)', '--ant-args', '-DPRODUCT_DIR=<(ant_build_out)', + '--ant-args', + '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)', '--sdk-build=<(sdk_build)', '--app_abi', '<(android_app_abi)', diff --git a/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp b/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp index 3f02a0f67..d6d48fc61 100644 --- a/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp +++ b/Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp @@ -149,7 +149,7 @@ TEST(WTF, MediaTime) EXPECT_EQ(MediaTime(3, 2).toDouble(), 1.5); EXPECT_EQ(MediaTime(1, 1 << 16).toFloat(), 1 / pow(2.0f, 16.0f)); EXPECT_EQ(MediaTime(1, 1 << 30).toDouble(), 1 / pow(2.0, 30.0)); - EXPECT_EQ(MediaTime::createWithDouble(M_PI, 1 << 30), MediaTime(3373259426, 1 << 30)); + EXPECT_EQ(MediaTime::createWithDouble(M_PI, 1 << 30), MediaTime(3373259426U, 1 << 30)); EXPECT_EQ(MediaTime::createWithFloat(INFINITY), MediaTime::positiveInfiniteTime()); EXPECT_EQ(MediaTime::createWithFloat(-INFINITY), MediaTime::negativeInfiniteTime()); EXPECT_EQ(MediaTime::createWithFloat(NAN), MediaTime::invalidTime()); diff --git a/Tools/Tools.pro b/Tools/Tools.pro index 9590c53a9..749013c34 100644 --- a/Tools/Tools.pro +++ b/Tools/Tools.pro @@ -9,13 +9,13 @@ CONFIG += ordered !no_webkit1 { SUBDIRS += QtTestBrowser/QtTestBrowser.pro - SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro + contains(DEFINES, HAVE_QTTESTLIB=1): SUBDIRS += DumpRenderTree/qt/DumpRenderTree.pro SUBDIRS += DumpRenderTree/qt/ImageDiff.pro } !no_webkit2 { # WTR's InjectedBundle depends currently on WK1's DumpRenderTreeSupport - !no_webkit1:contains(DEFINES, HAVE_QTQUICK=1): SUBDIRS += WebKitTestRunner/WebKitTestRunner.pro + !no_webkit1:contains(DEFINES, HAVE_QTQUICK=1):contains(DEFINES, HAVE_QTTESTLIB=1): SUBDIRS += WebKitTestRunner/WebKitTestRunner.pro contains(DEFINES, HAVE_QTQUICK=1): SUBDIRS += MiniBrowser/qt/MiniBrowser.pro SUBDIRS += MiniBrowser/qt/raw/MiniBrowserRaw.pro diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt index badc2c471..4950fd9a9 100644 --- a/Tools/WebKitTestRunner/CMakeLists.txt +++ b/Tools/WebKitTestRunner/CMakeLists.txt @@ -42,7 +42,7 @@ SET(WebKitTestRunner_INCLUDE_DIRECTORIES ${DERIVED_SOURCES_DIR}/InjectedBundle ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Source - ${LIBSOUP24_INCLUDE_DIRS} + ${LIBSOUP_INCLUDE_DIRS} ) SET(WebKitTestRunnerInjectedBundle_SOURCES @@ -55,7 +55,7 @@ SET(WebKitTestRunnerInjectedBundle_SOURCES ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundle.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundleMain.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundlePage.cpp - ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/LayoutTestController.cpp + ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TestRunner.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TextInputController.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp diff --git a/Tools/WebKitTestRunner/DerivedSources.make b/Tools/WebKitTestRunner/DerivedSources.make index 187d41c4f..501df5911 100644 --- a/Tools/WebKitTestRunner/DerivedSources.make +++ b/Tools/WebKitTestRunner/DerivedSources.make @@ -32,7 +32,7 @@ INTERFACES = \ AccessibilityUIElement \ EventSendingController \ GCController \ - LayoutTestController \ + TestRunner \ TextInputController \ # diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am index 723ce77ee..85ad427de 100644 --- a/Tools/WebKitTestRunner/GNUmakefile.am +++ b/Tools/WebKitTestRunner/GNUmakefile.am @@ -72,7 +72,7 @@ webkittestrunner_built_sources += \ DerivedSources/InjectedBundle/JSAccessibilityUIElement.cpp \ DerivedSources/InjectedBundle/JSEventSendingController.cpp \ DerivedSources/InjectedBundle/JSGCController.cpp \ - DerivedSources/InjectedBundle/JSLayoutTestController.cpp \ + DerivedSources/InjectedBundle/JSTestRunner.cpp \ DerivedSources/InjectedBundle/JSTextInputController.cpp nodist_Libraries_libTestRunnerInjectedBundle_la_SOURCES = $(webkittestrunner_built_sources) BUILT_SOURCES += $(webkittestrunner_built_sources) @@ -98,14 +98,14 @@ Libraries_libTestRunnerInjectedBundle_la_SOURCES = \ Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp \ - Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp \ + Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h \ - Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp \ - Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h \ + Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp \ + Tools/WebKitTestRunner/InjectedBundle/TestRunner.h \ Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp \ Tools/WebKitTestRunner/InjectedBundle/TextInputController.h diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl index df608da3a..ff91579e1 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl +++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl @@ -25,7 +25,7 @@ module WTR { - interface LayoutTestController { + interface TestRunner { // The basics. void dumpAsText(in boolean dumpPixels); void dumpChildFramesAsText(); @@ -44,6 +44,7 @@ module WTR { void dumpFullScreenCallbacks(); void dumpFrameLoadCallbacks(); void dumpProgressFinishedCallback(); + void dumpResourceLoadCallbacks(); void dumpResourceResponseMIMETypes(); // Special options. diff --git a/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri b/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri index 07cdc6719..15211830c 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri +++ b/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri @@ -18,7 +18,7 @@ IDL_BINDINGS += \ Bindings/AccessibilityUIElement.idl \ Bindings/EventSendingController.idl \ Bindings/GCController.idl \ - Bindings/LayoutTestController.idl \ + Bindings/TestRunner.idl \ Bindings/TextInputController.idl \ # GENERATOR 1: IDL compiler diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index 002e7f901..a44cc54d6 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -169,19 +169,19 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag return; } if (WKStringIsEqualToUTF8CString(messageName, "CallAddChromeInputFieldCallback")) { - m_layoutTestController->callAddChromeInputFieldCallback(); + m_testRunner->callAddChromeInputFieldCallback(); return; } if (WKStringIsEqualToUTF8CString(messageName, "CallRemoveChromeInputFieldCallback")) { - m_layoutTestController->callRemoveChromeInputFieldCallback(); + m_testRunner->callRemoveChromeInputFieldCallback(); return; } if (WKStringIsEqualToUTF8CString(messageName, "CallFocusWebViewCallback")) { - m_layoutTestController->callFocusWebViewCallback(); + m_testRunner->callFocusWebViewCallback(); return; } if (WKStringIsEqualToUTF8CString(messageName, "CallSetBackingScaleFactorCallback")) { - m_layoutTestController->callSetBackingScaleFactorCallback(); + m_testRunner->callSetBackingScaleFactorCallback(); return; } @@ -211,7 +211,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) m_repaintRects.clear(); m_stringBuilder->clear(); - m_layoutTestController = LayoutTestController::create(); + m_testRunner = TestRunner::create(); m_gcController = GCController::create(); m_eventSendingController = EventSendingController::create(); m_textInputController = TextInputController::create(); @@ -228,7 +228,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) WKBundleRemoveAllUserContent(m_bundle, m_pageGroup); - m_layoutTestController->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); + m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); page()->prepare(); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h index 26bedc45d..5309900da 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h @@ -29,7 +29,7 @@ #include "AccessibilityController.h" #include "EventSendingController.h" #include "GCController.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "TextInputController.h" #include <WebKit2/WKBase.h> #include <WebKit2/WKRetainPtr.h> @@ -57,7 +57,7 @@ public: WKBundleRef bundle() const { return m_bundle; } WKBundlePageGroupRef pageGroup() const { return m_pageGroup; } - LayoutTestController* layoutTestController() { return m_layoutTestController.get(); } + TestRunner* testRunner() { return m_testRunner.get(); } GCController* gcController() { return m_gcController.get(); } EventSendingController* eventSendingController() { return m_eventSendingController.get(); } TextInputController* textInputController() { return m_textInputController.get(); } @@ -115,7 +115,7 @@ private: Vector<OwnPtr<InjectedBundlePage> > m_pages; RefPtr<AccessibilityController> m_accessibilityController; - RefPtr<LayoutTestController> m_layoutTestController; + RefPtr<TestRunner> m_testRunner; RefPtr<GCController> m_gcController; RefPtr<EventSendingController> m_eventSendingController; RefPtr<TextInputController> m_textInputController; diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp index de32cb08d..7d2cb9823 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp @@ -42,6 +42,7 @@ #include <WebKit2/WKBundleNodeHandlePrivate.h> #include <WebKit2/WKBundlePagePrivate.h> #include <WebKit2/WKURLRequest.h> +#include <wtf/HashMap.h> #include <wtf/text/CString.h> #include <wtf/text/StringBuilder.h> @@ -50,8 +51,8 @@ #endif #if ENABLE(WEB_INTENTS) +#include <WebKit2/WKBundleIntent.h> #include <WebKit2/WKBundleIntentRequest.h> -#include <WebKit2/WKIntentData.h> #endif #if ENABLE(WEB_INTENTS_TAG) #include <WebKit2/WKIntentServiceInfo.h> @@ -215,6 +216,58 @@ static WTF::String frameToStr(WKBundleFrameRef frame) return stringBuilder.toString(); } +static inline bool isLocalFileScheme(WKStringRef scheme) +{ + return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "file"); +} + +static const char divider = '/'; + +static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl) +{ + if (!fileUrl) + return String(); + + WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl)); + if (!isLocalFileScheme(schemeString.get())) + return toWTFString(adoptWK(WKURLCopyString(fileUrl))); + + String pathString = toWTFString(adoptWK(WKURLCopyPath(fileUrl))); + WTF::StringBuilder stringBuilder; + + // Remove the leading path from file urls. + const size_t indexBaseName = pathString.reverseFind(divider); + if (indexBaseName != notFound) { + const size_t indexDirName = pathString.reverseFind(divider, indexBaseName - 1); + if (indexDirName != notFound) + stringBuilder.append(pathString.substring(indexDirName + 1, indexBaseName - indexDirName - 1)); + stringBuilder.append(divider); + stringBuilder.append(pathString.substring(indexBaseName + 1)); // Filename. + } else { + stringBuilder.append(divider); + stringBuilder.append(pathString); // Return "/pathString". + } + + return stringBuilder.toString(); +} + +static inline WTF::String urlSuitableForTestResult(WKURLRef fileUrl) +{ + if (!fileUrl) + return String(); + + WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl)); + if (!isLocalFileScheme(schemeString.get())) + return toWTFString(adoptWK(WKURLCopyString(fileUrl))); + + WTF::String urlString = toWTFString(adoptWK(WKURLCopyString(fileUrl))); + const size_t indexBaseName = urlString.reverseFind(divider); + + return (indexBaseName == notFound) ? urlString : urlString.substring(indexBaseName + 1); +} + +static HashMap<uint64_t, String> assignedUrlsCache; + InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) : m_page(page) , m_world(AdoptWK, WKBundleScriptWorldCreateWorld()) @@ -366,6 +419,7 @@ void InjectedBundlePage::resetAfterTest() #else WebCoreTestSupport::resetInternalsObject(context); #endif + assignedUrlsCache.clear(); } // Loader Client Callbacks @@ -396,6 +450,70 @@ static void dumpFrameDescriptionSuitableForTestResult(WKBundleFrameRef frame) InjectedBundle::shared().stringBuilder()->append("\""); } +static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request) +{ + WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); + WKRetainPtr<WKURLRef> firstParty = adoptWK(WKURLRequestCopyFirstPartyForCookies(request)); + WKRetainPtr<WKStringRef> httpMethod = adoptWK(WKURLRequestCopyHTTPMethod(request)); + + InjectedBundle::shared().stringBuilder()->append("<NSURLRequest URL "); + InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get())); + InjectedBundle::shared().stringBuilder()->append(", main document URL "); + InjectedBundle::shared().stringBuilder()->append(urlSuitableForTestResult(firstParty.get())); + InjectedBundle::shared().stringBuilder()->append(", http method "); + + if (WKStringIsEmpty(httpMethod.get())) + InjectedBundle::shared().stringBuilder()->append("(none)"); + else + InjectedBundle::shared().stringBuilder()->append(toWTFString(httpMethod)); + + InjectedBundle::shared().stringBuilder()->append(">"); +} + +static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response) +{ + WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response)); + if (!url) { + InjectedBundle::shared().stringBuilder()->append("(null)"); + return; + } + InjectedBundle::shared().stringBuilder()->append("<NSURLResponse "); + InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get())); + InjectedBundle::shared().stringBuilder()->append(", http status code "); + InjectedBundle::shared().stringBuilder()->append(WTF::String::number(WKURLResponseHTTPStatusCode(response))); + InjectedBundle::shared().stringBuilder()->append(">"); +} + +static inline void dumpErrorDescriptionSuitableForTestResult(WKErrorRef error) +{ + WKRetainPtr<WKStringRef> errorDomain = adoptWK(WKErrorCopyDomain(error)); + int errorCode = WKErrorGetErrorCode(error); + + // We need to do some error mapping here to match the test expectations (Mac error names are expected). + if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitNetworkError")) { + errorDomain = adoptWK(WKStringCreateWithUTF8CString("NSURLErrorDomain")); + errorCode = -999; + } + + if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitPolicyError")) + errorDomain = adoptWK(WKStringCreateWithUTF8CString("WebKitErrorDomain")); + + InjectedBundle::shared().stringBuilder()->append("<NSError domain "); + InjectedBundle::shared().stringBuilder()->append(toWTFString(errorDomain)); + InjectedBundle::shared().stringBuilder()->append(", code "); + InjectedBundle::shared().stringBuilder()->append(String::number(errorCode)); + + WKRetainPtr<WKURLRef> url = adoptWK(WKErrorCopyFailingURL(error)); + if (url.get()) { + WKRetainPtr<WKStringRef> urlString = adoptWK(WKURLCopyString(url.get())); + InjectedBundle::shared().stringBuilder()->append(", failing URL \""); + InjectedBundle::shared().stringBuilder()->append(toWTFString(urlString)); + InjectedBundle::shared().stringBuilder()->append("\""); + } + + InjectedBundle::shared().stringBuilder()->append(">"); +} + void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame); @@ -430,19 +548,24 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle { #if ENABLE(WEB_INTENTS) static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->m_currentIntentRequest = intentRequest; - WKRetainPtr<WKIntentDataRef> intent(AdoptWK, WKBundleIntentRequestCopyIntentData(intentRequest)); + WKRetainPtr<WKBundleIntentRef> intent(AdoptWK, WKBundleIntentRequestCopyIntent(intentRequest)); InjectedBundle::shared().stringBuilder()->append("Received Web Intent: action="); - WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent.get())); + WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKBundleIntentCopyAction(intent.get())); InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get())); InjectedBundle::shared().stringBuilder()->append(" type="); - WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent.get())); + WKRetainPtr<WKStringRef> wkType(AdoptWK, WKBundleIntentCopyType(intent.get())); InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get())); InjectedBundle::shared().stringBuilder()->append("\n"); - // FIXME: Print number of ports when exposed in WebKit2 + const size_t numMessagePorts = WKBundleIntentMessagePortCount(intent.get()); + if (numMessagePorts) { + InjectedBundle::shared().stringBuilder()->append("Have "); + InjectedBundle::shared().stringBuilder()->append(WTF::String::number(numMessagePorts)); + InjectedBundle::shared().stringBuilder()->append(" ports\n"); + } - WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent.get())); + WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKBundleIntentCopyService(intent.get())); if (wkServiceUrl) { WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get())); if (wkService && !WKStringIsEmpty(wkService.get())) { @@ -452,7 +575,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle } } - WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent.get())); + WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKBundleIntentCopyExtras(intent.get())); WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get())); const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get()); for (size_t i = 0; i < numExtraKeys; ++i) { @@ -465,7 +588,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle InjectedBundle::shared().stringBuilder()->append("\n"); } - WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent.get())); + WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKBundleIntentCopySuggestions(intent.get())); const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get()); for (size_t i = 0; i < numSuggestions; ++i) { WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i)); @@ -580,7 +703,7 @@ void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef page, WKBundle void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKErrorRef error, const void* clientInfo) { - static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishLoadForResource(page, frame, identifier, error); + static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadForResource(page, frame, identifier, error); } void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame) @@ -588,7 +711,7 @@ void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didStartProvisionalLoadForFrame\n"); } @@ -611,7 +734,7 @@ void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRe return; InjectedBundle::shared().setTopLoadingFrame(0); - if (InjectedBundle::shared().layoutTestController()->waitToDump()) + if (InjectedBundle::shared().testRunner()->waitToDump()) return; InjectedBundle::shared().done(); @@ -622,7 +745,7 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) return; dumpFrameDescriptionSuitableForTestResult(frame); @@ -634,7 +757,7 @@ void InjectedBundlePage::didFinishProgress() if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpProgressFinishedCallback()) + if (!InjectedBundle::shared().testRunner()->shouldDumpProgressFinishedCallback()) return; InjectedBundle::shared().stringBuilder()->append("postProgressFinishedNotification\n"); @@ -742,7 +865,7 @@ void InjectedBundlePage::dump() { ASSERT(InjectedBundle::shared().isTestRunning()); - InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer(); + InjectedBundle::shared().testRunner()->invalidateWaitToDumpWatchdogTimer(); // Force a paint before dumping. This matches DumpRenderTree on Windows. (DumpRenderTree on Mac // does this at a slightly different time.) See <http://webkit.org/b/55469> for details. @@ -751,32 +874,32 @@ void InjectedBundlePage::dump() WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page); WTF::String url = toWTFString(adoptWK(WKURLCopyString(adoptWK(WKBundleFrameCopyURL(frame)).get()))); if (url.find("dumpAsText/") != WTF::notFound) - InjectedBundle::shared().layoutTestController()->dumpAsText(false); + InjectedBundle::shared().testRunner()->dumpAsText(false); - switch (InjectedBundle::shared().layoutTestController()->whatToDump()) { - case LayoutTestController::RenderTree: { + switch (InjectedBundle::shared().testRunner()->whatToDump()) { + case TestRunner::RenderTree: { WKRetainPtr<WKStringRef> text(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page)); InjectedBundle::shared().stringBuilder()->append(toWTFString(text)); break; } - case LayoutTestController::MainFrameText: + case TestRunner::MainFrameText: dumpFrameText(WKBundlePageGetMainFrame(m_page)); break; - case LayoutTestController::AllFramesText: + case TestRunner::AllFramesText: dumpAllFramesText(); break; } - if (InjectedBundle::shared().layoutTestController()->shouldDumpAllFrameScrollPositions()) + if (InjectedBundle::shared().testRunner()->shouldDumpAllFrameScrollPositions()) dumpAllFrameScrollPositions(); - else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition()) + else if (InjectedBundle::shared().testRunner()->shouldDumpMainFrameScrollPosition()) dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page)); - if (InjectedBundle::shared().layoutTestController()->shouldDumpBackForwardListsForAllWindows()) + if (InjectedBundle::shared().testRunner()->shouldDumpBackForwardListsForAllWindows()) InjectedBundle::shared().dumpBackForwardListsForAllPages(); - if (InjectedBundle::shared().shouldDumpPixels() && InjectedBundle::shared().layoutTestController()->shouldDumpPixels()) { - InjectedBundle::shared().setPixelResult(adoptWK(WKBundlePageCreateSnapshotInViewCoordinates(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), kWKImageOptionsShareable)).get()); + if (InjectedBundle::shared().shouldDumpPixels() && InjectedBundle::shared().testRunner()->shouldDumpPixels()) { + InjectedBundle::shared().setPixelResult(adoptWK(WKBundlePageCreateSnapshotWithOptions(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), kWKSnapshotOptionsShareable | kWKSnapshotOptionsInViewCoordinates)).get()); if (WKBundlePageIsTrackingRepaints(m_page)) InjectedBundle::shared().setRepaintRects(adoptWK(WKBundlePageCopyTrackedRepaintRects(m_page)).get()); } @@ -789,7 +912,7 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didFinishLoadForFrame\n"); } @@ -798,7 +921,7 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame) return; InjectedBundle::shared().setTopLoadingFrame(0); - if (InjectedBundle::shared().layoutTestController()->waitToDump()) + if (InjectedBundle::shared().testRunner()->waitToDump()) return; InjectedBundle::shared().page()->dump(); @@ -813,7 +936,7 @@ void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame, WK return; InjectedBundle::shared().setTopLoadingFrame(0); - if (InjectedBundle::shared().layoutTestController()->waitToDump()) + if (InjectedBundle::shared().testRunner()->waitToDump()) return; InjectedBundle::shared().done(); @@ -824,14 +947,14 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didReceiveTitle: "); InjectedBundle::shared().stringBuilder()->append(toWTFString(title)); InjectedBundle::shared().stringBuilder()->append("\n"); } - if (!InjectedBundle::shared().layoutTestController()->shouldDumpTitleChanges()) + if (!InjectedBundle::shared().testRunner()->shouldDumpTitleChanges()) return; InjectedBundle::shared().stringBuilder()->append("TITLE CHANGED: "); @@ -848,12 +971,12 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundle JSObjectRef window = JSContextGetGlobalObject(context); if (WKBundleScriptWorldNormalWorld() != world) { - JSObjectSetProperty(context, window, toJS("__worldID").get(), JSValueMakeNumber(context, LayoutTestController::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0); + JSObjectSetProperty(context, window, toJS("__worldID").get(), JSValueMakeNumber(context, TestRunner::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0); return; } JSValueRef exception = 0; - InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception); + InjectedBundle::shared().testRunner()->makeWindowObject(context, window, &exception); InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception); InjectedBundle::shared().eventSendingController()->makeWindowObject(context, window, &exception); InjectedBundle::shared().textInputController()->makeWindowObject(context, window, &exception); @@ -871,7 +994,7 @@ void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) return; dumpFrameDescriptionSuitableForTestResult(frame); @@ -883,7 +1006,7 @@ void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundleFrameRef fram if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) return; dumpFrameDescriptionSuitableForTestResult(frame); @@ -901,7 +1024,7 @@ void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didFinishDocumentLoadForFrame\n"); } @@ -920,7 +1043,7 @@ void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didHandleOnloadEventsForFrame\n"); } @@ -938,8 +1061,16 @@ void InjectedBundlePage::didDetectXSSForFrame(WKBundleFrameRef frame) { } -void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef, bool) +void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool) { + if (!InjectedBundle::shared().isTestRunning()) + return; + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) + return; + + WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); + assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get())); } // Resource Load Client Callbacks @@ -954,11 +1085,23 @@ static inline bool isHTTPOrHTTPSScheme(WKStringRef scheme) return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "http") || WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "https"); } -WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t, WKURLRequestRef request, WKURLResponseRef) +WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef response) { - if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().layoutTestController()->willSendRequestReturnsNull()) + if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().testRunner()->willSendRequestReturnsNull()) return 0; + if (InjectedBundle::shared().isTestRunning() + && InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) { + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - willSendRequest "); + dumpRequestDescriptionSuitableForTestResult(request); + InjectedBundle::shared().stringBuilder()->append(" redirectResponse "); + dumpResponseDescriptionSuitableForTestResult(response); + InjectedBundle::shared().stringBuilder()->append("\n"); + } + WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); WKRetainPtr<WKStringRef> host = adoptWK(WKURLCopyHostName(url.get())); WKRetainPtr<WKStringRef> scheme = adoptWK(WKURLCopyScheme(url.get())); @@ -990,12 +1133,22 @@ WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKB return request; } -void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKURLResponseRef response) +void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response) { if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceResponseMIMETypes()) + if (InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) { + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - didReceiveResponse "); + dumpResponseDescriptionSuitableForTestResult(response); + InjectedBundle::shared().stringBuilder()->append("\n"); + } + + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceResponseMIMETypes()) return; WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response)); @@ -1012,12 +1165,35 @@ void InjectedBundlePage::didReceiveContentLengthForResource(WKBundlePageRef, WKB { } -void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t) +void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier) { + if (!InjectedBundle::shared().isTestRunning()) + return; + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) + return; + + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - didFinishLoading\n"); } -void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKErrorRef) +void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef error) { + if (!InjectedBundle::shared().isTestRunning()) + return; + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) + return; + + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - didFailLoadingWithError: "); + + dumpErrorDescriptionSuitableForTestResult(error); + InjectedBundle::shared().stringBuilder()->append("\n"); } @@ -1048,10 +1224,10 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB if (!InjectedBundle::shared().isTestRunning()) return WKBundlePagePolicyActionUse; - if (!InjectedBundle::shared().layoutTestController()->isPolicyDelegateEnabled()) + if (!InjectedBundle::shared().testRunner()->isPolicyDelegateEnabled()) return WKBundlePagePolicyActionUse; - if (InjectedBundle::shared().layoutTestController()->waitToDump()) { + if (InjectedBundle::shared().testRunner()->waitToDump()) { WKRetainPtr<WKStringRef> url = adoptWK(WKURLCopyString(WKURLRequestCopyURL(request))); InjectedBundle::shared().stringBuilder()->append("Policy delegate: attempt to load "); InjectedBundle::shared().stringBuilder()->append(toWTFString(url)); @@ -1065,10 +1241,10 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB } InjectedBundle::shared().stringBuilder()->append("\n"); - InjectedBundle::shared().layoutTestController()->notifyDone(); + InjectedBundle::shared().testRunner()->notifyDone(); } - if (InjectedBundle::shared().layoutTestController()->isPolicyDelegatePermissive()) + if (InjectedBundle::shared().testRunner()->isPolicyDelegatePermissive()) return WKBundlePagePolicyActionUse; return WKBundlePagePolicyActionPassThrough; } @@ -1161,7 +1337,7 @@ void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText) if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpStatusCallbacks()) return; InjectedBundle::shared().stringBuilder()->append("UI DELEGATE STATUS CALLBACK: setStatusText:"); @@ -1260,12 +1436,12 @@ bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeHandleRef range) if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldBeginEditingInDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range) @@ -1273,12 +1449,12 @@ bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range) if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldEndEditingInDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action) @@ -1292,7 +1468,7 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRa "WebViewInsertActionDropped", }; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldInsertNode:"); InjectedBundle::shared().stringBuilder()->append(dumpPath(m_page, m_world.get(), node)); InjectedBundle::shared().stringBuilder()->append(" replacingDOMRange:"); @@ -1301,7 +1477,7 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRa InjectedBundle::shared().stringBuilder()->append(insertactionstring[action]); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action) @@ -1315,7 +1491,7 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleR "WebViewInsertActionDropped", }; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldInsertText:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(text)); InjectedBundle::shared().stringBuilder()->append(" replacingDOMRange:"); @@ -1324,7 +1500,7 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleR InjectedBundle::shared().stringBuilder()->append(insertactionstring[action]); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range) @@ -1332,12 +1508,12 @@ bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range) if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldDeleteDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting) @@ -1354,7 +1530,7 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRa "TRUE" }; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldChangeSelectedDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), fromRange)); InjectedBundle::shared().stringBuilder()->append(" toDOMRange:"); @@ -1365,7 +1541,7 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRa InjectedBundle::shared().stringBuilder()->append(boolstring[stillSelecting]); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range) @@ -1373,14 +1549,14 @@ bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldApplyStyle:"); InjectedBundle::shared().stringBuilder()->append(styleDecToStr(style)); InjectedBundle::shared().stringBuilder()->append(" toElementsInDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } void InjectedBundlePage::didBeginEditing(WKStringRef notificationName) @@ -1388,7 +1564,7 @@ void InjectedBundlePage::didBeginEditing(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidBeginEditing:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1400,7 +1576,7 @@ void InjectedBundlePage::didEndEditing(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidEndEditing:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1412,7 +1588,7 @@ void InjectedBundlePage::didChange(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidChange:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1424,7 +1600,7 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidChangeSelection:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1434,17 +1610,17 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName) #if ENABLE(FULLSCREEN_API) bool InjectedBundlePage::supportsFullScreen(WKBundlePageRef pageRef, WKFullScreenKeyboardRequestType requestType) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("supportsFullScreen() == true\n"); return true; } void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("enterFullScreenForElement()\n"); - if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) { + if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) { WKBundlePageWillEnterFullScreen(pageRef); WKBundlePageDidEnterFullScreen(pageRef); } @@ -1452,10 +1628,10 @@ void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBu void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("exitFullScreenForElement()\n"); - if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) { + if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) { WKBundlePageWillExitFullScreen(pageRef); WKBundlePageDidExitFullScreen(pageRef); } @@ -1463,22 +1639,22 @@ void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBun void InjectedBundlePage::beganEnterFullScreen(WKBundlePageRef, WKRect, WKRect) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("beganEnterFullScreen()\n"); } void InjectedBundlePage::beganExitFullScreen(WKBundlePageRef, WKRect, WKRect) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("beganExitFullScreen()\n"); } void InjectedBundlePage::closeFullScreen(WKBundlePageRef pageRef) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("closeFullScreen()\n"); - if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) { + if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) { WKBundlePageWillExitFullScreen(pageRef); WKBundlePageDidExitFullScreen(pageRef); } diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri index 1a117de89..f46e44caa 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri +++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri @@ -22,14 +22,14 @@ SOURCES += \ EventSendingController.h \ GCController.cpp \ GCController.h \ - LayoutTestController.cpp \ - LayoutTestController.h \ + TestRunner.cpp \ + TestRunner.h \ TextInputController.cpp \ TextInputController.h \ Bindings/JSWrapper.cpp \ qt/ActivateFontsQt.cpp \ qt/InjectedBundleQt.cpp \ - qt/LayoutTestControllerQt.cpp + qt/TestRunnerQt.cpp # Adds the generated sources to SOURCES include(DerivedSources.pri) @@ -45,7 +45,7 @@ HEADERS += \ GCController.h \ InjectedBundle.h \ InjectedBundlePage.h \ - LayoutTestController.h \ + TestRunner.h \ TextInputController.h \ DESTDIR = $${ROOT_BUILD_DIR}/lib diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp index cdffcae08..b94e5d476 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp @@ -24,11 +24,11 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" #include "InjectedBundlePage.h" -#include "JSLayoutTestController.h" +#include "JSTestRunner.h" #include "PlatformWebView.h" #include "StringFunctions.h" #include "TestController.h" @@ -49,22 +49,22 @@ #include <wtf/text/StringBuilder.h> #if ENABLE(WEB_INTENTS) +#include <WebKit2/WKBundleIntent.h> #include <WebKit2/WKBundleIntentRequest.h> -#include <WebKit2/WKIntentData.h> #endif namespace WTR { // This is lower than DumpRenderTree's timeout, to make it easier to work through the failures // Eventually it should be changed to match. -const double LayoutTestController::waitToDumpWatchdogTimerInterval = 6; +const double TestRunner::waitToDumpWatchdogTimerInterval = 6; -PassRefPtr<LayoutTestController> LayoutTestController::create() +PassRefPtr<TestRunner> TestRunner::create() { - return adoptRef(new LayoutTestController); + return adoptRef(new TestRunner); } -LayoutTestController::LayoutTestController() +TestRunner::TestRunner() : m_whatToDump(RenderTree) , m_shouldDumpAllFrameScrollPositions(false) , m_shouldDumpBackForwardListsForAllWindows(false) @@ -77,6 +77,7 @@ LayoutTestController::LayoutTestController() , m_dumpFullScreenCallbacks(false) , m_dumpFrameLoadCallbacks(false) , m_dumpProgressFinishedCallback(false) + , m_dumpResourceLoadCallbacks(false) , m_dumpResourceResponseMIMETypes(false) , m_waitToDump(false) , m_testRepaint(false) @@ -92,16 +93,16 @@ LayoutTestController::LayoutTestController() platformInitialize(); } -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -JSClassRef LayoutTestController::wrapperClass() +JSClassRef TestRunner::wrapperClass() { - return JSLayoutTestController::layoutTestControllerClass(); + return JSTestRunner::testRunnerClass(); } -void LayoutTestController::display() +void TestRunner::display() { WKBundlePageRef page = InjectedBundle::shared().page()->page(); WKBundlePageForceRepaint(page); @@ -109,7 +110,7 @@ void LayoutTestController::display() WKBundlePageResetTrackedRepaints(page); } -void LayoutTestController::dumpAsText(bool dumpPixels) +void TestRunner::dumpAsText(bool dumpPixels) { if (m_whatToDump < MainFrameText) m_whatToDump = MainFrameText; @@ -117,26 +118,26 @@ void LayoutTestController::dumpAsText(bool dumpPixels) } // FIXME: Needs a full implementation see https://bugs.webkit.org/show_bug.cgi?id=42546 -void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive) { m_policyDelegateEnabled = enabled; m_policyDelegatePermissive = permissive; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setCustomPolicyDelegate(true); waitUntilDone(); } -void LayoutTestController::waitUntilDone() +void TestRunner::waitUntilDone() { m_waitToDump = true; if (InjectedBundle::shared().useWaitToDumpWatchdogTimer()) initializeWaitToDumpWatchdogTimerIfNeeded(); } -void LayoutTestController::waitToDumpWatchdogTimerFired() +void TestRunner::waitToDumpWatchdogTimerFired() { invalidateWaitToDumpWatchdogTimer(); const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; @@ -145,7 +146,7 @@ void LayoutTestController::waitToDumpWatchdogTimerFired() InjectedBundle::shared().done(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (!InjectedBundle::shared().isTestRunning()) return; @@ -156,7 +157,7 @@ void LayoutTestController::notifyDone() m_waitToDump = false; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { // FIXME: Is it OK this works only for the main frame? // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? @@ -164,7 +165,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return WKBundleFrameGetNumberOfActiveAnimations(mainFrame); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { // FIXME: Is it OK this works only for the main frame? // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? @@ -172,7 +173,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return WKBundleFramePauseAnimationOnElementWithId(mainFrame, toWK(animationName).get(), toWK(elementId).get(), time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { // FIXME: Is it OK this works only for the main frame? // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? @@ -180,20 +181,20 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return WKBundleFramePauseTransitionOnElementWithId(mainFrame, toWK(propertyName).get(), toWK(elementId).get(), time); } -void LayoutTestController::suspendAnimations() +void TestRunner::suspendAnimations() { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); WKBundleFrameSuspendAnimations(mainFrame); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyLayerTreeAsText(mainFrame)); return toJS(text); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); @@ -203,7 +204,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); @@ -212,12 +213,12 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { WKBundleSetShouldTrackVisitedLinks(InjectedBundle::shared().bundle(), true); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSValueRef element) { // FIXME: Is it OK this works only for the main frame? WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); @@ -230,7 +231,7 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef el return value; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef element) +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSValueRef element) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); @@ -242,12 +243,12 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef return toJS(text); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef argument) +void TestRunner::execCommand(JSStringRef name, JSStringRef argument) { WKBundlePageExecuteEditingCommand(InjectedBundle::shared().page()->page(), toWK(name).get(), toWK(argument).get()); } -bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArrayAsValue) +bool TestRunner::findString(JSStringRef target, JSValueRef optionsArrayAsValue) { WKFindOptions options = 0; @@ -285,117 +286,117 @@ bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArra return WKBundlePageFindString(InjectedBundle::shared().page()->page(), toWK(target).get(), options); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { WKBundleClearAllDatabases(InjectedBundle::shared().bundle()); } -void LayoutTestController::setDatabaseQuota(uint64_t quota) +void TestRunner::setDatabaseQuota(uint64_t quota) { return WKBundleSetDatabaseQuota(InjectedBundle::shared().bundle(), quota); } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { WKBundleClearApplicationCache(InjectedBundle::shared().bundle()); } -void LayoutTestController::setAppCacheMaximumSize(uint64_t size) +void TestRunner::setAppCacheMaximumSize(uint64_t size) { WKBundleSetAppCacheMaximumSize(InjectedBundle::shared().bundle(), size); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get()); } -void LayoutTestController::setCanOpenWindows(bool) +void TestRunner::setCanOpenWindows(bool) { // It's not clear if or why any tests require opening windows be forbidden. // For now, just ignore this setting, and if we find later it's needed we can add it. } -void LayoutTestController::setXSSAuditorEnabled(bool enabled) +void TestRunner::setXSSAuditorEnabled(bool enabled) { WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled")); WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), key.get(), enabled); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { WKBundleSetAllowUniversalAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { WKBundleSetAllowFileAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { WKBundleSetFrameFlatteningEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setPluginsEnabled(bool enabled) +void TestRunner::setPluginsEnabled(bool enabled) { WKBundleSetPluginsEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setGeolocationPermission(bool enabled) +void TestRunner::setGeolocationPermission(bool enabled) { WKBundleSetGeolocationPermission(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) { WKBundleSetJavaScriptCanAccessClipboard(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setPrivateBrowsingEnabled(bool enabled) +void TestRunner::setPrivateBrowsingEnabled(bool enabled) { WKBundleSetPrivateBrowsingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setPopupBlockingEnabled(bool enabled) +void TestRunner::setPopupBlockingEnabled(bool enabled) { WKBundleSetPopupBlockingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool enabled) +void TestRunner::setAuthorAndUserStylesEnabled(bool enabled) { WKBundleSetAuthorAndUserStylesEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WKBundleAddOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WKBundleRemoveOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains); } -int LayoutTestController::numberOfPages(double pageWidthInPixels, double pageHeightInPixels) +int TestRunner::numberOfPages(double pageWidthInPixels, double pageHeightInPixels) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return WKBundleNumberOfPages(InjectedBundle::shared().bundle(), mainFrame, pageWidthInPixels, pageHeightInPixels); } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return toJS(WKBundlePageSizeAndMarginsInPixels(InjectedBundle::shared().bundle(), mainFrame, pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft)); } -bool LayoutTestController::isPageBoxVisible(int pageIndex) +bool TestRunner::isPageBoxVisible(int pageIndex) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return WKBundleIsPageBoxVisible(InjectedBundle::shared().bundle(), mainFrame, pageIndex); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) { if (!element || !JSValueIsObject(context, element)) return; @@ -404,38 +405,38 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef elem WKBundleNodeHandleSetHTMLInputElementValueForUser(nodeHandle.get(), toWK(value).get()); } -unsigned LayoutTestController::windowCount() +unsigned TestRunner::windowCount() { return InjectedBundle::shared().pageCount(); } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { WKBundleBackForwardListClear(WKBundlePageGetBackForwardList(InjectedBundle::shared().page()->page())); } // Object Creation -void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) +void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { setProperty(context, windowObject, "testRunner", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { #if ENABLE(INSPECTOR) WKBundleInspectorShow(WKBundlePageGetInspector(InjectedBundle::shared().page()->page())); #endif // ENABLE(INSPECTOR) } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { #if ENABLE(INSPECTOR) WKBundleInspectorClose(WKBundlePageGetInspector(InjectedBundle::shared().page()->page())); #endif // ENABLE(INSPECTOR) } -void LayoutTestController::evaluateInWebInspector(long callID, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callID, JSStringRef script) { #if ENABLE(INSPECTOR) WKRetainPtr<WKStringRef> scriptWK = toWK(script); @@ -450,7 +451,7 @@ static WorldMap& worldMap() return map; } -unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world) +unsigned TestRunner::worldIDForWorld(WKBundleScriptWorldRef world) { WorldMap::const_iterator end = worldMap().end(); for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { @@ -461,7 +462,7 @@ unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world) return 0; } -void LayoutTestController::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned worldID, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned worldID, JSStringRef script) { // A worldID of 0 always corresponds to a new world. Any other worldID corresponds to a world // that is created once and cached forever. @@ -483,30 +484,30 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(JSContextRef context, u JSEvaluateScript(jsContext, script, 0, 0, 0, 0); } -void LayoutTestController::setPOSIXLocale(JSStringRef locale) +void TestRunner::setPOSIXLocale(JSStringRef locale) { char localeBuf[32]; JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf)); setlocale(LC_ALL, localeBuf); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return WKBundleFrameSetTextDirection(mainFrame, toWK(direction).get()); } -void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnPage) +void TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnPage) { InjectedBundle::shared().postNewBeforeUnloadReturnValue(!shouldStayOnPage); } -void LayoutTestController::setDefersLoading(bool shouldDeferLoading) +void TestRunner::setDefersLoading(bool shouldDeferLoading) { WKBundlePageSetDefersLoading(InjectedBundle::shared().page()->page(), shouldDeferLoading); } -void LayoutTestController::setPageVisibility(JSStringRef state) +void TestRunner::setPageVisibility(JSStringRef state) { WebCore::PageVisibilityState visibilityState = WebCore::PageVisibilityStateVisible; @@ -520,7 +521,7 @@ void LayoutTestController::setPageVisibility(JSStringRef state) WKBundleSetPageVisibilityState(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), visibilityState, /* isInitialState */ false); } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { WKBundleSetPageVisibilityState(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), WebCore::PageVisibilityStateVisible, /* isInitialState */ true); } @@ -539,7 +540,7 @@ enum { SetBackingScaleFactorCallbackID }; -static void cacheLayoutTestControllerCallback(unsigned index, JSValueRef callback) +static void cacheTestRunnerCallback(unsigned index, JSValueRef callback) { if (!callback) return; @@ -550,7 +551,7 @@ static void cacheLayoutTestControllerCallback(unsigned index, JSValueRef callbac callbackMap().add(index, callback); } -static void callLayoutTestControllerCallback(unsigned index) +static void callTestRunnerCallback(unsigned index) { if (!callbackMap().contains(index)) return; @@ -561,61 +562,61 @@ static void callLayoutTestControllerCallback(unsigned index) JSValueUnprotect(context, callback); } -void LayoutTestController::addChromeInputField(JSValueRef callback) +void TestRunner::addChromeInputField(JSValueRef callback) { - cacheLayoutTestControllerCallback(AddChromeInputFieldCallbackID, callback); + cacheTestRunnerCallback(AddChromeInputFieldCallbackID, callback); InjectedBundle::shared().postAddChromeInputField(); } -void LayoutTestController::removeChromeInputField(JSValueRef callback) +void TestRunner::removeChromeInputField(JSValueRef callback) { - cacheLayoutTestControllerCallback(RemoveChromeInputFieldCallbackID, callback); + cacheTestRunnerCallback(RemoveChromeInputFieldCallbackID, callback); InjectedBundle::shared().postRemoveChromeInputField(); } -void LayoutTestController::focusWebView(JSValueRef callback) +void TestRunner::focusWebView(JSValueRef callback) { - cacheLayoutTestControllerCallback(FocusWebViewCallbackID, callback); + cacheTestRunnerCallback(FocusWebViewCallbackID, callback); InjectedBundle::shared().postFocusWebView(); } -void LayoutTestController::setBackingScaleFactor(double backingScaleFactor, JSValueRef callback) +void TestRunner::setBackingScaleFactor(double backingScaleFactor, JSValueRef callback) { - cacheLayoutTestControllerCallback(SetBackingScaleFactorCallbackID, callback); + cacheTestRunnerCallback(SetBackingScaleFactorCallbackID, callback); InjectedBundle::shared().postSetBackingScaleFactor(backingScaleFactor); } -void LayoutTestController::setWindowIsKey(bool isKey) +void TestRunner::setWindowIsKey(bool isKey) { InjectedBundle::shared().postSetWindowIsKey(isKey); } -void LayoutTestController::callAddChromeInputFieldCallback() +void TestRunner::callAddChromeInputFieldCallback() { - callLayoutTestControllerCallback(AddChromeInputFieldCallbackID); + callTestRunnerCallback(AddChromeInputFieldCallbackID); } -void LayoutTestController::callRemoveChromeInputFieldCallback() +void TestRunner::callRemoveChromeInputFieldCallback() { - callLayoutTestControllerCallback(RemoveChromeInputFieldCallbackID); + callTestRunnerCallback(RemoveChromeInputFieldCallbackID); } -void LayoutTestController::callFocusWebViewCallback() +void TestRunner::callFocusWebViewCallback() { - callLayoutTestControllerCallback(FocusWebViewCallbackID); + callTestRunnerCallback(FocusWebViewCallbackID); } -void LayoutTestController::callSetBackingScaleFactorCallback() +void TestRunner::callSetBackingScaleFactorCallback() { - callLayoutTestControllerCallback(SetBackingScaleFactorCallbackID); + callTestRunnerCallback(SetBackingScaleFactorCallbackID); } -void LayoutTestController::overridePreference(JSStringRef preference, bool value) +void TestRunner::overridePreference(JSStringRef preference, bool value) { WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value); } -void LayoutTestController::sendWebIntentResponse(JSStringRef reply) +void TestRunner::sendWebIntentResponse(JSStringRef reply) { #if ENABLE(WEB_INTENTS) WKRetainPtr<WKBundleIntentRequestRef> currentRequest = InjectedBundle::shared().page()->currentIntentRequest(); @@ -636,7 +637,7 @@ void LayoutTestController::sendWebIntentResponse(JSStringRef reply) #endif } -void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) +void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) { #if ENABLE(WEB_INTENTS) WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); @@ -651,22 +652,22 @@ void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("type"), typeWK.get()); WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("data"), dataWK.get()); - WKRetainPtr<WKIntentDataRef> wkIntentData(AdoptWK, WKIntentDataCreate(intentInitDict.get())); - WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntentData.get()); + WKRetainPtr<WKBundleIntentRef> wkIntent(AdoptWK, WKBundleIntentCreate(intentInitDict.get())); + WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntent.get()); #endif } -void LayoutTestController::setAlwaysAcceptCookies(bool accept) +void TestRunner::setAlwaysAcceptCookies(bool accept) { WKBundleSetAlwaysAcceptCookies(InjectedBundle::shared().bundle(), accept); } -double LayoutTestController::preciseTime() +double TestRunner::preciseTime() { return currentTime(); } -void LayoutTestController::setUserStyleSheetEnabled(bool enabled) +void TestRunner::setUserStyleSheetEnabled(bool enabled) { m_userStyleSheetEnabled = enabled; @@ -675,7 +676,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled) WKBundleSetUserStyleSheetLocation(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), location); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef location) +void TestRunner::setUserStyleSheetLocation(JSStringRef location) { m_userStyleSheetLocation = adoptWK(WKStringCreateWithJSString(location)); diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h index 517a5160a..32b43ff69 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h +++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h @@ -23,8 +23,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayoutTestController_h -#define LayoutTestController_h +#ifndef TestRunner_h +#define TestRunner_h #include "JSWrappable.h" #include <JavaScriptCore/JSRetainPtr.h> @@ -51,10 +51,10 @@ typedef Ecore_Timer* PlatformTimerRef; namespace WTR { -class LayoutTestController : public JSWrappable { +class TestRunner : public JSWrappable { public: - static PassRefPtr<LayoutTestController> create(); - virtual ~LayoutTestController(); + static PassRefPtr<TestRunner> create(); + virtual ~TestRunner(); // JSWrappable virtual JSClassRef wrapperClass(); @@ -79,6 +79,7 @@ public: void dumpFullScreenCallbacks() { m_dumpFullScreenCallbacks = true; } void dumpFrameLoadCallbacks() { setShouldDumpFrameLoadCallbacks(true); } void dumpProgressFinishedCallback() { setShouldDumpProgressFinishedCallback(true); } + void dumpResourceLoadCallbacks() { m_dumpResourceLoadCallbacks = true; } void dumpResourceResponseMIMETypes() { m_dumpResourceResponseMIMETypes = true; } void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; } @@ -163,6 +164,7 @@ public: bool shouldDumpFullScreenCallbacks() const { return m_dumpFullScreenCallbacks; } bool shouldDumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; } bool shouldDumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; } + bool shouldDumpResourceLoadCallbacks() const { return m_dumpResourceLoadCallbacks; } bool shouldDumpResourceResponseMIMETypes() const { return m_dumpResourceResponseMIMETypes; } bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; } @@ -230,7 +232,7 @@ public: private: static const double waitToDumpWatchdogTimerInterval; - LayoutTestController(); + TestRunner(); void platformInitialize(); void initializeWaitToDumpWatchdogTimerIfNeeded(); @@ -249,6 +251,7 @@ private: bool m_dumpFullScreenCallbacks; bool m_dumpFrameLoadCallbacks; bool m_dumpProgressFinishedCallback; + bool m_dumpResourceLoadCallbacks; bool m_dumpResourceResponseMIMETypes; bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called. bool m_testRepaint; @@ -270,4 +273,4 @@ private: } // namespace WTR -#endif // LayoutTestController_h +#endif // TestRunner_h diff --git a/Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp b/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp index b1b6f844a..4c0ea22f8 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp @@ -18,7 +18,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" #include <Ecore.h> @@ -27,16 +27,16 @@ namespace WTR { static Eina_Bool waitToDumpWatchdogTimerCallback(void*) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); return false; } -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -45,7 +45,7 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -54,12 +54,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() waitToDumpWatchdogTimerCallback, 0); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return url; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("efl")); return platformName; diff --git a/Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp index d8d0ed5d0..301038294 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp @@ -25,7 +25,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" #include <glib.h> @@ -34,16 +34,16 @@ namespace WTR { static gboolean waitToDumpWatchdogTimerCallback(gpointer) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); return FALSE; } -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -51,7 +51,7 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -60,12 +60,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() waitToDumpWatchdogTimerCallback, 0); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return url; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk")); return platformName; diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm index b1e0265bf..dca27e6a0 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm +++ b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm @@ -23,17 +23,17 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" namespace WTR { -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -44,10 +44,10 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -56,12 +56,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return JSStringRetain(url); // Do nothing on mac. } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac")); return platformName; diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp index 5de8ae71a..f5d149b3d 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp @@ -25,7 +25,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "ActivateFonts.h" #include "InjectedBundle.h" @@ -47,17 +47,17 @@ public: return theInstance; } -public slots: +public Q_SLOTS: void timerFired() { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); } private: WatchdogTimerHelper() {} }; -void LayoutTestController::platformInitialize() +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, @@ -69,12 +69,12 @@ void LayoutTestController::platformInitialize() QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired())); } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { m_waitToDumpWatchdogTimer.stop(); } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (qgetenv("QT_WEBKIT2_DEBUG") == "1") return; @@ -85,7 +85,7 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() m_waitToDumpWatchdogTimer.start(waitToDumpWatchdogTimerInterval * 1000); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { QString localTmpUrl(QStringLiteral("file:///tmp/LayoutTests")); QString givenUrl(reinterpret_cast<const QChar*>(JSStringGetCharactersPtr(url)), JSStringGetLength(url)); @@ -104,7 +104,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u return url; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("qt")); return platformName; @@ -112,4 +112,4 @@ JSRetainPtr<JSStringRef> LayoutTestController::platformName() } // namespace WTR -#include "LayoutTestControllerQt.moc" +#include "TestRunnerQt.moc" diff --git a/Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp b/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp index be9c414cf..225394276 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp @@ -24,18 +24,18 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" namespace WTR { -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -46,12 +46,12 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() static void CALLBACK waitToDumpWatchdogTimerFired(HWND, UINT, UINT_PTR, DWORD) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); } static const UINT_PTR waitToDumpWatchdogTimerIdentifier = 1; -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -59,12 +59,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() m_waitToDumpWatchdogTimer = ::SetTimer(0, waitToDumpWatchdogTimerIdentifier, waitToDumpWatchdogTimerInterval * 1000, WTR::waitToDumpWatchdogTimerFired); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return JSStringRetain(url); // TODO. } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win")); return platformName; diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake index e967d557c..084cb5045 100644 --- a/Tools/WebKitTestRunner/PlatformEfl.cmake +++ b/Tools/WebKitTestRunner/PlatformEfl.cmake @@ -3,7 +3,6 @@ LIST(APPEND WebKitTestRunner_LINK_FLAGS ${EDJE_LDFLAGS} ${EFLDEPS_LDFLAGS} ${EVAS_LDFLAGS} - ${LIBSOUP24_LDFLAGS} ) ADD_CUSTOM_TARGET(forwarding-headersEflForWebKitTestRunner @@ -34,7 +33,7 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES ${ECORE_X_INCLUDE_DIRS} ${EFLDEPS_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} - ${Glib_INCLUDE_DIRS} + ${GLIB_INCLUDE_DIRS} ) LIST(APPEND WebKitTestRunner_LIBRARIES @@ -42,7 +41,7 @@ LIST(APPEND WebKitTestRunner_LIBRARIES ${ECORE_X_LIBRARIES} ${EDJE_LIBRARIES} ${EFLDEPS_LIBRARIES} - ${Glib_LIBRARIES} + ${GLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${WTF_LIBRARY_NAME} ) @@ -52,7 +51,7 @@ LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/ActivateFontsEfl.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/InjectedBundleEfl.cpp - ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/LayoutTestControllerEfl.cpp + ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/TestRunnerEfl.cpp ) # FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj index 3ebf18e8c..be8262ff6 100644 --- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj +++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj @@ -71,13 +71,13 @@ BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */; }; BC9192051333E4F8003011DC /* TestInvocationCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9192041333E4F8003011DC /* TestInvocationCG.cpp */; }; BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; }; - BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */; }; + BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */; }; BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */; }; BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; }; - BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; }; + BCC9981811D3F51E0017BCA2 /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */; }; BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; }; BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; }; - C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */; }; + C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -185,21 +185,21 @@ BC952C0C11F3B965003398B4 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapper.cpp; sourceTree = "<group>"; }; BC952C0E11F3B97B003398B4 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrappable.h; sourceTree = "<group>"; }; BC952EC511F3C10F003398B4 /* DerivedSources.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; }; - BC952ED211F3C29F003398B4 /* LayoutTestController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LayoutTestController.idl; sourceTree = "<group>"; }; + BC952ED211F3C29F003398B4 /* TestRunner.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestRunner.idl; sourceTree = "<group>"; }; BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = CodeGeneratorTestRunner.pm; sourceTree = "<group>"; }; - BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSLayoutTestController.cpp; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; - BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSLayoutTestController.h; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.h; sourceTree = BUILT_PRODUCTS_DIR; }; + BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSTestRunner.cpp; path = DerivedSources/WebKitTestRunner/JSTestRunner.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; + BC952F1E11F3C652003398B4 /* JSTestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTestRunner.h; path = DerivedSources/WebKitTestRunner/JSTestRunner.h; sourceTree = BUILT_PRODUCTS_DIR; }; BC99A4841208901A007E9F08 /* StringFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFunctions.h; sourceTree = "<group>"; }; BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; }; BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; }; BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePage.cpp; sourceTree = "<group>"; }; BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePage.h; sourceTree = "<group>"; }; - BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; }; - BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; }; + BCC9981611D3F51E0017BCA2 /* TestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestRunner.h; sourceTree = "<group>"; }; + BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestRunner.cpp; sourceTree = "<group>"; }; BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; }; BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; }; BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; }; + C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerMac.mm; path = mac/TestRunnerMac.mm; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -324,9 +324,9 @@ BC8FD8C8120E527F00F3E71A /* EventSendingController.h */, BC14E4D9120E02D000826C0C /* GCController.cpp */, BC14E4D8120E02D000826C0C /* GCController.h */, - BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */, - BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */, - C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */, + BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */, + BCC9981611D3F51E0017BCA2 /* TestRunner.h */, + C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */, 5664A49814326384008881BE /* TextInputController.cpp */, 5664A49914326384008881BE /* TextInputController.h */, ); @@ -412,7 +412,7 @@ 29210EDC144CD56E00835BB5 /* AccessibilityUIElement.idl */, BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */, BC14E4E1120E032000826C0C /* GCController.idl */, - BC952ED211F3C29F003398B4 /* LayoutTestController.idl */, + BC952ED211F3C29F003398B4 /* TestRunner.idl */, 5664A49614326377008881BE /* TextInputController.idl */, ); path = Bindings; @@ -433,8 +433,8 @@ BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */, BC14E4E8120E03D800826C0C /* JSGCController.cpp */, BC14E4E9120E03D800826C0C /* JSGCController.h */, - BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */, - BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */, + BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */, + BC952F1E11F3C652003398B4 /* JSTestRunner.h */, 5641E2CE14335E95008307E5 /* JSTextInputController.cpp */, 5641E2CF14335E95008307E5 /* JSTextInputController.h */, ); @@ -577,16 +577,16 @@ BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */, BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */, BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */, - BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */, + BCC9981811D3F51E0017BCA2 /* TestRunner.cpp in Sources */, 65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */, BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */, - BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */, + BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */, BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */, BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */, BC8DAD7B1316D91000EC96FC /* InjectedBundleMac.mm in Sources */, BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */, BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */, - C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */, + C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */, 5664A49A14326384008881BE /* TextInputController.cpp in Sources */, 5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */, 29210EAE144CACB700835BB5 /* AccessibilityUIElement.cpp in Sources */, diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index 8a752a831..21ed91bb1 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -48,7 +48,7 @@ public: connect(this, SIGNAL(statusChanged(QQuickView::Status)), SLOT(handleStatusChanged(QQuickView::Status))); } -private slots: +private Q_SLOTS: void handleStatusChanged(QQuickView::Status status) { if (status != QQuickView::Ready) diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp index 1da12a7b2..d7abf16e6 100644 --- a/Tools/WebKitTestRunner/qt/main.cpp +++ b/Tools/WebKitTestRunner/qt/main.cpp @@ -55,7 +55,7 @@ public: delete m_controller; } -public slots: +public Q_SLOTS: void launch() { m_controller = new WTR::TestController(m_argc, const_cast<const char**>(m_argv)); diff --git a/Tools/WebKitTestRunner/win/InjectedBundle.vcproj b/Tools/WebKitTestRunner/win/InjectedBundle.vcproj index 045ad6d52..c20bad946 100644 --- a/Tools/WebKitTestRunner/win/InjectedBundle.vcproj +++ b/Tools/WebKitTestRunner/win/InjectedBundle.vcproj @@ -718,7 +718,7 @@ > </File> <File - RelativePath="..\InjectedBundle\Bindings\LayoutTestController.idl" + RelativePath="..\InjectedBundle\Bindings\TestRunner.idl" > <FileConfiguration Name="Debug|Win32" @@ -874,11 +874,11 @@ > </File> <File - RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.cpp" + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTestRunner.cpp" > </File> <File - RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.h" + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTestRunner.h" > </File> <File @@ -967,15 +967,15 @@ > </File> <File - RelativePath="..\InjectedBundle\LayoutTestController.cpp" + RelativePath="..\InjectedBundle\TestRunner.cpp" > </File> <File - RelativePath="..\InjectedBundle\LayoutTestController.h" + RelativePath="..\InjectedBundle\TestRunner.h" > </File> <File - RelativePath="..\InjectedBundle\win\LayoutTestControllerWin.cpp" + RelativePath="..\InjectedBundle\win\TestRunnerWin.cpp" > </File> <File diff --git a/Tools/WinLauncher/WinLauncher.cpp b/Tools/WinLauncher/WinLauncher.cpp index 0e47f9996..405d1b209 100644 --- a/Tools/WinLauncher/WinLauncher.cpp +++ b/Tools/WinLauncher/WinLauncher.cpp @@ -228,8 +228,13 @@ static void resizeSubViews() static void subclassForLayeredWindow() { hMainWnd = gViewWindow; - DefWebKitProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hMainWnd, GWL_WNDPROC)); - ::SetWindowLongPtr(hMainWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc)); +#if defined _M_AMD64 || defined _WIN64 + DefWebKitProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hMainWnd, GWLP_WNDPROC)); + ::SetWindowLongPtr(hMainWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc)); +#else + DefWebKitProc = reinterpret_cast<WNDPROC>(::GetWindowLong(hMainWnd, GWL_WNDPROC)); + ::SetWindowLong(hMainWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc)); +#endif } static void computeFullDesktopFrame() @@ -314,8 +319,14 @@ extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE, HIN UpdateWindow(hMainWnd); } - DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hURLBarWnd, GWL_WNDPROC)); - SetWindowLongPtr(hURLBarWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(MyEditProc)); +#if defined _M_AMD64 || defined _WIN64 + DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hURLBarWnd, GWLP_WNDPROC)); + SetWindowLongPtr(hURLBarWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(MyEditProc)); +#else + DefEditProc = reinterpret_cast<WNDPROC>(GetWindowLong(hURLBarWnd, GWL_WNDPROC)); + SetWindowLong(hURLBarWnd, GWL_WNDPROC, reinterpret_cast<LONG_PTR>(MyEditProc)); +#endif + SetFocus(hURLBarWnd); RECT clientRect = { s_windowPosition.x, s_windowPosition.y, s_windowPosition.x + s_windowSize.cx, s_windowPosition.y + s_windowSize.cy }; diff --git a/Tools/efl/jhbuild.modules b/Tools/efl/jhbuild.modules index 82e5da84f..d1f05e309 100644 --- a/Tools/efl/jhbuild.modules +++ b/Tools/efl/jhbuild.modules @@ -36,9 +36,8 @@ href="http://cairographics.org"/> <repository type="tarball" name="freedesktop.org" href="http://www.freedesktop.org"/> - <repository type="svn" name="enlightenment.org" - href="http://svn.enlightenment.org/svn/e/trunk/" - trunk-template="%(module)s/"/> + <repository type="tarball" name="enlightenment.fr" + href="http://git.enlightenment.fr/cgit.cgi/svn/"/> <autotools id="cairo" autogen-sh="configure"> <dependencies> @@ -155,31 +154,43 @@ </branch> </autotools> - <autotools id="eina" > - <branch module="eina" - repo="enlightenment.org" - revision="73027"/> + <autotools id="eina"> + <branch module="eina.git/snapshot/eina-f90926dd9bf19ea946d7572b36335cc0c5cd3ab5.tar.bz2" version="73027" + checkoutdir="eina-f90926dd9bf19ea946d7572b36335cc0c5cd3ab5" + repo="enlightenment.fr" + hash="sha256:388214434dbe3726aa3894e6f9838adfc43d8bd63bb9597f86a4efbc48b42cad" + md5sum="db756dbda2b8b77e5f807c3ecccd34e4"> + </branch> </autotools> <autotools id="embryo"> - <branch module="embryo" - repo="enlightenment.org" - revision="73027"/> + <branch module="embryo.git/snapshot/embryo-191e1b5f022f769d62abec6112f51e5fbecd6db9.tar.bz2" version="73027" + checkoutdir="embryo-191e1b5f022f769d62abec6112f51e5fbecd6db9" + repo="enlightenment.fr" + hash="sha256:d8a57f51985ee16ee6a7fde2d3b931e83da5d26a1a62efc012d64e6d5fe3748b" + md5sum="adebeb8c704e70912a920e8ef4ec43cd"> + </branch> <dependencies> <dep package="eina"/> </dependencies> </autotools> <autotools id="evas"> - <branch module="evas" - repo="enlightenment.org" - revision="73027"/> + <branch module="evas.git/snapshot/evas-169cf1bb962001f1cf3e59eb950380a9dc1fced3.tar.bz2" version="73027" + checkoutdir="evas-169cf1bb962001f1cf3e59eb950380a9dc1fced3" + repo="enlightenment.fr" + hash="sha256:2b59350e0fe33a8fe49fcbe04192d05ab37345684c4eb9b10fb0e0a35545e7da" + md5sum="bfb5442e50551c64c709481a9a35b4a2"> + </branch> </autotools> <autotools id="ecore"> - <branch module="ecore" - repo="enlightenment.org" - revision="73027"/> + <branch module="ecore.git/snapshot/ecore-9c96f9c140320e52030d1a206d8d330aa46abc44.tar.bz2" version="73027" + checkoutdir="ecore-9c96f9c140320e52030d1a206d8d330aa46abc44" + repo="enlightenment.fr" + hash="sha256:546b9c389556074ad4982a0e389ccb0e55ced59ce725ea2b5c065c4d60310068" + md5sum="b15571f271a9960b562f98cb09268408"> + </branch> <dependencies> <dep package="eina"/> <dep package="evas"/> @@ -187,9 +198,12 @@ </autotools> <autotools id="eet"> - <branch module="eet" - repo="enlightenment.org" - revision="73027"/> + <branch module="eet.git/snapshot/eet-15fd52e4831b946308a80df9a25357dc18c97ca2.tar.bz2" version="73027" + checkoutdir="eet-15fd52e4831b946308a80df9a25357dc18c97ca2" + repo="enlightenment.fr" + hash="sha256:62eff1248923be7918beff46e8598ff2b139b0224f0a1b845142cf1b078422e6" + md5sum="be08634c70712bb44a5534ef5b2a7af3"> + </branch> <dependencies> <dep package="libgcrypt"/> <dep package="eina"/> @@ -197,9 +211,12 @@ </autotools> <autotools id="edje"> - <branch module="edje" - repo="enlightenment.org" - revision="73027"/> + <branch module="edje.git/snapshot/edje-14738eefac54d1a8cfead2b5aed3b7f05c5b4bd8.tar.bz2" version="73027" + checkoutdir="edje-14738eefac54d1a8cfead2b5aed3b7f05c5b4bd8" + repo="enlightenment.fr" + hash="sha256:9e102f0b47e9cdfa737b5f81b11d352ae01206209729e5815c28d826186b247e" + md5sum="5f1995901c848bdaec56ff1f913ef02f"> + </branch> <dependencies> <dep package="eet"/> <dep package="ecore"/> @@ -209,9 +226,12 @@ </autotools> <autotools id="e_dbus"> - <branch module="e_dbus" - repo="enlightenment.org" - revision="73027"/> + <branch module="e_dbus.git/snapshot/e_dbus-9de0a3e0c959cdbaba022eb888b9670bd766d38f.tar.bz2" version="73027" + checkoutdir="e_dbus-9de0a3e0c959cdbaba022eb888b9670bd766d38f" + repo="enlightenment.fr" + hash="sha256:f9655c3ba69174dbd65b5220a492b970aa9264ff3283cbd960a89b69e53591b6" + md5sum="4cca1f994e17823ca9be1985f5c4ad09"> + </branch> <dependencies> <dep package="ecore"/> <dep package="eina"/> @@ -219,9 +239,12 @@ </autotools> <autotools id="eeze"> - <branch module="eeze" - repo="enlightenment.org" - revision="73027"/> + <branch module="eeze.git/snapshot/eeze-09a379bc2cc6c1c7aab0478991a104b0c6af1844.tar.bz2" version="73027" + checkoutdir="eeze-09a379bc2cc6c1c7aab0478991a104b0c6af1844" + repo="enlightenment.fr" + hash="sha256:312d61429af845a6333c0c968ec7b0902982082f171453ee14343a8efe773cfc" + md5sum="c163caedcbab532b4dc16014b14bb9bc"> + </branch> <dependencies> <dep package="ecore"/> <dep package="eina"/> @@ -229,9 +252,12 @@ </autotools> <autotools id="efreet"> - <branch module="efreet" - repo="enlightenment.org" - revision="73027"/> + <branch module="efreet.git/snapshot/efreet-e7712c830f3a3cb4c197695de4c981387be8f214.tar.bz2" version="73027" + checkoutdir="efreet-e7712c830f3a3cb4c197695de4c981387be8f214" + repo="enlightenment.fr" + hash="sha256:4839187c3cc099eb6b6986c6924f4e4f6dffd22eccbc3f1bddd1a6312bc8c84c" + md5sum="bf28ee9d7b5211d72c27412a7f1cdb80"> + </branch> <dependencies> <deb package="ecore"/> <deb package="eina"/> diff --git a/Tools/jhbuild/jhbuild-wrapper b/Tools/jhbuild/jhbuild-wrapper index 390fc7821..40bbb0101 100755 --- a/Tools/jhbuild/jhbuild-wrapper +++ b/Tools/jhbuild/jhbuild-wrapper @@ -90,13 +90,6 @@ def install_jhbuild(): raise Exception('jhbuild configure failed with return code: %i' % process.returncode) -def update_webkit_libs_jhbuild(platform): - process = subprocess.Popen([jhbuildutils.top_level_path('Tools', 'Scripts', 'update-webkit-libs-jhbuild'), '--' + platform]) - process.wait() - if process.returncode != 0: - raise Exception('jhbuild configure failed with return code: %i' % process.returncode) - - def determine_platform(): if '--efl' in sys.argv: return "efl"; @@ -110,7 +103,6 @@ def ensure_jhbuild(platform): clone_jhbuild() update_jhbuild() install_jhbuild() - update_webkit_libs_jhbuild(platform) elif not jhbuild_installed() \ or not jhbuild_at_expected_revision(): update_jhbuild() diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf index c91aab9b3..efc1ad9dd 100644 --- a/Tools/qmake/mkspecs/features/default_pre.prf +++ b/Tools/qmake/mkspecs/features/default_pre.prf @@ -78,8 +78,8 @@ else: PYTHON = python !haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 5.0 is not supported.") -!haveQtModule(widgets)|!haveQtModule(printsupport) { - root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.") +!haveQtModule(widgets) { + root_project_file: message("WebKit1 requires the QtWidgets module. Disabling WebKit1.") CONFIG += no_webkit1 } diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf index 4f6ddca51..4307bc727 100644 --- a/Tools/qmake/mkspecs/features/features.prf +++ b/Tools/qmake/mkspecs/features/features.prf @@ -34,11 +34,6 @@ load(mobilityconfig, true) DEFINES += WTF_USE_ICU_UNICODE=1 DEFINES -= WTF_USE_QT4_UNICODE=1 -!contains(DEFINES, HAVE_QRAWFONT=.) { - # Use of QRawFont in Qt 5: - DEFINES += HAVE_QRAWFONT=1 -} - # We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner. config_fontconfig:!mac { DEFINES += HAVE_FONTCONFIG=1 @@ -48,6 +43,18 @@ config_fontconfig:!mac { haveQtModule(quick): DEFINES += HAVE_QTQUICK=1 } +!contains(DEFINES, HAVE_QTPRINTSUPPORT=.) { + haveQtModule(printsupport): DEFINES += HAVE_QTPRINTSUPPORT=1 +} + +!contains(DEFINES, HAVE_QTTESTLIB=.) { + haveQtModule(testlib) { + DEFINES += HAVE_QTTESTLIB=1 + } else { + message("Missing QtTest module, disabling DumpRenderTree, WebKitTestRunner and tests") + } +} + # We need libxml2 config test to determine to use libxml2 or not !contains(DEFINES, WTF_USE_LIBXML2=.) { config_libxml2: DEFINES += WTF_USE_LIBXML2=1 @@ -98,9 +105,18 @@ config_fontconfig:!mac { # QStyle detection haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1 -# WebGL support -!contains(DEFINES, ENABLE_WEBGL=.) { - contains(QT_CONFIG, opengl):!win32-*: DEFINES += ENABLE_WEBGL=1 +# Enable the USE(3D_GRAPHICS) flag when QtOpenGL is enabled. +!contains(DEFINES, WTF_USE_3D_GRAPHICS=.):contains(QT_CONFIG, opengl) { + # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details. + # Also disable on QNX, see https://bugs.webkit.org/show_bug.cgi?id=93278 + !win32-*:!qnx { + DEFINES += WTF_USE_3D_GRAPHICS=1 + } +} + +# WebGL support - only enabled if we can use 3D graphics +!contains(DEFINES, ENABLE_WEBGL=.):contains(DEFINES, WTF_USE_3D_GRAPHICS=1) { + DEFINES += ENABLE_WEBGL=1 } # CSS Shaders support @@ -189,8 +205,8 @@ for(feature, FEATURE_DEFAULTS) { # ---------------- Sanitize defines ------------------- -# Disable SVG fonts if SVG is disabled or we don't have raw fonts -contains(DEFINES, ENABLE_SVG=0)|!contains(DEFINES, HAVE_QRAWFONT=1): DEFINES += ENABLE_SVG_FONTS=0 +# Disable SVG fonts if SVG is disabled +contains(DEFINES, ENABLE_SVG=0): DEFINES += ENABLE_SVG_FONTS=0 # JavaScript debugger requires the inspector contains(DEFINES, ENABLE_INSPECTOR=0) { @@ -212,14 +228,6 @@ for(define, DEFINES) { contains(DEFINES, $$opposite): DEFINES -= $$define } -# Enable the USE(3D_GRAPHICS) flag for Qt5 or when QtOpenGL is enabled. -!contains(DEFINES, WTF_USE_3D_GRAPHICS=.) { - # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details. - !win32-* { - DEFINES += WTF_USE_3D_GRAPHICS=1 - } -} - contains(DEFINES, ENABLE_GAMEPAD=1) { !packagesExist(libudev) { error("Gamepad API requires libudev to build. Please install libudev development files, or build WebKit without gamepad.") diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri index 97dd7ae41..99cc70b78 100644 --- a/Tools/qmake/mkspecs/features/features.pri +++ b/Tools/qmake/mkspecs/features/features.pri @@ -31,6 +31,7 @@ FEATURE_DEFAULTS = \ ENABLE_CSS_SHADERS=0 \ ENABLE_CSS_VARIABLES=0 \ ENABLE_CSS3_FLEXBOX=1 \ + ENABLE_CSS3_TEXT_DECORATION=0 \ ENABLE_DASHBOARD_SUPPORT=0 \ ENABLE_DATAGRID=0 \ ENABLE_DATALIST_ELEMENT=1 \ diff --git a/Tools/qmake/mkspecs/features/functions.prf b/Tools/qmake/mkspecs/features/functions.prf index 972a2079f..c38f80d6a 100644 --- a/Tools/qmake/mkspecs/features/functions.prf +++ b/Tools/qmake/mkspecs/features/functions.prf @@ -260,11 +260,15 @@ defineTest(linkAgainstLibrary) { POST_TARGETDEPS += $${path}$${QMAKE_DIR_SEP}lib$${target}.a } - # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies. - # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit - # statically in applications (which isn't used often because, among other things, of licensing obstacles). - CONFIG -= explicitlib - CONFIG -= staticlib + # gprof does not support profiling a shared library. + # To profile WebKit, applications must link QtWebKit statically. + !contains(CONFIG, gprof) { + # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies. + # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit + # statically in applications (which isn't used often because, among other things, of licensing obstacles). + CONFIG -= explicitlib + CONFIG -= staticlib + } } export(LIBS) diff --git a/Tools/qmake/mkspecs/features/gprof.prf b/Tools/qmake/mkspecs/features/gprof.prf new file mode 100644 index 000000000..38a77555b --- /dev/null +++ b/Tools/qmake/mkspecs/features/gprof.prf @@ -0,0 +1,11 @@ +# ------------------------------------------------------------------- +# This optional feature file adds rules that make running gprof +# on QtWebKit easier. +# +# See 'Tools/qmake/README' for an overview of the build system +# ------------------------------------------------------------------- + +!contains(CONFIG,no_webkit2): error("WebKit2 is not supported with gprof") + +QMAKE_CXXFLAGS += -pg +QMAKE_LFLAGS += -pg diff --git a/Tools/qmake/qt_webkit.pri b/Tools/qmake/qt_webkit.pri index 343467583..e221bd26d 100644 --- a/Tools/qmake/qt_webkit.pri +++ b/Tools/qmake/qt_webkit.pri @@ -9,7 +9,7 @@ QT.webkit.name = QtWebKit QT.webkit.bins = $$QT_MODULE_BIN_BASE QT.webkit.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtWebKit QT.webkit.imports = $$QT_MODULE_IMPORT_BASE -QT.webkit.private_includes = $$QT_MODULE_INCLUDE_BASE/$$QT.webkit.name/$$QT.webkit.VERSION +QT.webkit.private_includes = $$QT_MODULE_INCLUDE_BASE/$$QT.webkit.name/$$QT.webkit.VERSION $$QT_MODULE_INCLUDE_BASE/$$QT.webkit.name/$$QT.webkit.VERSION/$$QT.webkit.name QT.webkit.sources = $$QT_MODULE_BASE QT.webkit.libs = $$QT_MODULE_LIB_BASE QT.webkit.depends = core gui opengl network diff --git a/Tools/win/DLLLauncher/DLLLauncherMain.cpp b/Tools/win/DLLLauncher/DLLLauncherMain.cpp index 93e77f485..961335dbe 100644 --- a/Tools/win/DLLLauncher/DLLLauncherMain.cpp +++ b/Tools/win/DLLLauncher/DLLLauncherMain.cpp @@ -184,11 +184,19 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCm #if USE_CONSOLE_ENTRY_POINT typedef int (WINAPI*EntryPoint)(int, const char*[]); +#if defined _M_AMD64 || defined _WIN64 + const char* entryPointName = "_dllLauncherEntryPoint"; +#else const char* entryPointName = "_dllLauncherEntryPoint@8"; +#endif #else typedef int (WINAPI*EntryPoint)(HINSTANCE, HINSTANCE, LPWSTR, int); +#if defined _M_AMD64 || defined _WIN64 + const char* entryPointName = "_dllLauncherEntryPoint"; +#else const char* entryPointName = "_dllLauncherEntryPoint@16"; #endif +#endif EntryPoint entryPoint = reinterpret_cast<EntryPoint>(::GetProcAddress(module, entryPointName)); if (!entryPoint) |
