Title: [250121] trunk/Tools
Revision
250121
Author
[email protected]
Date
2019-09-19 21:55:55 -0700 (Thu, 19 Sep 2019)

Log Message

[FTW] Enable WebKitTestRunner build
https://bugs.webkit.org/show_bug.cgi?id=201996

Reviewed by Fujii Hironori.

It's time to start getting the test system up and running for FTW.

This patch does the following:

1. Adds relevant CMake changes to get things building.
2. Adds a "--ftw" flag to the build scripts that will trigger a relevant build.
3. Updates 'webkitpy' to recognize the 'ftw' port.

Note: Pixel tests are not yet supported.

* PlatformFTW.cmake: Build the WK2 test runner.
* Scripts/build-webkit: Update to recognize the FTW port.
* Scripts/webkitdirs.pm: Ditto.
* Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl: Ditto.
* Scripts/webkitpy/common/config/ports.py: Ditto.
* Scripts/webkitpy/common/config/ports_unittest.py: Ditto.
* Scripts/webkitpy/common/version_name_map.py: Ditto.
* Scripts/webkitpy/port/factory.py: Ditto.
* Scripts/webkitpy/port/win.py: Ditto.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dumpDOMAsWebArchive): Don't build or run this method
on Windows.
* WebKitTestRunner/PlatformFTW.cmake: Added.
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
* WebKitTestRunner/win/TestInvocationDirect2D.cpp: Added.
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Add stub implementation.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (250120 => 250121)


--- trunk/Tools/ChangeLog	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/ChangeLog	2019-09-20 04:55:55 UTC (rev 250121)
@@ -1,3 +1,38 @@
+2019-09-19  Brent Fulgham  <[email protected]>
+
+        [FTW] Enable WebKitTestRunner build
+        https://bugs.webkit.org/show_bug.cgi?id=201996
+
+        Reviewed by Fujii Hironori.
+
+        It's time to start getting the test system up and running for FTW.
+
+        This patch does the following:
+
+        1. Adds relevant CMake changes to get things building.
+        2. Adds a "--ftw" flag to the build scripts that will trigger a relevant build.
+        3. Updates 'webkitpy' to recognize the 'ftw' port.
+
+        Note: Pixel tests are not yet supported.
+
+        * PlatformFTW.cmake: Build the WK2 test runner.
+        * Scripts/build-webkit: Update to recognize the FTW port.
+        * Scripts/webkitdirs.pm: Ditto.
+        * Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl: Ditto.
+        * Scripts/webkitpy/common/config/ports.py: Ditto.
+        * Scripts/webkitpy/common/config/ports_unittest.py: Ditto.
+        * Scripts/webkitpy/common/version_name_map.py: Ditto.
+        * Scripts/webkitpy/port/factory.py: Ditto.
+        * Scripts/webkitpy/port/win.py: Ditto.
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::dumpDOMAsWebArchive): Don't build or run this method
+        on Windows.
+        * WebKitTestRunner/PlatformFTW.cmake: Added.
+        * WebKitTestRunner/PlatformWebView.h:
+        * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+        * WebKitTestRunner/win/TestInvocationDirect2D.cpp: Added.
+        (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Add stub implementation.
+
 2019-09-19  Fujii Hironori  <[email protected]>
 
         [Win][MiniBrowser] Use _com_ptr_t methods instead of calling QueryInterface explictly

Modified: trunk/Tools/PlatformFTW.cmake (250120 => 250121)


--- trunk/Tools/PlatformFTW.cmake	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/PlatformFTW.cmake	2019-09-20 04:55:55 UTC (rev 250121)
@@ -5,6 +5,6 @@
     add_subdirectory(MiniBrowser/win)
 endif ()
 
-#if (ENABLE_WEBKIT)
-#    add_subdirectory(WebKitTestRunner)
-#endif ()
+if (ENABLE_WEBKIT)
+    add_subdirectory(WebKitTestRunner)
+endif ()

Modified: trunk/Tools/Scripts/build-webkit (250120 => 250121)


--- trunk/Tools/Scripts/build-webkit	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/build-webkit	2019-09-20 04:55:55 UTC (rev 250121)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Apple Inc. All rights reserved.
+# Copyright (C) 2005-2019 Apple Inc. All rights reserved.
 # Copyright (C) 2009 Google Inc. All rights reserved.
 # Copyright (C) 2010 moiji-mobile.com All rights reserved.
 # Copyright (C) 2011 Research In Motion Limited. All rights reserved.
@@ -118,6 +118,7 @@
   --lto-mode=<mode>                 Set Link Time Optimization mode (full, thin, or none) (LLVM only)
   --[no-]xcbuild                    Force the use of XCBuild or not
 
+  --ftw                             Build the FTW Windows port
   --gtk                             Build the GTK+ port
   --wpe                             Build the WPE port
   --wincairo                        Build using Cairo (rather than CoreGraphics) on Windows
@@ -189,7 +190,7 @@
 my @projects = ("Source/_javascript_Core", "Source/WebCore", "Source/WebKitLegacy");
 
 # Build WTF as a separate static library on ports which support it.
-splice @projects, 0, 0, "Source/WTF" if isAppleWebKit() or isWinCairo();
+splice @projects, 0, 0, "Source/WTF" if isAppleWebKit() or isWinCairo() or isFTW();
 
 splice @projects, 0, 0, "Source/bmalloc" if isAppleCocoaWebKit();
 
@@ -202,7 +203,7 @@
     }
 }
 
