Skip to content

Commit

Permalink
Bug 1330772 - Remove all b2g related code from reftests, r=jmaher
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: HY1XbcliTNA
  • Loading branch information
ahal committed Jan 12, 2017
1 parent 59e6aeb commit 9396e33
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 1,659 deletions.
455 changes: 0 additions & 455 deletions build/mobile/b2gautomation.py

This file was deleted.

4 changes: 2 additions & 2 deletions layout/reftests/forms/input/datetime/reftest-stylo.list
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
default-preferences pref(dom.forms.datetime,true)

# not valid on Android/B2G where type=time looks like type=text
# not valid on Android where type=time looks like type=text
# == time-simple-unthemed.html time-simple-unthemed.html
# == time-large-font.html time-large-font.html
# == time-width-height.html time-width-height.html
# == time-border.html time-border.html
# only valid on Android/B2G where type=number looks the same as type=text
# only valid on Android where type=number looks the same as type=text
# == time-simple-unthemed.html time-simple-unthemed.html

# type change
Expand Down
18 changes: 9 additions & 9 deletions layout/reftests/forms/input/datetime/reftest.list
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
default-preferences pref(dom.forms.datetime,true)

# not valid on Android/B2G where type=time looks like type=text
skip-if(Android||B2G||Mulet) != time-simple-unthemed.html time-simple-unthemed-ref.html
skip-if(Android||B2G||Mulet) != time-large-font.html time-basic.html
skip-if(Android||B2G||Mulet) != time-width-height.html time-basic.html
skip-if(Android||B2G||Mulet) != time-border.html time-basic.html
# only valid on Android/B2G where type=number looks the same as type=text
skip-if(!Android&&!B2G&&!Mulet) == time-simple-unthemed.html time-simple-unthemed-ref.html
# not valid on Android where type=time looks like type=text
skip-if(Android) != time-simple-unthemed.html time-simple-unthemed-ref.html
skip-if(Android) != time-large-font.html time-basic.html
skip-if(Android) != time-width-height.html time-basic.html
skip-if(Android) != time-border.html time-basic.html
# only valid on Android where type=number looks the same as type=text
skip-if(!Android) == time-simple-unthemed.html time-simple-unthemed-ref.html

# type change
skip-if(Android||B2G||Mulet) == to-time-from-other-type-unthemed.html time-simple-unthemed.html
skip-if(Android||B2G||Mulet) == from-time-to-other-type-unthemed.html from-time-to-other-type-unthemed-ref.html
skip-if(Android) == to-time-from-other-type-unthemed.html time-simple-unthemed.html
skip-if(Android) == from-time-to-other-type-unthemed.html from-time-to-other-type-unthemed-ref.html
57 changes: 0 additions & 57 deletions layout/tools/reftest/b2g_start_script.js

This file was deleted.

9 changes: 0 additions & 9 deletions layout/tools/reftest/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ var WindowListener = {
};

