summaryrefslogtreecommitdiff
path: root/layout/tools/reftest/reftestcommandline.py
blob: da76fbd9a73139a7352bf266e215c0f2ebfa0c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
import argparse
import os
import sys
from collections import OrderedDict
from urlparse import urlparse

import mozlog

here = os.path.abspath(os.path.dirname(__file__))


class ReftestArgumentsParser(argparse.ArgumentParser):
    def __init__(self, **kwargs):
        super(ReftestArgumentsParser, self).__init__(**kwargs)

        # Try to import a MozbuildObject. Success indicates that we are
        # running from a source tree. This allows some defaults to be set
        # from the source tree.
        try:
            from mozbuild.base import MozbuildObject
            self.build_obj = MozbuildObject.from_environment(cwd=here)
        except ImportError:
            self.build_obj = None

        self.add_argument("--xre-path",
                          action="store",
                          type=str,
                          dest="xrePath",
                          # individual scripts will set a sane default
                          default=None,
                          help="absolute path to directory containing XRE (probably xulrunner)")

        self.add_argument("--symbols-path",
                          action="store",
                          type=str,
                          dest="symbolsPath",
                          default=None,
                          help="absolute path to directory containing breakpad symbols, or the URL of a zip file containing symbols")

        self.add_argument("--debugger",
                          action="store",
                          dest="debugger",
                          help="use the given debugger to launch the application")

        self.add_argument("--debugger-args",
                          action="store",
                          dest="debuggerArgs",
                          help="pass the given args to the debugger _before_ "
                          "the application on the command line")

        self.add_argument("--debugger-interactive",
                          action="store_true",
                          dest="debuggerInteractive",
                          help="prevents the test harness from redirecting "
                          "stdout and stderr for interactive debuggers")

        self.add_argument("--appname",
                          action="store",
                          type=str,
                          dest="app",
                          default=None,
                          help="absolute path to application, overriding default")

        self.add_argument("--extra-profile-file",
                          action="append",
                          dest="extraProfileFiles",
                          default=[],
                          help="copy specified files/dirs to testing profile")

        self.add_argument("--timeout",
                          action="store",
                          dest="timeout",
                          type=int,
                          default=5 * 60,  # 5 minutes per bug 479518
                          help="reftest will timeout in specified number of seconds. [default %(default)s].")

        self.add_argument("--leak-threshold",
                          action="store",
                          type=int,
                          dest="defaultLeakThreshold",
                          default=0,
                          help="fail if the number of bytes leaked in default "
                          "processes through refcounted objects (or bytes "
                          "in classes with MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) "
                          "is greater than the given number")

        self.add_argument("--utility-path",
                          action="store",
                          type=str,
                          dest="utilityPath",
                          default=self.build_obj.bindir if self.build_obj else None,
                          help="absolute path to directory containing utility "
                          "programs (xpcshell, ssltunnel, certutil)")

        self.add_argument("--total-chunks",
                          type=int,
                          dest="totalChunks",
                          help="how many chunks to split the tests up into")

        self.add_argument("--this-chunk",
                          type=int,
                          dest="thisChunk",
                          help="which chunk to run between 1 and --total-chunks")

        self.add_argument("--log-file",
                          action="store",
                          type=str,
                          dest="logFile",
                          default=None,
                          help="file to log output to in addition to stdout")

        self.add_argument("--skip-slow-tests",
                          dest="skipSlowTests",
                          action="store_true",
                          default=False,
                          help="skip tests marked as slow when running")

        self.add_argument("--ignore-window-size",
                          dest="ignoreWindowSize",
                          action="store_true",
                          default=False,
                          help="ignore the window size, which may cause spurious failures and passes")

        self.add_argument("--install-extension",
                          action="append",
                          dest="extensionsToInstall",
                          default=[],
                          help="install the specified extension in the testing profile. "
                          "The extension file's name should be <id>.xpi where <id> is "
                          "the extension's id as indicated in its install.rdf. "
                          "An optional path can be specified too.")

        self.add_argument("--marionette",
                          default=None,
                          help="host:port to use when connecting to Marionette")

        self.add_argument("--marionette-port-timeout",
                          default=None,
                          help=argparse.SUPPRESS)

        self.add_argument("--marionette-socket-timeout",
                          default=None,
                          help=argparse.SUPPRESS)

        self.add_argument("--marionette-startup-timeout",
                          default=None,
                          help=argparse.SUPPRESS)

        self.add_argument("--setenv",
                          action="append",
                          type=str,
                          default=[],
                          dest="environment",
                          metavar="NAME=VALUE",
                          help="sets the given variable in the application's "
                          "environment")

        self.add_argument("--filter",
                          action="store",
                          type=str,
                          dest="filter",
                          help="specifies a regular expression (as could be passed to the JS "
                          "RegExp constructor) to test against URLs in the reftest manifest; "
                          "only test items that have a matching test URL will be run.")

        self.add_argument("--shuffle",
                          action="store_true",
                          default=False,
                          dest="shuffle",
                          help="run reftests in random order")

        self.add_argument("--run-until-failure",
                          action="store_true",
                          default=False,
                          dest="runUntilFailure",
                          help="stop running on the first failure. Useful for RR recordings.")

        self.add_argument("--repeat",
                          action="store",
                          type=int,
                          default=0,
                          dest="repeat",
                          help="number of times the select test(s) will be executed. Useful for "
                          "finding intermittent failures.")

        self.add_argument("--focus-filter-mode",
                          action="store",
                          type=str,
                          dest="focusFilterMode",
                          default="all",
                          help="filters tests to run by whether they require focus. "
                          "Valid values are `all', `needs-focus', or `non-needs-focus'. "
                          "Defaults to `all'.")

        self.add_argument("--disable-e10s",
                          action="store_false",
                          default=True,
                          dest="e10s",
                          help="disables content processes")

        self.add_argument("--setpref",
                          action="append",
                          type=str,
                          default=[],
                          dest="extraPrefs",
                          metavar="PREF=VALUE",
                          help="defines an extra user preference")

        self.add_argument("--reftest-extension-path",
                          action="store",
                          dest="reftestExtensionPath",
                          help="Path to the reftest extension")

        self.add_argument("--special-powers-extension-path",
                          action="store",
                          dest="specialPowersExtensionPath",
                          help="Path to the special powers extension")

        self.add_argument("--suite",
                          choices=["reftest", "crashtest", "jstestbrowser"],
                          default=None,
                          help=argparse.SUPPRESS)

        self.add_argument("--cleanup-crashes",
                          action = "store_true",
                          dest = "cleanupCrashes",
                          default = False,
                          help = "Delete pending crash reports before running tests.")

        self.add_argument("tests",
                          metavar="TEST_PATH",
                          nargs="*",
                          help="Path to test file, manifest file, or directory containing tests")

        mozlog.commandline.add_logging_group(self)

    def get_ip(self):
        import moznetwork
        if os.name != "nt":
            return moznetwork.get_ip()
        else:
            self.error(
                "ERROR: you must specify a --remote-webserver=<ip address>\n")

    def set_default_suite(self, options):
        manifests = OrderedDict([("reftest.list", "reftest"),
                                 ("crashtests.list", "crashtest"),
                                 ("jstests.list", "jstestbrowser")])

        for test_path in options.tests:
            file_name = os.path.basename(test_path)
            if file_name in manifests:
                options.suite = manifests[file_name]
                return

        for test_path in options.tests:
            for manifest_file, suite in manifests.iteritems():
                if os.path.exists(os.path.join(test_path, manifest_file)):
                    options.suite = suite
                    return

        self.error("Failed to determine test suite; supply --suite to set this explicitly")

    def validate(self, options, reftest):
        if not options.tests:
            # Can't just set this in the argument parser because mach will set a default
            self.error("Must supply at least one path to a manifest file, test directory, or test file to run.")

        if options.suite is None:
            self.set_default_suite(options)

        if options.totalChunks is not None and options.thisChunk is None:
            self.error(
                "thisChunk must be specified when totalChunks is specified")

        if options.totalChunks:
            if not 1 <= options.thisChunk <= options.totalChunks:
                self.error("thisChunk must be between 1 and totalChunks")

        if options.logFile:
            options.logFile = reftest.getFullPath(options.logFile)

        if options.xrePath is not None:
            if not os.access(options.xrePath, os.F_OK):
                self.error("--xre-path '%s' not found" % options.xrePath)
            if not os.path.isdir(options.xrePath):
                self.error("--xre-path '%s' is not a directory" %
                           options.xrePath)
            options.xrePath = reftest.getFullPath(options.xrePath)

        if options.reftestExtensionPath is None:
            if self.build_obj is not None:
                reftestExtensionPath = os.path.join(self.build_obj.topobjdir, "_tests",
                                                    "reftest", "reftest")
            else:
                reftestExtensionPath = os.path.join(here, "reftest")
            options.reftestExtensionPath = os.path.normpath(reftestExtensionPath)

        if (options.specialPowersExtensionPath is None and
            options.suite in ["crashtest", "jstestbrowser"]):
            if self.build_obj is not None:
                specialPowersExtensionPath = os.path.join(self.build_obj.topobjdir, "_tests",
                                                          "reftest", "specialpowers")
            else:
                specialPowersExtensionPath = os.path.join(here, "specialpowers")
            options.specialPowersExtensionPath = os.path.normpath(specialPowersExtensionPath)

        options.leakThresholds = {
            "default": options.defaultLeakThreshold,
            "tab": 5000,  # See dependencies of bug 1051230.
        }


