<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[248270] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/248270">248270</a></dd>
<dt>Author</dt> <dd>jbedard@apple.com</dd>
<dt>Date</dt> <dd>2019-08-05 09:42:24 -0700 (Mon, 05 Aug 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>run-webkit-tests asserts when the iPhone XR simulator is running
https://bugs.webkit.org/show_bug.cgi?id=200404
<rdar://problem/53878739>

Reviewed by Dean Jackson.

Support unicode in all logging statements tied to device model.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run):
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.print_baseline_search_path):
* Scripts/webkitpy/port/device.py:
(Device.__repr__):
* Scripts/webkitpy/port/device_port.py:
(DevicePort._install):
(DevicePort.setup_test_run):
(DevicePort.clean_up_test_run):
(DevicePort.configuration_for_upload):
* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path):
* Scripts/webkitpy/xcode/device_type.py:
(DeviceType.__str__):
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.populate_available_devices):
(SimulatedDeviceManager._find_available_name):
(SimulatedDeviceManager._get_device_identifier_for_type):
(SimulatedDeviceManager._create_or_find_device_for_request):
(SimulatedDeviceManager._does_fulfill_request):
(SimulatedDeviceManager._wait_until_device_in_state):
(SimulatedDeviceManager._wait_until_device_is_usable):
(SimulatedDeviceManager._boot_device):
(SimulatedDeviceManager.initialize_devices):
(SimulatedDeviceManager.max_supported_simulators):
(SimulatedDeviceManager.swap):
(SimulatedDevice.is_usable):
(SimulatedDevice._shut_down):
(SimulatedDevice._delete):
(SimulatedDevice.launch_app):
(SimulatedDevice.__repr__):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testscontrollersmanagerpy">trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsviewsprintingpy">trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportdevicepy">trunk/Tools/Scripts/webkitpy/port/device.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportdevice_portpy">trunk/Tools/Scripts/webkitpy/port/device_port.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportiospy">trunk/Tools/Scripts/webkitpy/port/ios.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyxcodedevice_typepy">trunk/Tools/Scripts/webkitpy/xcode/device_type.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyxcodesimulated_devicepy">trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/ChangeLog       2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2019-08-05  Jonathan Bedard  <jbedard@apple.com>
+
+        run-webkit-tests asserts when the iPhone XR simulator is running
+        https://bugs.webkit.org/show_bug.cgi?id=200404
+        <rdar://problem/53878739>
+
+        Reviewed by Dean Jackson.
+
+        Support unicode in all logging statements tied to device model.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager.run):
+        * Scripts/webkitpy/layout_tests/views/printing.py:
+        (Printer.print_baseline_search_path):
+        * Scripts/webkitpy/port/device.py:
+        (Device.__repr__):
+        * Scripts/webkitpy/port/device_port.py:
+        (DevicePort._install):
+        (DevicePort.setup_test_run):
+        (DevicePort.clean_up_test_run):
+        (DevicePort.configuration_for_upload):
+        * Scripts/webkitpy/port/ios.py:
+        (IOSPort.default_baseline_search_path):
+        * Scripts/webkitpy/xcode/device_type.py:
+        (DeviceType.__str__):
+        * Scripts/webkitpy/xcode/simulated_device.py:
+        (SimulatedDeviceManager.populate_available_devices):
+        (SimulatedDeviceManager._find_available_name):
+        (SimulatedDeviceManager._get_device_identifier_for_type):
+        (SimulatedDeviceManager._create_or_find_device_for_request):
+        (SimulatedDeviceManager._does_fulfill_request):
+        (SimulatedDeviceManager._wait_until_device_in_state):
+        (SimulatedDeviceManager._wait_until_device_is_usable):
+        (SimulatedDeviceManager._boot_device):
+        (SimulatedDeviceManager.initialize_devices):
+        (SimulatedDeviceManager.max_supported_simulators):
+        (SimulatedDeviceManager.swap):
+        (SimulatedDevice.is_usable):
+        (SimulatedDevice._shut_down):
+        (SimulatedDevice._delete):
+        (SimulatedDevice.launch_app):
+        (SimulatedDevice.__repr__):
+
</ins><span class="cx"> 2019-08-04  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Ping loads should not prevent page caching
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testscontrollersmanagerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py    2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -184,8 +184,8 @@
</span><span class="cx">         device_type_list = self._port.supported_device_types()
</span><span class="cx">         for device_type in device_type_list:
</span><span class="cx">             """Run the tests and return a RunDetails object with the results."""
</span><del>-            for_device_type = 'for {} '.format(device_type) if device_type else ''
-            self._printer.write_update('Collecting tests {}...'.format(for_device_type))
</del><ins>+            for_device_type = u'for {} '.format(device_type) if device_type else ''
+            self._printer.write_update(u'Collecting tests {}...'.format(for_device_type))
</ins><span class="cx">             try:
</span><span class="cx">                 paths, test_names = self._collect_tests(args, device_type=device_type)
</span><span class="cx">             except IOError:
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">                 # This is raised if --test-list doesn't exist
</span><span class="cx">                 return test_run_results.RunDetails(exit_code=-1)
</span><span class="cx"> 
</span><del>-            self._printer.write_update('Parsing expectations {}...'.format(for_device_type))
</del><ins>+            self._printer.write_update(u'Parsing expectations {}...'.format(for_device_type))
</ins><span class="cx">             self._expectations[device_type] = test_expectations.TestExpectations(self._port, test_names, force_expectations_pass=self._options.force, device_type=device_type)
</span><span class="cx">             self._expectations[device_type].parse_all_expectations()
</span><span class="cx"> 
</span><span class="lines">@@ -259,7 +259,7 @@
</span><span class="cx"> 
</span><span class="cx">             self._printer.print_baseline_search_path(device_type=device_type)
</span><span class="cx"> 
</span><del>-            _log.info('Running {}{}'.format(pluralize(len(tests_to_run_by_device[device_type]), 'test'), ' for {}'.format(str(device_type)) if device_type else ''))
</del><ins>+            _log.info(u'Running {}{}'.format(pluralize(len(tests_to_run_by_device[device_type]), 'test'), u' for {}'.format(device_type) if device_type else ''))
</ins><span class="cx">             _log.info('')
</span><span class="cx">             start_time_for_device = time.time()
</span><span class="cx">             if not tests_to_run_by_device[device_type]:
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsviewsprintingpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py      2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py 2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -99,12 +99,12 @@
</span><span class="cx">         normalize_baseline = lambda baseline_search_path: [
</span><span class="cx">             fs.relpath(x, self._port.layout_tests_dir()).replace("../", "") for x in baseline_search_path]
</span><span class="cx"> 
</span><del>-        self._print_default('Verbose baseline search path: {} -> generic'.format(
-            ' -> '.join(normalize_baseline(full_baseline_search_path))))
</del><ins>+        self._print_default(u'Verbose baseline search path: {} -> generic'.format(
+            u' -> '.join(normalize_baseline(full_baseline_search_path))))
</ins><span class="cx"> 
</span><span class="cx">         self._print_default('')
</span><del>-        self._print_default('Baseline search path: {} -> generic'.format(
-            ' -> '.join(normalize_baseline([path for path in full_baseline_search_path if fs.exists(path)]))))
</del><ins>+        self._print_default(u'Baseline search path: {} -> generic'.format(
+            u' -> '.join(normalize_baseline([path for path in full_baseline_search_path if fs.exists(path)]))))
</ins><span class="cx">         self._print_default('')
</span><span class="cx"> 
</span><span class="cx">     def print_found(self, num_all_test_files, num_to_run, repeat_each, iterations):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportdevicepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/device.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/device.py      2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/port/device.py 2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -115,4 +115,4 @@
</span><span class="cx">         return not self.__eq__(other)
</span><span class="cx"> 
</span><span class="cx">     def __repr__(self):
</span><del>-        return str(self.platform_device)
</del><ins>+        return u'{}'.format(self.platform_device)
</ins></span></pre></div>
<a id="trunkToolsScriptswebkitpyportdevice_portpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/device_port.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/device_port.py 2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/port/device_port.py    2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx">         for i in xrange(self.child_processes()):
</span><span class="cx">             device = self.target_host(i)
</span><del>-            _log.debug('Installing to {}'.format(device))
</del><ins>+            _log.debug(u'Installing to {}'.format(device))
</ins><span class="cx">             # Without passing DYLD_LIBRARY_PATH, libWebCoreTestSupport cannot be loaded and DRT/WKTR will crash pre-launch,
</span><span class="cx">             # leaving a crash log which will be picked up in results. DYLD_FRAMEWORK_PATH is needed to prevent an early crash.
</span><span class="cx">             if not device.install_app(self._path_to_driver(), {'DYLD_LIBRARY_PATH': self._build_path(), 'DYLD_FRAMEWORK_PATH': self._build_path()}):
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">             raise RuntimeError(self.NO_DEVICE_MANAGER)
</span><span class="cx"> 
</span><span class="cx">         device_type = self._device_type_with_version(device_type)
</span><del>-        _log.debug('\nCreating devices for {}'.format(device_type))
</del><ins>+        _log.debug(u'\nCreating devices for {}'.format(device_type))
</ins><span class="cx"> 
</span><span class="cx">         request = DeviceRequest(
</span><span class="cx">             device_type,
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx">                 if isinstance(e, Exception):
</span><span class="cx">                     exception_list.append([e, trace])
</span><span class="cx">                 else:
</span><del>-                    exception_list.append([Exception('Exception while tearing down {}'.format(device)), trace])
</del><ins>+                    exception_list.append([Exception(u'Exception while tearing down {}'.format(device)), trace])
</ins><span class="cx"> 
</span><span class="cx">         if len(exception_list) == 1:
</span><span class="cx">             raise
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">         device_type = host.device_type if host else self.DEVICE_TYPE
</span><span class="cx">         model = device_type.hardware_family
</span><span class="cx">         if model and device_type.hardware_type:
</span><del>-            model += ' {}'.format(device_type.hardware_type)
</del><ins>+            model += u' {}'.format(device_type.hardware_type)
</ins><span class="cx"> 
</span><span class="cx">         version = self.device_version()
</span><span class="cx">         version_name = None
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportiospy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/ios.py 2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py    2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -74,12 +74,12 @@
</span><span class="cx"> 
</span><span class="cx">         base_variants = []
</span><span class="cx">         if hardware_family and hardware_type:
</span><del>-            base_variants.append('{}-{}-{}'.format(hardware_family, hardware_type, runtime_type))
</del><ins>+            base_variants.append(u'{}-{}-{}'.format(hardware_family, hardware_type, runtime_type))
</ins><span class="cx">         if hardware_family:
</span><del>-            base_variants.append('{}-{}'.format(hardware_family, runtime_type))
-        base_variants.append('{}-{}'.format(IOSPort.port_name, runtime_type))
</del><ins>+            base_variants.append(u'{}-{}'.format(hardware_family, runtime_type))
+        base_variants.append(u'{}-{}'.format(IOSPort.port_name, runtime_type))
</ins><span class="cx">         if hardware_family and hardware_type:
</span><del>-            base_variants.append('{}-{}'.format(hardware_family, hardware_type))
</del><ins>+            base_variants.append(u'{}-{}'.format(hardware_family, hardware_type))
</ins><span class="cx">         if hardware_family:
</span><span class="cx">             base_variants.append(hardware_family)
</span><span class="cx">         base_variants.append(IOSPort.port_name)
</span><span class="lines">@@ -92,15 +92,15 @@
</span><span class="cx">                     apple_name = VersionNameMap.map(self.host.platform).to_name(version, platform=IOSPort.port_name, table=INTERNAL_TABLE)
</span><span class="cx"> 
</span><span class="cx">                 if apple_name:
</span><del>-                    expectations.append(self._apple_baseline_path('{}-{}-{}'.format(variant, apple_name.lower().replace(' ', ''), wk_string)))
-                expectations.append(self._webkit_baseline_path('{}-{}-{}'.format(variant, version.major, wk_string)))
</del><ins>+                    expectations.append(self._apple_baseline_path(u'{}-{}-{}'.format(variant, apple_name.lower().replace(' ', ''), wk_string)))
+                expectations.append(self._webkit_baseline_path(u'{}-{}-{}'.format(variant, version.major, wk_string)))
</ins><span class="cx">                 if apple_name:
</span><del>-                    expectations.append(self._apple_baseline_path('{}-{}'.format(variant, apple_name.lower().replace(' ', ''))))
-                expectations.append(self._webkit_baseline_path('{}-{}'.format(variant, version.major)))
</del><ins>+                    expectations.append(self._apple_baseline_path(u'{}-{}'.format(variant, apple_name.lower().replace(' ', ''))))
+                expectations.append(self._webkit_baseline_path(u'{}-{}'.format(variant, version.major)))
</ins><span class="cx"> 
</span><span class="cx">             if apple_additions():
</span><del>-                expectations.append(self._apple_baseline_path('{}-{}'.format(variant, wk_string)))
-            expectations.append(self._webkit_baseline_path('{}-{}'.format(variant, wk_string)))
</del><ins>+                expectations.append(self._apple_baseline_path(u'{}-{}'.format(variant, wk_string)))
+            expectations.append(self._webkit_baseline_path(u'{}-{}'.format(variant, wk_string)))
</ins><span class="cx">             if apple_additions():
</span><span class="cx">                 expectations.append(self._apple_baseline_path(variant))
</span><span class="cx">             expectations.append(self._webkit_baseline_path(variant))
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyxcodedevice_typepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/xcode/device_type.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/xcode/device_type.py        2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/xcode/device_type.py   2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -115,9 +115,9 @@
</span><span class="cx">         elif self.software_version:
</span><span class="cx">             version = VersionNameMap.map().to_name(self.software_version, platform=self.software_variant.lower())
</span><span class="cx"> 
</span><del>-        return '{hardware_family}{hardware_type} running {version}'.format(
</del><ins>+        return u'{hardware_family}{hardware_type} running {version}'.format(
</ins><span class="cx">             hardware_family=self.hardware_family if self.hardware_family else 'Device',
</span><del>-            hardware_type=' {}'.format(self.hardware_type) if self.hardware_type else '',
</del><ins>+            hardware_type=u' {}'.format(self.hardware_type) if self.hardware_type else '',
</ins><span class="cx">             version=version or self.software_variant,
</span><span class="cx">         )
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyxcodesimulated_devicepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py (248269 => 248270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py   2019-08-05 16:26:00 UTC (rev 248269)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py      2019-08-05 16:42:24 UTC (rev 248270)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">             return
</span><span class="cx"> 
</span><span class="cx">         try:
</span><del>-            simctl_json = json.loads(host.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'list', '--json']))
</del><ins>+            simctl_json = json.loads(host.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'list', '--json'], decode_output=False))
</ins><span class="cx">         except (ValueError, ScriptError):
</span><span class="cx">             return
</span><span class="cx"> 
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">     def _find_available_name(name_base):
</span><span class="cx">         created_index = 0
</span><span class="cx">         while True:
</span><del>-            name = '{} {}'.format(name_base, created_index)
</del><ins>+            name = u'{} {}'.format(name_base, created_index)
</ins><span class="cx">             created_index += 1
</span><span class="cx">             for device in SimulatedDeviceManager.INITIALIZED_DEVICES:
</span><span class="cx">                 if device is None:
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">     @staticmethod
</span><span class="cx">     def _get_device_identifier_for_type(device_type):
</span><span class="cx">         for type_id, type_name in SimulatedDeviceManager._device_identifier_to_name.iteritems():
</span><del>-            if type_name.lower() == '{} {}'.format(device_type.hardware_family.lower(), device_type.hardware_type.lower()):
</del><ins>+            if type_name.lower() == u'{} {}'.format(device_type.hardware_family.lower(), device_type.hardware_type.lower()):
</ins><span class="cx">                 return type_id
</span><span class="cx">         return None
</span><span class="cx"> 
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">                 device.platform_device._delete()
</span><span class="cx">                 break
</span><span class="cx"> 
</span><del>-        _log.debug("Creating device '{}', of type {}".format(name, device_type))
</del><ins>+        _log.debug(u"Creating device '{}', of type {}".format(name, device_type))
</ins><span class="cx">         host.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'create', name, device_identifier, runtime.identifier])
</span><span class="cx"> 
</span><span class="cx">         # We just added a device, so our list of _available_devices needs to be re-synced.
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">             if not request.use_booted_simulator:
</span><span class="cx">                 continue
</span><span class="cx">             if request.device_type == device.device_type:
</span><del>-                _log.debug("The request for '{}' matched {} exactly".format(request.device_type, device))
</del><ins>+                _log.debug(u"The request for '{}' matched {} exactly".format(request.device_type, device))
</ins><span class="cx">                 return request
</span><span class="cx"> 
</span><span class="cx">         # Contained-in match.
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">             if not request.use_booted_simulator:
</span><span class="cx">                 continue
</span><span class="cx">             if device.device_type in request.device_type:
</span><del>-                _log.debug("The request for '{}' fuzzy-matched {}".format(request.device_type, device))
</del><ins>+                _log.debug(u"The request for '{}' fuzzy-matched {}".format(request.device_type, device))
</ins><span class="cx">                 return request
</span><span class="cx"> 
</span><span class="cx">         # DeviceRequests are compared by reference
</span><span class="lines">@@ -307,8 +307,8 @@
</span><span class="cx">             if not request.use_booted_simulator or not request.allow_incomplete_match:
</span><span class="cx">                 continue
</span><span class="cx">             if request.device_type.software_variant == device.device_type.software_variant:
</span><del>-                _log.warn("The request for '{}' incomplete-matched {}".format(request.device_type, device))
-                _log.warn("This may cause unexpected behavior in code that expected the device type {}".format(request.device_type))
</del><ins>+                _log.warn(u"The request for '{}' incomplete-matched {}".format(request.device_type, device))
+                _log.warn(u"This may cause unexpected behavior in code that expected the device type {}".format(request.device_type))
</ins><span class="cx">                 return request
</span><span class="cx">         return None
</span><span class="cx"> 
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx">     @staticmethod
</span><span class="cx">     def _wait_until_device_in_state(device, state, deadline):
</span><span class="cx">         while device.platform_device.state(force_update=True) != state:
</span><del>-            _log.debug('Waiting on {} to enter state {}...'.format(device, SimulatedDevice.NAME_FOR_STATE[state]))
</del><ins>+            _log.debug(u'Waiting on {} to enter state {}...'.format(device, SimulatedDevice.NAME_FOR_STATE[state]))
</ins><span class="cx">             time.sleep(1)
</span><span class="cx">             if time.time() > deadline:
</span><span class="cx">                 raise RuntimeError('Timed out while waiting for all devices to boot')
</span><span class="lines">@@ -322,15 +322,15 @@
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><span class="cx">     def _wait_until_device_is_usable(device, deadline):
</span><del>-        _log.debug('Waiting until {} is usable'.format(device))
</del><ins>+        _log.debug(u'Waiting until {} is usable'.format(device))
</ins><span class="cx">         while not device.platform_device.is_usable(force_update=True):
</span><span class="cx">             if time.time() > deadline:
</span><del>-                raise RuntimeError('Timed out while waiting for {} to become usable'.format(device))
</del><ins>+                raise RuntimeError(u'Timed out while waiting for {} to become usable'.format(device))
</ins><span class="cx">             time.sleep(1)
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><span class="cx">     def _boot_device(device, host=SystemHost()):
</span><del>-        _log.debug("Booting device '{}'".format(device.udid))
</del><ins>+        _log.debug(u"Booting device '{}'".format(device.udid))
</ins><span class="cx">         device.platform_device.booted_by_script = True
</span><span class="cx">         host.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'boot', device.udid])
</span><span class="cx">         SimulatedDeviceManager.INITIALIZED_DEVICES.append(device)
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx">             if matched_request is None:
</span><span class="cx">                 continue
</span><span class="cx">             requests.remove(matched_request)
</span><del>-            _log.debug('Attached to running simulator {}'.format(device))
</del><ins>+            _log.debug(u'Attached to running simulator {}'.format(device))
</ins><span class="cx">             SimulatedDeviceManager.INITIALIZED_DEVICES.append(device)
</span><span class="cx"> 
</span><span class="cx">             # DeviceRequests are compared by reference
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx">         try:
</span><span class="cx">             system_process_count_limit = int(host.executive.run_command(['/usr/bin/ulimit', '-u']).strip())
</span><span class="cx">             current_process_count = len(host.executive.run_command(['/bin/ps', 'aux']).strip().split('\n'))
</span><del>-            _log.debug('Process limit: {}, current #processes: {}'.format(system_process_count_limit, current_process_count))
</del><ins>+            _log.debug(u'Process limit: {}, current #processes: {}'.format(system_process_count_limit, current_process_count))
</ins><span class="cx">         except (ValueError, ScriptError):
</span><span class="cx">             return 0
</span><span class="cx"> 
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx">         max_supported_simulators_locally = (system_process_count_limit - current_process_count) // SimulatedDeviceManager.PROCESS_COUNT_ESTIMATE_PER_SIMULATOR_INSTANCE
</span><span class="cx"> 
</span><span class="cx">         if (max_supported_simulators_locally < max_supported_simulators_for_hardware):
</span><del>-            _log.warn('This machine could support {} simulators, but is only configured for {}.'.format(max_supported_simulators_for_hardware, max_supported_simulators_locally))
</del><ins>+            _log.warn(u'This machine could support {} simulators, but is only configured for {}.'.format(max_supported_simulators_for_hardware, max_supported_simulators_locally))
</ins><span class="cx">             _log.warn('Please see <https://trac.webkit.org/wiki/IncreasingKernelLimits>.')
</span><span class="cx"> 
</span><span class="cx">         if max_supported_simulators_locally == 0:
</span><span class="lines">@@ -434,7 +434,7 @@
</span><span class="cx">         if SimulatedDeviceManager.INITIALIZED_DEVICES is None:
</span><span class="cx">             raise RuntimeError('Cannot swap when there are no initialized devices')
</span><span class="cx">         if device not in SimulatedDeviceManager.INITIALIZED_DEVICES:
</span><del>-            raise RuntimeError('{} is not initialized, cannot swap it'.format(device))
</del><ins>+            raise RuntimeError(u'{} is not initialized, cannot swap it'.format(device))
</ins><span class="cx"> 
</span><span class="cx">         index = SimulatedDeviceManager.INITIALIZED_DEVICES.index(device)
</span><span class="cx">         SimulatedDeviceManager.INITIALIZED_DEVICES[index] = None
</span><span class="lines">@@ -445,7 +445,7 @@
</span><span class="cx"> 
</span><span class="cx">         if not device.platform_device.is_booted_or_booting(force_update=True):
</span><span class="cx">             device.platform_device.booted_by_script = True
</span><del>-            _log.debug("Booting device '{}'".format(device.udid))
</del><ins>+            _log.debug(u"Booting device '{}'".format(device.udid))
</ins><span class="cx">             host.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'boot', device.udid])
</span><span class="cx">         SimulatedDeviceManager.INITIALIZED_DEVICES[index] = device
</span><span class="cx"> 
</span><span class="lines">@@ -531,7 +531,7 @@
</span><span class="cx">         elif self.device_type.software_variant == 'watchOS':
</span><span class="cx">             home_screen_service = 'com.apple.carousel.sessionservice'
</span><span class="cx">         else:
</span><del>-            _log.debug('{} has no service to check if the device is usable'.format(self.device_type.software_variant))
</del><ins>+            _log.debug(u'{} has no service to check if the device is usable'.format(self.device_type.software_variant))
</ins><span class="cx">             return True
</span><span class="cx"> 
</span><span class="cx">         for line in self.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'spawn', self.udid, 'launchctl', 'print', 'system'], decode_output=False).splitlines():
</span><span class="lines">@@ -545,17 +545,17 @@
</span><span class="cx">         # Either shutdown is successful, or the device was already shutdown when we attempted to shut it down.
</span><span class="cx">         exit_code = self.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'shutdown', self.udid], return_exit_code=True)
</span><span class="cx">         if exit_code != 0 and self.state() != SimulatedDevice.DeviceState.SHUT_DOWN:
</span><del>-            raise RuntimeError('Failed to shutdown {} with exit code {}'.format(self.udid, exit_code))
</del><ins>+            raise RuntimeError(u'Failed to shutdown {} with exit code {}'.format(self.udid, exit_code))
</ins><span class="cx"> 
</span><span class="cx">         while self.state(force_update=True) != SimulatedDevice.DeviceState.SHUT_DOWN:
</span><span class="cx">             time.sleep(.5)
</span><span class="cx">             if time.time() > deadline:
</span><del>-                raise RuntimeError('Timed out while waiting for {} to shut down'.format(self.udid))
</del><ins>+                raise RuntimeError(u'Timed out while waiting for {} to shut down'.format(self.udid))
</ins><span class="cx"> 
</span><span class="cx">     def _delete(self, timeout=10.0):
</span><span class="cx">         deadline = time.time() + timeout
</span><span class="cx">         self._shut_down(deadline - time.time())
</span><del>-        _log.debug("Removing device '{}'".format(self.name))
</del><ins>+        _log.debug(u"Removing device '{}'".format(self.name))
</ins><span class="cx">         self.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'delete', self.udid])
</span><span class="cx"> 
</span><span class="cx">         # This will (by design) fail if run more than once on the same SimulatedDevice
</span><span class="lines">@@ -603,7 +603,7 @@
</span><span class="cx"> 
</span><span class="cx">         output = None
</span><span class="cx"> 
</span><del>-        with Timeout(timeout, RuntimeError('Timed out waiting for process to open {} on {}'.format(bundle_id, self.udid))):
</del><ins>+        with Timeout(timeout, RuntimeError(u'Timed out waiting for process to open {} on {}'.format(bundle_id, self.udid))):
</ins><span class="cx">             while True:
</span><span class="cx">                 output = self.executive.run_command(
</span><span class="cx">                     ['xcrun', 'simctl', 'launch', self.udid, bundle_id] + args,
</span><span class="lines">@@ -615,13 +615,13 @@
</span><span class="cx">                 if match and self.executive.check_running_pid(int(match.group('pid'))):
</span><span class="cx">                     break
</span><span class="cx">                 if match:
</span><del>-                    _log.debug('simctl launch reported pid {}, but this process is not running'.format(match.group('pid')))
</del><ins>+                    _log.debug(u'simctl launch reported pid {}, but this process is not running'.format(match.group('pid')))
</ins><span class="cx">                 else:
</span><span class="cx">                     _log.debug('simctl launch did not report a pid')
</span><span class="cx"> 
</span><span class="cx">         if match.group('bundle') != bundle_id:
</span><del>-            raise RuntimeError('Failed to find process id for {}: {}'.format(bundle_id, output))
-        _log.debug('Returning pid {} of launched process'.format(match.group('pid')))
</del><ins>+            raise RuntimeError(u'Failed to find process id for {}: {}'.format(bundle_id, output))
+        _log.debug(u'Returning pid {} of launched process'.format(match.group('pid')))
</ins><span class="cx">         return int(match.group('pid'))
</span><span class="cx"> 
</span><span class="cx">     def __eq__(self, other):
</span><span class="lines">@@ -631,7 +631,7 @@
</span><span class="cx">         return not self.__eq__(other)
</span><span class="cx"> 
</span><span class="cx">     def __repr__(self):
</span><del>-        return '<Device "{name}": {udid}. State: {state}. Type: {type}>'.format(
</del><ins>+        return u'<Device "{name}": {udid}. State: {state}. Type: {type}>'.format(
</ins><span class="cx">             name=self.name,
</span><span class="cx">             udid=self.udid,
</span><span class="cx">             state=SimulatedDevice.NAME_FOR_STATE[self.state()],
</span></span></pre>
</div>
</div>

</body>
</html>