function startup(data, reason) {
// b2g is bootstrapped by b2g_start_script.js
if (Services.appinfo.widgetToolkit == "gonk") {
return;
}

if (Services.appinfo.OS == "Android") {
Cm.addBootstrappedManifestLocation(data.installPath);
Services.wm.addListener(WindowListener);
Expand Down Expand Up @@ -66,10 +61,6 @@ function startup(data, reason) {
}

function shutdown(data, reason) {
if (Services.appinfo.widgetToolkit == "gonk") {
return;
}

if (Services.appinfo.OS == "Android") {
Services.wm.removeListener(WindowListener);
Cm.removedBootstrappedManifestLocation(data.installPath);
Expand Down
60 changes: 0 additions & 60 deletions layout/tools/reftest/gaia_lock_screen.js

This file was deleted.

2 changes: 1 addition & 1 deletion layout/tools/reftest/jar.mn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
reftest.jar:
% content reftest %content/
* content/reftest-content.js (reftest-content.js)
content/reftest-content.js (reftest-content.js)
content/httpd.jsm (../../../netwerk/test/httpserver/httpd.js)
content/StructuredLog.jsm (../../../testing/modules/StructuredLog.jsm)
* content/reftest.jsm (reftest.jsm)
Expand Down
161 changes: 0 additions & 161 deletions layout/tools/reftest/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import os
import re
import sys
import warnings
import which
from argparse import Namespace

from mozbuild.base import (
Expand All @@ -24,43 +22,6 @@

import reftestcommandline

ADB_NOT_FOUND = '''
The %s command requires the adb binary to be on your path.
If you have a B2G build, this can be found in
'%s/out/host/<platform>/bin'.
'''.lstrip()

GAIA_PROFILE_NOT_FOUND = '''
The reftest command requires a non-debug gaia profile on Mulet.
Either pass in --profile, or set the GAIA_PROFILE environment variable.
If you do not have a non-debug gaia profile, you can build one:
$ git clone https://github.com/mozilla-b2g/gaia
$ cd gaia
$ make
The profile should be generated in a directory called 'profile'.
'''.lstrip()

GAIA_PROFILE_IS_DEBUG = '''
The reftest command requires a non-debug gaia profile on Mulet.
The specified profile, %s, is a debug profile.
If you do not have a non-debug gaia profile, you can build one:
$ git clone https://github.com/mozilla-b2g/gaia
$ cd gaia
$ make
The profile should be generated in a directory called 'profile'.
'''.lstrip()

MARIONETTE_DISABLED = '''
The reftest command requires a marionette enabled build on Mulet.
Add 'ac_add_options --enable-marionette' to your mozconfig file and re-build the application.
Your currently active mozconfig is %s.
'''.lstrip()

parser = None

Expand Down Expand Up @@ -100,80 +61,6 @@ def _setup_objdir(self, args):
if not os.path.isdir(tests):
os.symlink(self.topsrcdir, tests)

def run_b2g_test(self, b2g_home=None, xre_path=None, **kwargs):
"""Runs a b2g reftest.
filter is a regular expression (in JS syntax, as could be passed to the
RegExp constructor) to select which reftests to run from the manifest.
tests is a list of paths. It can be a relative path from the
top source directory, an absolute filename, or a directory containing
test files.
suite is the type of reftest to run. It can be one of ('reftest',
'crashtest').
"""
args = Namespace(**kwargs)
if args.suite not in ('reftest', 'crashtest'):
raise Exception('None or unrecognized reftest suite type.')

self._setup_objdir(args)
import runreftestb2g

for i, path in enumerate(args.tests):
# Non-absolute paths are relative to the packaged directory, which
# has an extra tests/ at the start
if os.path.exists(os.path.abspath(path)):
path = os.path.relpath(path, os.path.join(self.topsrcdir))
args.tests[i] = os.path.join('tests', path)

try:
which.which('adb')
except which.WhichError:
# TODO Find adb automatically if it isn't on the path
raise Exception(ADB_NOT_FOUND % ('%s-remote' % args.suite, b2g_home))

args.b2gPath = b2g_home
args.logdir = self.reftest_dir
args.httpdPath = os.path.join(self.topsrcdir, 'netwerk', 'test', 'httpserver')
args.xrePath = xre_path
args.ignoreWindowSize = True

return runreftestb2g.run_test_harness(parser, args)

def run_mulet_test(self, **kwargs):
"""Runs a mulet reftest."""
args = Namespace(**kwargs)
self._setup_objdir(args)

import runreftestmulet

if self.substs.get('ENABLE_MARIONETTE') != '1':
print(MARIONETTE_DISABLED % self.mozconfig['path'])
return 1

if not args.profile:
gaia_profile = os.environ.get('GAIA_PROFILE')
if not gaia_profile:
print(GAIA_PROFILE_NOT_FOUND)
return 1
args.profile = gaia_profile

if os.path.isfile(os.path.join(args.profile, 'extensions',
'httpd@gaiamobile.org')):
print(GAIA_PROFILE_IS_DEBUG % args.profile)
return 1

args.app = self.get_binary_path()
args.mulet = True

if not args.app.endswith('-bin'):
args.app = '%s-bin' % args.app
if not os.path.isfile(args.app):
args.app = args.app[:-len('-bin')]

return runreftestmulet.run_test_harness(parser, args)

def run_desktop_test(self, **kwargs):
"""Runs a reftest, in desktop Firefox."""
import runreftest
Expand Down Expand Up @@ -301,8 +188,6 @@ def get_parser():
build_obj = MozbuildObject.from_environment(cwd=here)
if conditions.is_android(build_obj):
parser = reftestcommandline.RemoteArgumentsParser()
elif conditions.is_mulet(build_obj):
parser = reftestcommandline.B2GArgumentParser()
else:
parser = reftestcommandline.DesktopArgumentsParser()
return parser
Expand Down Expand Up @@ -344,50 +229,4 @@ def _run_reftest(self, **kwargs):
from mozrunner.devices.android_device import verify_android_device
verify_android_device(self, install=True, xre=True)
return reftest.run_android_test(**kwargs)
elif conditions.is_mulet(self):
return reftest.run_mulet_test(**kwargs)
return reftest.run_desktop_test(**kwargs)


# TODO For now b2g commands will only work with the emulator,
# they should be modified to work with all devices.
def is_emulator(cls):
"""Emulator needs to be configured."""
return cls.device_name.startswith('emulator')


@CommandProvider
class B2GCommands(MachCommandBase):
def __init__(self, context):
MachCommandBase.__init__(self, context)

for attr in ('b2g_home', 'xre_path', 'device_name'):
setattr(self, attr, getattr(context, attr, None))

@Command('reftest-remote', category='testing',
description='Run a remote reftest (b2g layout and graphics correctness, remote device).',
conditions=[conditions.is_b2g, is_emulator],
parser=get_parser)
def run_reftest_remote(self, **kwargs):
kwargs["suite"] = "reftest"
return self._run_reftest(**kwargs)

@Command('crashtest-remote', category='testing',
description='Run a remote crashtest (Check if b2g crashes on a page, remote device).',
conditions=[conditions.is_b2g, is_emulator],
parser=get_parser)
def run_crashtest_remote(self, test_file, **kwargs):
kwargs["suite"] = "crashtest"
return self._run_reftest(**kwargs)

def _run_reftest(self, **kwargs):
process_test_objects(kwargs)
if self.device_name:
if self.device_name.startswith('emulator'):
emulator = 'arm'
if 'x86' in self.device_name:
emulator = 'x86'
kwargs['emulator'] = emulator

reftest = self._spawn(ReftestRunner)
return reftest.run_b2g_test(self.b2g_home, self.xre_path, **kwargs)
Loading

0 comments on commit 9396e33

Please sign in to comment.