class DesktopArgumentsParser(ReftestArgumentsParser):
    def __init__(self, **kwargs):
        super(DesktopArgumentsParser, self).__init__(**kwargs)

        self.add_argument("--run-tests-in-parallel",
                          action="store_true",
                          default=False,
                          dest="runTestsInParallel",
                          help="run tests in parallel if possible")

    def _prefs_gpu(self):
        if mozinfo.os != "win":
            return ["layers.acceleration.force-enabled=true"]
        return []

    def validate(self, options, reftest):
        super(DesktopArgumentsParser, self).validate(options, reftest)

        if options.runTestsInParallel:
            if options.logFile is not None:
                self.error("cannot specify logfile with parallel tests")
            if options.totalChunks is not None or options.thisChunk is not None:
                self.error(
                    "cannot specify thisChunk or totalChunks with parallel tests")
            if options.focusFilterMode != "all":
                self.error("cannot specify focusFilterMode with parallel tests")
            if options.debugger is not None:
                self.error("cannot specify a debugger with parallel tests")

        if options.debugger:
            # valgrind and some debuggers may cause Gecko to start slowly. Make sure
            # marionette waits long enough to connect.
            options.marionette_port_timeout = 900
            options.marionette_socket_timeout = 540

        if not options.tests:
            self.error("No test files specified.")

        if options.app is None:
            bin_dir = (self.build_obj.get_binary_path() if
                       self.build_obj and self.build_obj.substs[
                           'MOZ_BUILD_APP'] != 'mobile/android'
                       else None)

            if bin_dir:
                options.app = bin_dir

        if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
            options.symbolsPath = reftest.getFullPath(options.symbolsPath)

        options.utilityPath = reftest.getFullPath(options.utilityPath)


