Changeset 263625 in webkit
- Timestamp:
- Jun 27, 2020 10:00:49 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 added
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r263616 r263625 1 2020-06-27 Philippe Normand <pnormand@igalia.com> 2 3 Migrate run-minibrowser to webkitpy 4 https://bugs.webkit.org/show_bug.cgi?id=213431 5 6 Reviewed by Jonathan Bedard. 7 8 The perl version was renamed to old-run-minibrowser and remains used by the Mac ports. 9 run-minibrowser is now a Python script hooking into webkitpy and the Port infrastructure. 10 Both WPE and GTK ports will now use the pure python implementation. 11 12 * Scripts/old-run-minibrowser: Copied from Tools/Scripts/run-minibrowser. 13 * Scripts/run-minibrowser: 14 * Scripts/webkitpy/minibrowser/run_minibrowser.py: Added. 15 (main): 16 (parse_args): 17 * Scripts/webkitpy/port/base.py: 18 (Port.run_minibrowser_arguments): 19 (Port): 20 (Port.run_minibrowser): 21 * Scripts/webkitpy/port/darwin.py: 22 (DarwinPort.environment_for_api_tests): 23 (DarwinPort): 24 (DarwinPort.run_minibrowser_arguments): 25 * Scripts/webkitpy/port/gtk.py: 26 (GtkPort.show_results_html_file): 27 (GtkPort.configuration_for_upload): 28 (GtkPort): 29 (GtkPort.run_minibrowser): 30 * Scripts/webkitpy/port/wpe.py: 31 (WPEPort.show_results_html_file): 32 (WPEPort.configuration_for_upload): 33 (WPEPort): 34 (WPEPort.run_minibrowser): 35 1 36 2020-06-27 Stephan Szabo <stephan.szabo@sony.com> 2 37 -
trunk/Tools/Scripts/old-run-minibrowser
r263624 r263625 33 33 use strict; 34 34 use warnings; 35 use File::Spec::Functions qw/catdir/;36 35 use FindBin; 37 36 use lib $FindBin::Bin; 38 37 use webkitdirs; 39 38 40 my $launcherName;41 my $launcherPath;42 my @jhbuildWrapper;43 44 39 prohibitUnknownPort(); 45 40 setConfiguration(); 46 41 47 if (isGtk() || isWPE()) { 48 my @command = (File::Spec->catfile(sourceDir(), "Tools", "Scripts", "run-minibrowser")); 49 runInFlatpakIfAvailable(@command); 50 51 # Check to see that all the frameworks are built. 52 checkFrameworks(); 53 54 $launcherPath = catdir(productDir(), "bin", "MiniBrowser"); 55 die "Can't find $launcherPath" unless -x $launcherPath; 56 @jhbuildWrapper = wrapperPrefixIfNeeded(); 57 print "Starting MiniBrowser.\n"; 58 exec @jhbuildWrapper, $launcherPath, @ARGV or die; 59 } elsif (isAppleCocoaWebKit()) { 42 if (isAppleCocoaWebKit()) { 60 43 printHelpAndExitForRunAndDebugWebKitAppIfNeeded(); 61 44 exit exitStatus(runMiniBrowser()); -
trunk/Tools/Scripts/run-minibrowser
r258626 r263625 1 #!/usr/bin/env perl 1 #!/usr/bin/env python 2 # Copyright (C) 2020 Igalia S.L. 3 # 4 # This program is free software; you can redistribute it and/or 5 # modify it under the terms of the GNU Lesser General Public 6 # License as published by the Free Software Foundation; either 7 # version 2.1 of the License, or (at your option) any later version. 8 # 9 # This program is distributed in the hope that it will be useful, 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 # Lesser General Public License for more details. 13 # 14 # You should have received a copy of the GNU Lesser General Public 15 # License along with this program; if not, write to the 16 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 # Boston, MA 02110-1301, USA. 2 18 3 # Copyright (C) 2005, 2007, 2013 Apple Inc. All rights reserved. 4 # Copyright (C) 2007 Staikos Computing Services, Inc. <info@staikos.net> 19 """Wrapper around webkitpy/minibrowser/run_webkit_app.py""" 20 import os 21 import sys 22 from webkitpy.minibrowser import run_webkit_app 5 23 6 # 7 # Redistribution and use in source and binary forms, with or without 8 # modification, are permitted provided that the following conditions 9 # are met: 10 # 11 # 1. Redistributions of source code must retain the above copyright 12 # notice, this list of conditions and the following disclaimer. 13 # 2. Redistributions in binary form must reproduce the above copyright 14 # notice, this list of conditions and the following disclaimer in the 15 # documentation and/or other materials provided with the distribution. 16 # 3. Neither the name of Apple Inc. ("Apple") nor the names of 17 # its contributors may be used to endorse or promote products derived 18 # from this software without specific prior written permission. 19 # 20 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 21 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 24 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..')) 25 if sys.platform.startswith('linux'): 26 sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak')) 27 import flatpakutils 28 flatpakutils.run_in_sandbox_if_available(sys.argv) 30 29 31 # Simplified "run" script for launching the WebKit2 MiniBrowser. 32 33 use strict; 34 use warnings; 35 use File::Spec::Functions qw/catdir/; 36 use FindBin; 37 use lib $FindBin::Bin; 38 use webkitdirs; 39 40 my $launcherName; 41 my $launcherPath; 42 my @jhbuildWrapper; 43 44 prohibitUnknownPort(); 45 setConfiguration(); 46 47 if (isGtk() || isWPE()) { 48 my @command = (File::Spec->catfile(sourceDir(), "Tools", "Scripts", "run-minibrowser")); 49 runInFlatpakIfAvailable(@command); 50 51 # Check to see that all the frameworks are built. 52 checkFrameworks(); 53 54 $launcherPath = catdir(productDir(), "bin", "MiniBrowser"); 55 die "Can't find $launcherPath" unless -x $launcherPath; 56 @jhbuildWrapper = wrapperPrefixIfNeeded(); 57 print "Starting MiniBrowser.\n"; 58 exec @jhbuildWrapper, $launcherPath, @ARGV or die; 59 } elsif (isAppleCocoaWebKit()) { 60 printHelpAndExitForRunAndDebugWebKitAppIfNeeded(); 61 exit exitStatus(runMiniBrowser()); 62 } else { 63 die "Unsupported platform." 64 } 30 run_webkit_app.main(sys.argv[1:]) -
trunk/Tools/Scripts/webkitpy/port/base.py
r263610 r263625 31 31 test infrastructure (the Port and Driver classes).""" 32 32 33 import argparse 33 34 import difflib 34 35 import json … … 790 791 791 792 def set_option_default(self, name, default_value): 792 return self._options.ensure_value(name, default_value) 793 if isinstance(self._options, argparse.Namespace): 794 if not hasattr(self._options, name): 795 setattr(self._options, name, default_value) 796 return True 797 else: 798 return self._options.ensure_value(name, default_value) 793 799 794 800 @memoized … … 1362 1368 return self._build_path('ImageDiff') 1363 1369 1370 def run_minibrowser(self, args): 1371 # FIXME: Migrate to webkitpy based run-minibrowser. https://bugs.webkit.org/show_bug.cgi?id=213464 1372 return self._run_script(["old-run-minibrowser", ] + args) 1373 1364 1374 @memoized 1365 1375 def _path_to_image_diff(self): -
trunk/Tools/Scripts/webkitpy/port/gtk.py
r261383 r263625 232 232 233 233 def show_results_html_file(self, results_filename): 234 self. _run_script("run-minibrowser",[path.abspath_to_uri(self.host.platform, results_filename)])234 self.run_minibrowser([path.abspath_to_uri(self.host.platform, results_filename)]) 235 235 236 236 def check_sys_deps(self): … … 261 261 configuration['version_name'] = self._display_server.capitalize() if self._display_server else 'Xvfb' 262 262 return configuration 263 264 def run_minibrowser(self, args): 265 miniBrowser = self._build_path('bin', 'MiniBrowser') 266 if not self._filesystem.isfile(miniBrowser): 267 print("%s not found... Did you run build-webkit?" % miniBrowser) 268 return 1 269 command = [miniBrowser] 270 if self._should_use_jhbuild(): 271 command = self._jhbuild_wrapper + command 272 return self._executive.run_command(command + args, cwd=self.webkit_base()) -
trunk/Tools/Scripts/webkitpy/port/gtk_unittest.py
r261383 r263625 70 70 port = self.make_port() 71 71 port._executive = MockExecutive(should_log=True) 72 expected_logs = "MOCK run_command: ['Tools/Scripts/run-minibrowser', '--release', '--gtk', 'file://test.html'], cwd=/mock-checkout\n" 72 port._filesystem = MockFileSystem({ 73 "/mock-build/bin/MiniBrowser": "" 74 }) 75 expected_logs = "MOCK run_command: ['/mock-build/bin/MiniBrowser', 'file://test.html'], cwd=/mock-checkout\n" 73 76 OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs) 74 77 -
trunk/Tools/Scripts/webkitpy/port/wpe.py
r263261 r263625 94 94 95 95 def show_results_html_file(self, results_filename): 96 self. _run_script("run-minibrowser",[path.abspath_to_uri(self.host.platform, results_filename)])96 self.run_minibrowser([path.abspath_to_uri(self.host.platform, results_filename)]) 97 97 98 98 def check_sys_deps(self): … … 135 135 configuration['platform'] = 'WPE' 136 136 return configuration 137 138 def run_minibrowser(self, args): 139 miniBrowser = self._build_path('bin', 'MiniBrowser') 140 if not self._filesystem.isfile(miniBrowser): 141 print("%s not found... Did you run build-webkit?" % miniBrowser) 142 return 1 143 command = [miniBrowser] 144 if self._should_use_jhbuild(): 145 command = self._jhbuild_wrapper + command 146 return self._executive.run_command(command + args, cwd=self.webkit_base())
Note: See TracChangeset
for help on using the changeset viewer.