-if ((isAppleWebKit() || isWinCairo() || isPlayStation()) && !-d "WebKitLibraries") {
+if ((isAppleWebKit() || isWinCairo() || isPlayStation() || isFTW()) && !-d "WebKitLibraries") {
     die "Error: No WebKitLibraries directory found. Please do a fresh checkout.\n";
 }
 
@@ -306,7 +307,7 @@
 }
 
 my $baseProductDir = baseProductDir();
-if (isAppleWinWebKit() || isWinCairo() || isPlayStation()) {
+if (isAppleWinWebKit() || isWinCairo() || isPlayStation() || isFTW()) {
     my @featureArgs = cmakeArgsFromFeatures(@features, !$noExperimentalFeatures);
     removeCMakeCache(@featureArgs);
 
@@ -326,7 +327,7 @@
     }
     if (exitStatus($result)) {
         my $scriptDir = relativeScriptsDir();
-        if (isAppleWinWebKit() || isWinCairo()) {
+        if (isAppleWinWebKit() || isWinCairo() || isFTW()) {
             print "\n\n===== BUILD FAILED ======\n\n";
             print "Please ensure you have run $scriptDir/update-webkit to install dependencies.\n\n";
             print "You can view build errors by checking the BuildLog.htm files located at:\n$baseProductDir/obj/<project>/<config>.\n";

Modified: trunk/Tools/Scripts/webkitdirs.pm (250120 => 250121)


--- trunk/Tools/Scripts/webkitdirs.pm	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitdirs.pm	2019-09-20 04:55:55 UTC (rev 250121)
@@ -105,6 +105,7 @@
 # Ports
 use constant {
     AppleWin    => "AppleWin",
+    FTW         => "FTW",
     GTK         => "GTK",
     iOS         => "iOS",
     tvOS        => "tvOS",
@@ -494,6 +495,8 @@
     push(@args, '--maccatalyst') if (defined $xcodeSDK && $xcodeSDK =~ /^maccatalyst/);
     push(@args, '--32-bit') if ($architecture eq "x86" and !isWin64());
     push(@args, '--64-bit') if (isWin64());
+    push(@args, '--64-bit') if (isFTW());
+    push(@args, '--ftw') if isFTW();
     push(@args, '--gtk') if isGtk();
     push(@args, '--wpe') if isWPE();
     push(@args, '--jsc-only') if isJSCOnly();
@@ -505,7 +508,7 @@
 sub extractNonMacOSHostConfiguration
 {
     my @args = ();
-    my @extract = ('--device', '--gtk', '--ios', '--platform', '--sdk', '--simulator', '--wincairo', 'SDKROOT', 'ARCHS');
+    my @extract = ('--device', '--gtk', '--ios', '--platform', '--sdk', '--simulator', '--wincairo', '--ftw', 'SDKROOT', 'ARCHS');
     foreach (@{$_[0]}) {
         my $line = $_;
         my $flag = 0;
@@ -712,7 +715,7 @@
     # autotool builds (non build-webkit). In this case and if
     # WEBKIT_OUTPUTDIR exist, use that as our configuration dir. This will
     # allows us to run run-webkit-tests without using build-webkit.
-    return ($ENV{"WEBKIT_OUTPUTDIR"} && isGtk()) || isAppleWinWebKit();
+    return ($ENV{"WEBKIT_OUTPUTDIR"} && isGtk()) || isAppleWinWebKit() || isFTW();
 }
 
 sub determineConfigurationProductDir
@@ -720,7 +723,7 @@
     return if defined $configurationProductDir;
     determineBaseProductDir();
     determineConfiguration();
-    if (isAppleWinWebKit() || isWinCairo() || isPlayStation()) {
+    if (isAppleWinWebKit() || isWinCairo() || isPlayStation() || isFTW()) {
         $configurationProductDir = File::Spec->catdir($baseProductDir, $configuration);
     } else {
         if (usesPerConfigurationBuildDirectory()) {
@@ -1046,7 +1049,7 @@
     if (isAppleCocoaWebKit()) {
         return "$configurationProductDir/$libraryName.framework/Versions/A/$libraryName";
     }
-    if (isAppleWinWebKit()) {
+    if (isAppleWinWebKit() || isFTW()) {
         if ($libraryName eq "_javascript_Core") {
             return "$baseProductDir/lib/$libraryName.lib";
         } else {
@@ -1168,6 +1171,7 @@
     return if defined $portName;
 
     my %argToPortName = (
+        ftw => FTW,
         gtk => GTK,
         'jsc-only' => JSCOnly,
         playstation => PlayStation,
@@ -1257,6 +1261,11 @@
     return -e "/etc/fedora-release";
 }
 
+sub isFTW()
+{
+    return portName() eq FTW;
+}
+
 sub isWinCairo()
 {
     return portName() eq WinCairo;
@@ -1283,7 +1292,7 @@
 sub determineIsWin64()
 {
     return if defined($isWin64);
-    $isWin64 = checkForArgumentAndRemoveFromARGV("--64-bit") || ((isWinCairo() || isJSCOnly()) && !shouldBuild32Bit());
+    $isWin64 = checkForArgumentAndRemoveFromARGV("--64-bit") || ((isFTW() || isWinCairo() || isJSCOnly()) && !shouldBuild32Bit());
 }
 
 sub determineIsWin64FromArchitecture($)
@@ -1693,7 +1702,7 @@
         return "MiniBrowser";
     } elsif (isAppleMacWebKit()) {
         return "Safari";
-    } elsif (isAppleWinWebKit()) {
+    } elsif (isAppleWinWebKit() || isFTW()) {
         return "MiniBrowser";
     }
 }
@@ -1796,7 +1805,7 @@
 
 sub setupAppleWinEnv()
 {
-    return unless isAppleWinWebKit();
+    return unless isAppleWinWebKit() || isFTW();
 
     checkInstalledTools();
 
@@ -2260,7 +2269,7 @@
     push @args, '-DSHOW_BINDINGS_GENERATION_PROGRESS=1' unless ($willUseNinja && -t STDOUT);
 
     # Some ports have production mode, but build-webkit should always use developer mode.
-    push @args, "-DDEVELOPER_MODE=ON" if isGtk() || isJSCOnly() || isWPE() || isWinCairo();
+    push @args, "-DDEVELOPER_MODE=ON" if isFTW() || isGtk() || isJSCOnly() || isWPE() || isWinCairo();
 
     if (architecture() eq "x86_64" && shouldBuild32Bit()) {
         # CMAKE_LIBRARY_ARCHITECTURE is needed to get the right .pc
@@ -2427,7 +2436,7 @@
 
     if (isAnyWindows()) {
         my $productBinaryDir = executableProductDir();
-        if (isAppleWinWebKit()) {
+        if (isAppleWinWebKit() || isFTW()) {
             $env->{PATH} = join(':', $productBinaryDir, appleApplicationSupportPath(), $env->{PATH} || "");
         } elsif (isWinCairo()) {
             my $winCairoBin = sourceDir() . "/WebKitLibraries/win/" . (isWin64() ? "bin64/" : "bin32/");
@@ -2884,7 +2893,7 @@
         return runMacWebKitApp(safariPath());
     }
 
-    if (isAppleWinWebKit()) {
+    if (isAppleWinWebKit() || isFTW()) {
         my $result;
         my $webKitLauncherPath = File::Spec->catfile(executableProductDir(), "MiniBrowser.exe");
         return system { $webKitLauncherPath } $webKitLauncherPath, @ARGV;
@@ -2898,7 +2907,7 @@
     if (isAppleMacWebKit()) {
         return runMacWebKitApp(File::Spec->catfile(productDir(), "MiniBrowser.app", "Contents", "MacOS", "MiniBrowser"));
     }
-    if (isAppleWinWebKit()) {
+    if (isAppleWinWebKit() || isFTW()) {
         my $webKitLauncherPath = File::Spec->catfile(executableProductDir(), "MiniBrowser.exe");
         return system { $webKitLauncherPath } $webKitLauncherPath, @ARGV;
     }

Modified: trunk/Tools/Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl (250120 => 250121)


--- trunk/Tools/Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitperl/webkitdirs_unittest/extractNonMacOSHostConfiguration.pl	2019-09-20 04:55:55 UTC (rev 250121)
@@ -92,6 +92,11 @@
     expectedValue => ["--debug", "ARCHS=x86_64"],
     description => "Debug 64-bit build",
 },
+{
+    argValue => ["--debug", "--ftw"],
+    expectedValue => ["--debug"],
+    description => "Debug with FTW",
+},
 );
 
 plan(tests => 1 * @testCases);

Modified: trunk/Tools/Scripts/webkitpy/common/config/ports.py (250120 => 250121)


--- trunk/Tools/Scripts/webkitpy/common/config/ports.py	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitpy/common/config/ports.py	2019-09-20 04:55:55 UTC (rev 250121)
@@ -1,6 +1,6 @@
 # Copyright (C) 2009, Google Inc. All rights reserved.
 # Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
-# Copyright (C) 2015, 2017 Apple Inc. All rights reserved.
+# Copyright (C) 2015-2019 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
@@ -63,6 +63,7 @@
     @staticmethod
     def port(port_name):
         ports = {
+            "ftw": FTWPort,
             "gtk-wk2": GtkWK2Port,
             "ios-device": IOSPort,
             # FIXME: https://bugs.webkit.org/show_bug.cgi?id=169302
@@ -204,6 +205,20 @@
         return command
 
 
+class FTWPort(DeprecatedPort):
+    port_flag_name = "ftw"
+
+    def build_webkit_command(self, build_style=None):
+        command = super(FTWPort, self).build_webkit_command(build_style=build_style)
+        command.append('--ftw')
+        return command
+
+    def run_webkit_tests_command(self, build_style=None):
+        command = super(FTWPort, self).run_webkit_tests_command(build_style)
+        command.append("--ftw")
+        return command
+
+
 class GtkWK2Port(DeprecatedPort):
     port_flag_name = "gtk-wk2"
 

Modified: trunk/Tools/Scripts/webkitpy/common/config/ports_unittest.py (250120 => 250121)


--- trunk/Tools/Scripts/webkitpy/common/config/ports_unittest.py	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitpy/common/config/ports_unittest.py	2019-09-20 04:55:55 UTC (rev 250121)
@@ -62,6 +62,12 @@
         self.assertEqual(WinCairoPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--wincairo"])
         self.assertEqual(WinCairoPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--wincairo"])
 
+    def test_ftw_port(self):
+        self.assertEqual(FTWPort().flag(), "--port=ftw")
+        self.assertEqual(FTWPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests") + ["--ftw"])
+        self.assertEqual(FTWPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--ftw"])
+        self.assertEqual(FTWPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--ftw"])
+
     def test_jsconly_port(self):
         self.assertEqual(JscOnlyPort().flag(), "--port=jsc-only")
         self.assertEqual(JscOnlyPort().build_jsc_command(), DeprecatedPort().script_shell_command("build-jsc") + ["--jsc-only"])

Modified: trunk/Tools/Scripts/webkitpy/common/version_name_map.py (250120 => 250121)


--- trunk/Tools/Scripts/webkitpy/common/version_name_map.py	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitpy/common/version_name_map.py	2019-09-20 04:55:55 UTC (rev 250121)
@@ -82,6 +82,10 @@
         # wincairo uses the same versions as Windows
         self.mapping[PUBLIC_TABLE]['wincairo'] = self.mapping[PUBLIC_TABLE]['win']
 
+        # FTW uses the same versions as Windows
+        self.mapping[PUBLIC_TABLE]['ftw'] = self.mapping[PUBLIC_TABLE]['win']
+
+
     @classmethod
     def _automap_to_major_version(cls, prefix, minimum=Version(1), maximum=Version(1)):
         result = {}

Modified: trunk/Tools/Scripts/webkitpy/port/factory.py (250120 => 250121)


--- trunk/Tools/Scripts/webkitpy/port/factory.py	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitpy/port/factory.py	2019-09-20 04:55:55 UTC (rev 250121)
@@ -1,5 +1,5 @@
 # Copyright (C) 2010 Google Inc. All rights reserved.
-# Copyright (C) 2013-2018 Apple Inc. All rights reserved.
+# Copyright (C) 2013-2019 Apple Inc. All rights reserved.
 # Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
 #
 # Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,9 @@
         optparse.make_option('--wincairo', action='', dest='platform',
             const=('wincairo'),
             help=('Alias for --platform=wincairo')),
+        optparse.make_option('--ftw', action='', dest='platform',
+            const=('ftw'),
+            help=('Alias for --platform=ftw')),
         ] + (config.apple_additions().platform_options() if config.apple_additions() else [])
 
 
@@ -105,6 +108,7 @@
         'mac.MacPort',
         'mock_drt.MockDRTPort',
         'test.TestPort',
+        'win.FTWPort',
         'win.WinCairoPort',
         'win.WinPort',
         'wpe.WPEPort',

Modified: trunk/Tools/Scripts/webkitpy/port/win.py (250120 => 250121)


--- trunk/Tools/Scripts/webkitpy/port/win.py	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/Scripts/webkitpy/port/win.py	2019-09-20 04:55:55 UTC (rev 250121)
@@ -1,5 +1,5 @@
 # Copyright (C) 2010 Google Inc. All rights reserved.
-# Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
+# Copyright (C) 2013-2019 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
@@ -494,3 +494,42 @@
         paths.extend(self.get_option("additional_platform_directory", []))
 
         return paths
+
+
+class FTWPort(WinPort):
+    port_name = "ftw"
+
+    DEFAULT_ARCHITECTURE = 'x86_64'
+
+    def default_baseline_search_path(self, **kwargs):
+        return map(self._webkit_baseline_path, self._search_paths())
+
+    def _port_specific_expectations_files(self, **kwargs):
+        return map(lambda x: self._filesystem.join(self._webkit_baseline_path(x), 'TestExpectations'), reversed(self._search_paths()))
+
+    def _search_paths(self):
+        paths = []
+        version_name_map = VersionNameMap.map(self.host.platform)
+        if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX:
+            versions = [self._os_version]
+        else:
+            sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values())
+            versions = sorted_versions[sorted_versions.index(self._os_version):]
+
+        normalize = lambda version: version.lower().replace(' ', '')
+        to_name = lambda version: version_name_map.to_name(version, platform=self.port_name)
+
+        wk_version = 'wk2' if self.get_option('webkit_test_runner') else 'wk1'
+
+        for version in versions:
+            name = self.port_name + '-' + normalize(to_name(version))
+            paths.append(name + '-' + wk_version)
+            paths.append(name)
+
+        paths.append(self.port_name + '-' + wk_version)
+        paths.append(self.port_name)
+        if self.get_option('webkit_test_runner'):
+            paths.append('wk2')
+        paths.extend(self.get_option("additional_platform_directory", []))
+
+        return paths

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (250120 => 250121)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2019-09-20 04:55:55 UTC (rev 250121)
@@ -50,7 +50,7 @@
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 
-#if USE(CF) && !PLATFORM(WIN_CAIRO)
+#if USE(CF) && !PLATFORM(WIN_CAIRO) && !USE(DIRECT2D)
 #include "WebArchiveDumpSupport.h"
 #endif
 
@@ -874,7 +874,7 @@
 
 void InjectedBundlePage::dumpDOMAsWebArchive(WKBundleFrameRef frame, StringBuilder& stringBuilder)
 {
-#if USE(CF) && !PLATFORM(WIN_CAIRO)
+#if USE(CF) && !PLATFORM(WIN_CAIRO) && !USE(DIRECT2D)
     WKRetainPtr<WKDataRef> wkData = adoptWK(WKBundleFrameCopyWebArchive(frame));
     RetainPtr<CFDataRef> cfData = adoptCF(CFDataCreate(0, WKDataGetBytes(wkData.get()), WKDataGetSize(wkData.get())));
     RetainPtr<CFStringRef> cfString = adoptCF(WebCoreTestSupport::createXMLStringFromWebArchiveData(cfData.get()));

Added: trunk/Tools/WebKitTestRunner/PlatformFTW.cmake (0 => 250121)


--- trunk/Tools/WebKitTestRunner/PlatformFTW.cmake	                        (rev 0)
+++ trunk/Tools/WebKitTestRunner/PlatformFTW.cmake	2019-09-20 04:55:55 UTC (rev 250121)
@@ -0,0 +1,78 @@
+set(WebKitTestRunnerLib_SOURCES
+    ${WebKitTestRunner_SOURCES}
+    ${WEBKIT_TESTRUNNER_DIR}/win/TestInvocationDirect2D.cpp
+    win/EventSenderProxyWin.cpp
+    win/PlatformWebViewWin.cpp
+    win/TestControllerWin.cpp
+    win/main.cpp
+)
+
+set(WebKitTestRunner_SOURCES
+    ${TOOLS_DIR}/win/DLLLauncher/DLLLauncherMain.cpp
+)
+
+list(APPEND WebKitTestRunnerInjectedBundle_SOURCES
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win/ActivateFontsWin.cpp
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win/InjectedBundleWin.cpp
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win/TestRunnerWin.cpp
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win/AccessibilityControllerWin.cpp
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win/AccessibilityUIElementWin.cpp
+)
+
+list(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES
+    win
+    ${FORWARDING_HEADERS_DIR}
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win
+)
+
+set(WebKitTestRunnerLib_LIBRARIES
+    ${WebKitTestRunner_LIBRARIES}
+    Comsuppw
+    Oleacc
+)
+
+list(APPEND WebKitTestRunner_LIBRARIES
+    WebKit
+)
+
+set(WebKitTestRunnerInjectedBundle_LIBRARIES
+    WebCoreTestSupport
+    WebKit
+)
+
+list(REMOVE_ITEM
+    WebKitTestRunnerLib_SOURCES
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}/JSWrapper.cpp
+)
+list(REMOVE_ITEM
+    WebKitTestRunnerInjectedBundle_SOURCES
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}/JSWrapper.cpp
+)
+
+WEBKIT_ADD_PRECOMPILED_HEADER(WebKitTestRunnerPrefix.h
+    ${WEBKIT_TESTRUNNER_DIR}/win/WebKitTestRunnerPrefix.cpp
+    WebKitTestRunnerLib_SOURCES
+)
+WEBKIT_ADD_PRECOMPILED_HEADER(TestRunnerInjectedBundlePrefix.h
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/win/TestRunnerInjectedBundlePrefix.cpp
+    WebKitTestRunnerInjectedBundle_SOURCES
+)
+
+list(APPEND
+    WebKitTestRunnerLib_SOURCES
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}/JSWrapper.cpp
+)
+list(APPEND
+    WebKitTestRunnerInjectedBundle_SOURCES
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}/JSWrapper.cpp
+)
+
+
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MSVC_RUNTIME_LINKER_FLAGS}")
+add_library(WebKitTestRunnerLib SHARED ${WebKitTestRunnerLib_SOURCES})
+target_link_libraries(WebKitTestRunnerLib ${WebKitTestRunnerLib_LIBRARIES})
+
+add_definitions(
+    -DUSE_CONSOLE_ENTRY_POINT
+    -D_UNICODE
+)

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (250120 => 250121)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2019-09-20 04:55:55 UTC (rev 250121)
@@ -52,7 +52,11 @@
 typedef WKViewRef PlatformWKView;
 typedef WPEToolingBackends::HeadlessViewBackend* PlatformWindow;
 #elif PLATFORM(WIN)
+#if USE(DIRECT2D)
+#include <d2d1_1.h>
+#else
 #include <cairo.h>
+#endif
 class TestRunnerWindow;
 typedef HWND PlatformWindow;
 typedef WKViewRef PlatformWKView;
@@ -60,6 +64,10 @@
 
 #if USE(CAIRO)
 typedef cairo_surface_t* PlatformImage;
+#elif USE(DIRECT2D)
+interface ID2D1Bitmap;
+
+typedef ID2D1Bitmap* PlatformImage;
 #endif
 
 namespace WTR {

Modified: trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp (250120 => 250121)


--- trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp	2019-09-20 04:47:51 UTC (rev 250120)
+++ trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp	2019-09-20 04:55:55 UTC (rev 250121)
@@ -30,13 +30,19 @@
 #include "PlatformWebView.h"
 
 #include <WebCore/HWndDC.h>
-#include <cairo.h>
 #include <cstdio>
 #include <windows.h>
 #include <wtf/RunLoop.h>
 #include <wtf/win/GDIObject.h>
 
+#if USE(CAIRO)
+#include <cairo.h>
+#endif
 
+#if USE(DIRECT2D)
+#include <d2d1_1.h>
+#endif
+
 namespace WTR {
 
 static LPCWSTR hostWindowClassName = L"WTRWebViewHostWindow";

Added: trunk/Tools/WebKitTestRunner/win/TestInvocationDirect2D.cpp (0 => 250121)


--- trunk/Tools/WebKitTestRunner/win/TestInvocationDirect2D.cpp	                        (rev 0)
+++ trunk/Tools/WebKitTestRunner/win/TestInvocationDirect2D.cpp	2019-09-20 04:55:55 UTC (rev 250121)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009-2019 Apple Inc. All rights reserved.
+ *           (C) 2011 Brent Fulgham <[email protected]>. All rights reserved.
+ *           (C) 2010, 2011 Igalia S.L
+ *           (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestInvocation.h"
+
+#include "PixelDumpSupport.h"
+#include "PlatformWebView.h"
+#include "TestController.h"
+#include <WebCore/NotImplemented.h>
+#include <cstdio>
+#include <wtf/Assertions.h>
+#include <wtf/MD5.h>
+#include <wtf/StringExtras.h>
+
+namespace WTR {
+
+
+void TestInvocation::dumpPixelsAndCompareWithExpected(SnapshotResultType, WKArrayRef /* repaintRects */, WKImageRef)
+{
+    notImplemented();
+}
+
+} // namespace WTR
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to