class B2GArgumentParser(ReftestArgumentsParser):
    def __init__(self, **kwargs):
        super(B2GArgumentParser, self).__init__(**kwargs)

        self.add_argument("--browser-arg",
                          action="store",
                          type=str,
                          dest="browser_arg",
                          help="Optional command-line arg to pass to the browser")

        self.add_argument("--b2gpath",
                          action="store",
                          type=str,
                          dest="b2gPath",
                          help="path to B2G repo or qemu dir")

        self.add_argument("--emulator",
                          action="store",
                          type=str,
                          dest="emulator",
                          help="Architecture of emulator to use: x86 or arm")

        self.add_argument("--emulator-res",
                          action="store",
                          type=str,
                          dest="emulator_res",
                          help="Emulator resolution of the format '<width>x<height>'")

        self.add_argument("--no-window",
                          action="store_true",
                          dest="noWindow",
                          default=False,
                          help="Pass --no-window to the emulator")

        self.add_argument("--adbpath",
                          action="store",
                          type=str,
                          dest="adb_path",
                          default="adb",
                          help="path to adb")

        self.add_argument("--deviceIP",
                          action="store",
                          type=str,
                          dest="deviceIP",
                          help="ip address of remote device to test")

        self.add_argument("--devicePort",
                          action="store",
                          type=str,
                          dest="devicePort",
                          default="20701",
                          help="port of remote device to test")

        self.add_argument("--remote-logfile",
                          action="store",
                          type=str,
                          dest="remoteLogFile",
                          help="Name of log file on the device relative to the device root.  PLEASE ONLY USE A FILENAME.")

        self.add_argument("--remote-webserver",
                          action="store",
                          type=str,
                          dest="remoteWebServer",
                          help="ip address where the remote web server is hosted at")

        self.add_argument("--http-port",
                          action="store",
                          type=str,
                          dest="httpPort",
                          help="ip address where the remote web server is hosted at")

        self.add_argument("--ssl-port",
                          action="store",
                          type=str,
                          dest="sslPort",
                          help="ip address where the remote web server is hosted at")

        self.add_argument("--pidfile",
                          action="store",
                          type=str,
                          dest="pidFile",
                          default="",
                          help="name of the pidfile to generate")

        self.add_argument("--gecko-path",
                          action="store",
                          type=str,
                          dest="geckoPath",
                          help="the path to a gecko distribution that should "
                          "be installed on the emulator prior to test")

        self.add_argument("--logdir",
                          action="store",
                          type=str,
                          dest="logdir",
                          help="directory to store log files")

        self.add_argument('--busybox',
                          action='store',
                          type=str,
                          dest='busybox',
                          help="Path to busybox binary to install on device")

        self.add_argument("--httpd-path",
                          action="store",
                          type=str,
                          dest="httpdPath",
                          help="path to the httpd.js file")

        self.add_argument("--profile",
                          action="store",
                          type=str,
                          dest="profile",
                          help="for mulet testing, the path to the "
                          "gaia profile to use")

        self.add_argument("--mulet",
                          action="store_true",
                          dest="mulet",
                          default=False,
                          help="Run the tests on a B2G desktop build")

        self.set_defaults(remoteTestRoot=None,
                          logFile="reftest.log",
                          autorun=True,
                          closeWhenDone=True,
                          testPath="")

    def validate_remote(self, options, automation):
        if not options.app:
            options.app = automation.DEFAULT_APP

        if not options.remoteTestRoot:
            options.remoteTestRoot = automation._devicemanager.deviceRoot + \
                "/reftest"

        options.remoteProfile = options.remoteTestRoot + "/profile"

        productRoot = options.remoteTestRoot + "/" + automation._product
        if options.utilityPath is None:
            options.utilityPath = productRoot + "/bin"

        if not options.httpPort:
            options.httpPort = automation.DEFAULT_HTTP_PORT

        if not options.sslPort:
            options.sslPort = automation.DEFAULT_SSL_PORT

        if options.remoteWebServer is None:
            options.remoteWebServer = self.get_ip()

        options.webServer = options.remoteWebServer

        if options.geckoPath and not options.emulator:
            self.error(
                "You must specify --emulator if you specify --gecko-path")

        if options.logdir and not options.emulator:
            self.error("You must specify --emulator if you specify --logdir")

        if options.remoteLogFile is None:
            options.remoteLogFile = "reftest.log"

        options.localLogName = options.remoteLogFile
        options.remoteLogFile = options.remoteTestRoot + \
            '/' + options.remoteLogFile

        # Ensure that the options.logfile (which the base class uses) is set to
        # the remote setting when running remote. Also, if the user set the
        # log file name there, use that instead of reusing the remotelogfile as
        # above.
        if (options.logFile):
            # If the user specified a local logfile name use that
            options.localLogName = options.logFile
        options.logFile = options.remoteLogFile

        # Only reset the xrePath if it wasn't provided
        if options.xrePath is None:
            options.xrePath = options.utilityPath
        options.xrePath = os.path.abspath(options.xrePath)

        if options.pidFile != "":
            f = open(options.pidFile, 'w')
            f.write("%s" % os.getpid())
            f.close()

        # httpd-path is specified by standard makefile targets and may be specified
        # on the command line to select a particular version of httpd.js. If not
        # specified, try to select the one from from the xre bundle, as
        # required in bug 882932.
        if not options.httpdPath:
            options.httpdPath = os.path.join(options.xrePath, "components")

        return options


class RemoteArgumentsParser(ReftestArgumentsParser):
    def __init__(self, **kwargs):
        super(RemoteArgumentsParser, self).__init__()

        # app, xrePath and utilityPath variables are set in main function
        self.set_defaults(logFile="reftest.log",
                          app="",
                          xrePath="",
                          utilityPath="",
                          localLogName=None)

        self.add_argument("--remote-app-path",
                          action="store",
                          type=str,
                          dest="remoteAppPath",
                          help="Path to remote executable relative to device root using only forward slashes.  Either this or app must be specified, but not both.")

        self.add_argument("--adbpath",
                          action="store",
                          type=str,
                          dest="adb_path",
                          default="adb",
                          help="path to adb")

        self.add_argument("--deviceIP",
                          action="store",
                          type=str,
                          dest="deviceIP",
                          help="ip address of remote device to test")

        self.add_argument("--deviceSerial",
                          action="store",
                          type=str,
                          dest="deviceSerial",
                          help="adb serial number of remote device to test")

        self.add_argument("--devicePort",
                          action="store",
                          type=str,
                          default="20701",
                          dest="devicePort",
                          help="port of remote device to test")

        self.add_argument("--remote-product-name",
                          action="store",
                          type=str,
                          dest="remoteProductName",
                          default="fennec",
                          help="Name of product to test - either fennec or firefox, defaults to fennec")

        self.add_argument("--remote-webserver",
                          action="store",
                          type=str,
                          dest="remoteWebServer",
                          help="IP Address of the webserver hosting the reftest content")

        self.add_argument("--http-port",
                          action="store",
                          type=str,
                          dest="httpPort",
                          help="port of the web server for http traffic")

        self.add_argument("--ssl-port",
                          action="store",
                          type=str,
                          dest="sslPort",
                          help="Port for https traffic to the web server")

        self.add_argument("--remote-logfile",
                          action="store",
                          type=str,
                          dest="remoteLogFile",
                          default="reftest.log",
                          help="Name of log file on the device relative to device root.  PLEASE USE ONLY A FILENAME.")

        self.add_argument("--pidfile",
                          action="store",
                          type=str,
                          dest="pidFile",
                          default="",
                          help="name of the pidfile to generate")

        self.add_argument("--dm_trans",
                          action="store",
                          type=str,
                          dest="dm_trans",
                          default="sut",
                          help="the transport to use to communicate with device: [adb|sut]; default=sut")

        self.add_argument("--remoteTestRoot",
                          action="store",
                          type=str,
                          dest="remoteTestRoot",
                          help="remote directory to use as test root (eg. /mnt/sdcard/tests or /data/local/tests)")

        self.add_argument("--httpd-path",
                          action="store",
                          type=str,
                          dest="httpdPath",
                          help="path to the httpd.js file")

        self.add_argument("--no-device-info",
                          action="store_false",
                          dest="printDeviceInfo",
                          default=True,
                          help="do not display verbose diagnostics about the remote device")

    def validate_remote(self, options, automation):
        # Ensure our defaults are set properly for everything we can infer
        if not options.remoteTestRoot:
            options.remoteTestRoot = automation._devicemanager.deviceRoot + \
                '/reftest'
        options.remoteProfile = options.remoteTestRoot + "/profile"

        if options.remoteWebServer is None:
            options.remoteWebServer = self.get_ip()

        # Verify that our remotewebserver is set properly
        if options.remoteWebServer == '127.0.0.1':
            self.error("ERROR: Either you specified the loopback for the remote webserver or ",
                       "your local IP cannot be detected.  Please provide the local ip in --remote-webserver")

        if not options.httpPort:
            options.httpPort = automation.DEFAULT_HTTP_PORT

        if not options.sslPort:
            options.sslPort = automation.DEFAULT_SSL_PORT

        # One of remoteAppPath (relative path to application) or the app (executable) must be
        # set, but not both.  If both are set, we destroy the user's selection for app
        # so instead of silently destroying a user specificied setting, we
        # error.
        if options.remoteAppPath and options.app:
            self.error(
                "ERROR: You cannot specify both the remoteAppPath and the app")
        elif options.remoteAppPath:
            options.app = options.remoteTestRoot + "/" + options.remoteAppPath
        elif options.app is None:
            # Neither remoteAppPath nor app are set -- error
            self.error("ERROR: You must specify either appPath or app")

        if options.xrePath is None:
            self.error(
                "ERROR: You must specify the path to the controller xre directory")
        else:
            # Ensure xrepath is a full path
            options.xrePath = os.path.abspath(options.xrePath)

        options.localLogName = options.remoteLogFile
        options.remoteLogFile = options.remoteTestRoot + \
            '/' + options.remoteLogFile

        # Ensure that the options.logfile (which the base class uses) is set to
        # the remote setting when running remote. Also, if the user set the
        # log file name there, use that instead of reusing the remotelogfile as
        # above.
        if options.logFile:
            # If the user specified a local logfile name use that
            options.localLogName = options.logFile

        options.logFile = options.remoteLogFile

        if options.pidFile != "":
            with open(options.pidFile, 'w') as f:
                f.write(str(os.getpid()))

        # httpd-path is specified by standard makefile targets and may be specified
        # on the command line to select a particular version of httpd.js. If not
        # specified, try to select the one from hostutils.zip, as required in
        # bug 882932.
        if not options.httpdPath:
            options.httpdPath = os.path.join(options.utilityPath, "components")

        if not options.ignoreWindowSize:
            parts = automation._devicemanager.getInfo(
                'screen')['screen'][0].split()
            width = int(parts[0].split(':')[1])
            height = int(parts[1].split(':')[1])
            if (width < 1366 or height < 1050):
                self.error("ERROR: Invalid screen resolution %sx%s, please adjust to 1366x1050 or higher" % (
                    width, height))

        # Disable e10s by default on Android because we don't run Android
        # e10s jobs anywhere yet.
        options.e10s = False
        return options