68.13 - testing

This commit is contained in:
Fedor 2023-05-31 17:48:49 +03:00
parent c5cfe291b7
commit 328230f3de
4443 changed files with 62081 additions and 94377 deletions

View File

@ -172,7 +172,7 @@ class AwsyTestCase(MarionetteTestCase):
try:
result = self.marionette.execute_async_script(
gc_script, script_timeout=180000)
except JavascriptException, e:
except JavascriptException as e:
self.logger.error("GC JavaScript error: %s" % e)
except ScriptTimeoutException:
self.logger.error("GC timed out")
@ -222,7 +222,7 @@ class AwsyTestCase(MarionetteTestCase):
checkpoint_script, script_timeout=60000)
if finished:
checkpoint = checkpoint_path
except JavascriptException, e:
except JavascriptException as e:
self.logger.error("Checkpoint JavaScript error: %s" % e)
except ScriptTimeoutException:
self.logger.error("Memory report timed out")
@ -290,7 +290,7 @@ class AwsyTestCase(MarionetteTestCase):
for f in incomplete:
os.remove(os.path.join(tmpdir, f))
except JavascriptException, e:
except JavascriptException as e:
self.logger.error("DMD JavaScript error: %s" % e)
except ScriptTimeoutException:
self.logger.error("DMD timed out")

View File

@ -145,18 +145,18 @@ if __name__ == "__main__":
totals = calculate_memory_report_values(
args.report, args.prefix, args.proc_filter)
sorted_totals = sorted(totals.iteritems(), key=lambda(k, v): (-v, k))
sorted_totals = sorted(totals.items(), key=lambda item: (-item[1], item[0]))
for (k, v) in sorted_totals:
if v:
print "{0}\t".format(k),
print ""
print("{0}\t".format(k)),
print("")
bytes_per_mebibyte = 1024.0 * 1024.0
for (k, v) in sorted_totals:
if v:
if args.mebi:
print "{0:.2f} MiB".format(v / bytes_per_mebibyte),
print("{0:.2f} MiB".format(v / bytes_per_mebibyte)),
else:
print "{0} bytes".format(v),
print "\t",
print ""
print("{0} bytes".format(v)),
print("\t"),
print("")

View File

@ -68,7 +68,7 @@ def update_checkpoint_paths(checkpoint_files, checkpoints):
if indices:
checkpoints[indices[0]]['path'] = paths[idx]
else:
print "found files but couldn't find %s" % name
print("found files but couldn't find {}").format(name)
def create_suite(name, node, data_path, checkpoints=CHECKPOINTS,
@ -164,7 +164,7 @@ def create_perf_data(data_path, perf_suites=PERF_SUITES, checkpoints=CHECKPOINTS
Builds up a performance data blob suitable for submitting to perfherder.
"""
if ("GCOV_PREFIX" in os.environ) or ("JS_CODE_COVERAGE_OUTPUT_DIR" in os.environ):
print "Code coverage is being collected, performance data will not be gathered."
print("Code coverage is being collected, performance data will not be gathered.")
return {}
perf_blob = {
@ -183,12 +183,12 @@ def create_perf_data(data_path, perf_suites=PERF_SUITES, checkpoints=CHECKPOINTS
if __name__ == '__main__':
args = sys.argv[1:]
if not args:
print "Usage: process_perf_data.py data_path"
print("Usage: process_perf_data.py data_path")
sys.exit(1)
# Determine which revisions we need to process.
data_path = args[0]
perf_blob = create_perf_data(data_path)
print "PERFHERDER_DATA: %s" % json.dumps(perf_blob)
print("PERFHERDER_DATA: {}").format(json.dumps(perf_blob))
sys.exit(0)

View File

@ -187,7 +187,7 @@ class TestMemoryUsage(AwsyTestCase):
try:
result = self.marionette.execute_script(script,
script_timeout=180000)
except JavascriptException, e:
except JavascriptException as e:
self.logger.error("removePreloadedBrowser() JavaScript error: %s" % e)
except ScriptTimeoutException:
self.logger.error("removePreloadedBrowser() timed out")

View File

@ -37,17 +37,17 @@ class WebServers(object):
docroot=self.docroot))
try:
self.servers[-1].start()
except socket.error, error:
except socket.error as error:
if isinstance(error, socket.error):
if error.errno == 98:
print "port %d is in use." % port
print("port {} is in use.").format(port)
else:
print "port %d error %s" % (port, error)
print("port {} error {}").format(port, error)
elif isinstance(error, str):
print "port %d error %s" % (port, error)
print("port {} error {}").format(port, error)
self.servers.pop()
except Exception, error:
print "port %d error %s" % (port, error)
except Exception as error:
print("port {} error {}").format(port, error)
self.servers.pop()
port += 1

View File

@ -34,6 +34,7 @@ skip-if = os != 'win'
[TestMaybe]
[TestUriValidation]
skip-if = os != 'win'
[TestBaseProfiler]
[TestNonDereferenceable]
[TestNotNull]
[TestParseFTPList]

View File

@ -2,7 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
__version__ = '1.4.0'
import cli_functional
import cli_update
from . import cli_functional
from . import cli_update

View File

@ -2,5 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_ui_harness.arguments.base import FirefoxUIArguments
from firefox_ui_harness.arguments.update import UpdateArguments

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from marionette_harness import BaseMarionetteArguments

View File

@ -2,7 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from base import FirefoxUIArguments
from __future__ import absolute_import
from .base import FirefoxUIArguments
class UpdateBaseArguments(object):

View File

@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from marionette_harness.runtests import cli as mn_cli
from firefox_ui_harness.arguments import FirefoxUIArguments

View File

@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from marionette_harness.runtests import cli as mn_cli
from firefox_ui_harness.arguments import UpdateArguments

View File

@ -2,5 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_ui_harness.runners.base import FirefoxUITestRunner
from firefox_ui_harness.runners.update import UpdateTestRunner

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
import shutil
import tempfile

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
import sys
@ -105,4 +106,4 @@ class UpdateTestRunner(FirefoxUITestRunner):
# If exceptions happened, re-throw the last one
if self.exc_info:
ex_type, exception, tb = self.exc_info
raise ex_type, exception, tb
raise ex_type(exception).with_traceback(tb)

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
import pprint
from datetime import datetime

View File

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
import re
from setuptools import setup, find_packages

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import Wait
from marionette_harness import MarionetteTestCase

View File

@ -2,71 +2,13 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.ui.browser.window import BrowserWindow
from marionette_driver import By, Wait
from marionette_harness import MarionetteTestCase
class TestAboutPrivateBrowsing(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestAboutPrivateBrowsing, self).setUp()
# Use a fake local support URL
support_url = 'about:blank?'
self.marionette.set_pref('app.support.baseURL', support_url)
self.pb_url = support_url + 'private-browsing'
# Disable the search UI
self.marionette.set_pref('browser.privatebrowsing.searchUI', False)
def tearDown(self):
try:
self.puppeteer.windows.close_all([self.browser])
self.browser.switch_to()
self.marionette.clear_pref('app.support.baseURL')
self.marionette.clear_pref('browser.privatebrowsing.searchUI')
finally:
super(TestAboutPrivateBrowsing, self).tearDown()
def testCheckAboutPrivateBrowsing(self):
self.assertFalse(self.browser.is_private)
with self.marionette.using_context('content'):
self.marionette.navigate('about:privatebrowsing')
# Disabled awaiting support for Fluent strings in firefox-ui tests (bug 1534310)
# status_node = self.marionette.find_element(By.CSS_SELECTOR, 'p.showNormal')
# self.assertEqual(status_node.text,
# self.browser.localize_entity('aboutPrivateBrowsing.notPrivate'),
# 'Status text indicates we are not in private browsing mode')
def window_opener(win):
with win.marionette.using_context('content'):
button = self.marionette.find_element(By.ID, 'startPrivateBrowsing')
button.click()
pb_window = self.browser.open_window(callback=window_opener,
expected_window_class=BrowserWindow)
try:
self.assertTrue(pb_window.is_private)
def tab_opener(tab):
with tab.marionette.using_context('content'):
link = tab.marionette.find_element(By.ID, 'learnMore')
link.click()
tab = pb_window.tabbar.open_tab(trigger=tab_opener)
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda _: tab.location == self.pb_url)
finally:
pb_window.close()
class TestAboutPrivateBrowsingWithSearch(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
@ -77,16 +19,12 @@ class TestAboutPrivateBrowsingWithSearch(PuppeteerMixin, MarionetteTestCase):
self.marionette.set_pref('app.support.baseURL', support_url)
self.pb_url = support_url + 'private-browsing-myths'
# Enable the search UI
self.marionette.set_pref('browser.privatebrowsing.searchUI', True)
def tearDown(self):
try:
self.puppeteer.windows.close_all([self.browser])
self.browser.switch_to()
self.marionette.clear_pref('app.support.baseURL')
self.marionette.clear_pref('browser.privatebrowsing.searchUI')
finally:
super(TestAboutPrivateBrowsingWithSearch, self).tearDown()

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import time
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import time
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import Wait
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from marionette_driver import By
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import Wait
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import By, Wait
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from urlparse import urlparse
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import time
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import time
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import Wait
from marionette_harness import MarionetteTestCase, skip_if_e10s

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import By, expected, Wait
from marionette_driver.errors import NoAlertPresentException

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import time
from marionette_driver import By

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import time
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_harness import MarionetteTestCase

View File

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# add this directory to the path
from __future__ import absolute_import
import sys
import os
sys.path.append(os.path.dirname(__file__))

View File

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# add this directory to the path
from __future__ import absolute_import
import sys
import os
sys.path.append(os.path.dirname(__file__))

View File

@ -23,5 +23,6 @@ disabled = Bug 1369556
tags = remote
[test_update_wizard.py]
tags = remote
skip-if = true # bug 1552771
[test_windows.py]
skip-if = (os == "win" && bits == 64) #Bug 1214191

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.ui.deck import Panel
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import mozversion
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.api.l10n import L10n
from marionette_driver import By

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver.errors import NoSuchElementException
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.ui.browser.notifications import (
AddOnInstallConfirmationNotification,

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import Wait
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.errors import NoCertificateError
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.errors import NoCertificateError
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_driver import expected, By, Wait
from marionette_driver.errors import NoSuchElementException

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.ui.deck import Panel
from firefox_puppeteer.ui.update_wizard import UpdateWizardDialog

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_puppeteer import PuppeteerMixin
from marionette_harness import MarionetteTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import firefox_puppeteer.errors as errors
from firefox_puppeteer import PuppeteerMixin

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_ui_harness.testcases import UpdateTestCase

View File

@ -2,6 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from firefox_ui_harness.testcases import UpdateTestCase

View File

@ -22,7 +22,7 @@ regex = "1.0"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
uuid = { version = "0.6", features = ["v4"] }
uuid = { version = "0.7", features = ["v4"] }
webdriver = { path = "../webdriver" }
zip = "0.4"

View File

@ -1,13 +1,13 @@
use base64;
use crate::logging;
use hyper::Method;
use regex::Captures;
use serde::de::{self, Deserialize, Deserializer};
use serde_json::{self, Value};
use std::env;
use std::fs::File;
use std::io::prelude::*;
use uuid::Uuid;
use webdriver::Parameters;
use webdriver::command::{WebDriverCommand, WebDriverExtensionCommand};
use webdriver::common::WebElement;
use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
@ -71,7 +71,7 @@ impl WebDriverExtensionRoute for GeckoExtensionRoute {
fn command(
&self,
params: &Captures,
params: &Parameters,
body_data: &Value,
) -> WebDriverResult<WebDriverCommand<GeckoExtensionCommand>> {
use self::GeckoExtensionRoute::*;
@ -83,7 +83,7 @@ impl WebDriverExtensionRoute for GeckoExtensionRoute {
}
XblAnonymousChildren => {
let element_id = try_opt!(
params.name("elementId"),
params.get("elementId"),
ErrorStatus::InvalidArgument,
"Missing elementId parameter"
);
@ -92,7 +92,7 @@ impl WebDriverExtensionRoute for GeckoExtensionRoute {
}
XblAnonymousByAttribute => {
let element_id = try_opt!(
params.name("elementId"),
params.get("elementId"),
ErrorStatus::InvalidArgument,
"Missing elementId parameter"
);

View File

@ -203,7 +203,7 @@ fn inner_main(app: &mut App) -> ProgramResult<()> {
}
let handler = MarionetteHandler::new(settings);
let listening = webdriver::server::start(address, handler, &extension_routes()[..])?;
let listening = webdriver::server::start(address, handler, extension_routes())?;
debug!("Listening on {}", listening.socket);
}
}

View File

@ -1278,7 +1278,7 @@ impl MarionetteConnection {
_ => panic!("Expected one byte got more"),
};
match byte {
'0'...'9' => {
'0'..='9' => {
bytes = bytes * 10;
bytes += byte as usize - '0' as usize;
}

View File

@ -17,6 +17,9 @@ lazy_static! {
// Make sure Shield doesn't hit the network.
("app.normandy.api_url", Pref::new("")),
// Disable automatic downloading of new releases
("app.update.auto", Pref::new(false)),
// Disable Firefox old build background check
("app.update.checkInstallTime", Pref::new(false)),

View File

@ -17,8 +17,6 @@
using ::testing::EmptyTestEventListener;
using ::testing::InitGoogleTest;
using ::testing::Test;
using ::testing::TestCase;
using ::testing::TestEventListeners;
using ::testing::TestInfo;
using ::testing::TestPartResult;

View File

@ -11,8 +11,6 @@
#define MOZ_GTEST_BENCH_FRAMEWORK "platform_microbench"
#define MOZ_GTEST_NUM_ITERATIONS 5
using mozilla::TimeStamp;
namespace mozilla {
void GTestBench(const char* aSuite, const char* aName,
const std::function<void()>& aTest) {

View File

@ -210,7 +210,7 @@ def main():
options.cwd,
symbols_path=options.symbols_path,
utility_path=options.utility_path)
except Exception, e:
except Exception as e:
log.error(str(e))
result = False
sys.exit(0 if result else 1)

View File

@ -487,7 +487,7 @@ class CheckSpiderMonkeyCommand(MachCommandBase):
python,
os.path.join(self.topsrcdir, 'js', 'src', 'tests', 'jstests.py'),
js,
'--jitflags=all',
'--jitflags=jstests',
] + params
return subprocess.call(jstest_cmd)

View File

@ -506,7 +506,7 @@ class DesktopInstance(GeckoInstance):
"app.update.disabledForTesting": True,
# !!! For backward compatibility up to Firefox 64. Only remove
# when this Firefox version is no longer supported by the client !!!
"app.update.auto": False,
"app.update.auto": 0,
# Don't show the content blocking introduction panel
# We use a larger number than the default 22 to have some buffer

View File

@ -70,12 +70,11 @@ const RECOMMENDED_PREFS = new Map([
// Make sure Shield doesn't hit the network.
["app.normandy.api_url", ""],
// Disable automatically upgrading Firefox
// Disable automatic downloading of new releases.
//
// Note: This preference should have already been set by the client when
// creating the profile. But if not and to absolutely make sure that updates
// of Firefox aren't downloaded and applied, enforce its presence.
["app.update.disabledForTesting", true],
// This should also be set in the profile prior to starting Firefox,
// as it is picked up at runtime.
["app.update.auto", 0],
// Increase the APZ content response timeout in tests to 1 minute.
// This is to accommodate the fact that test environments tends to be

View File

@ -184,7 +184,7 @@ cookie.add = function(newCookie, { restrictToHost = null } = {}) {
newCookie.session,
newCookie.expiry,
{} /* origin attributes */,
Ci.nsICookie2.SAMESITE_UNSET
Ci.nsICookie.SAMESITE_UNSET
);
} catch (e) {
throw new UnableToSetCookieError(e);
@ -202,7 +202,6 @@ cookie.remove = function(toDelete) {
toDelete.domain,
toDelete.name,
toDelete.path,
false,
{} /* originAttributes */
);
};

View File

@ -21,7 +21,11 @@ const { XPCOMUtils } = ChromeUtils.import(
);
XPCOMUtils.defineLazyGlobalGetters(this, ["DOMParser"]);
XPCOMUtils.defineLazyGetter(this, "domParser", () => new DOMParser());
XPCOMUtils.defineLazyGetter(this, "domParser", () => {
const parser = new DOMParser();
parser.forceEnableDTD();
return parser;
});
const { NoSuchElementError } = ChromeUtils.import(
"chrome://marionette/content/error.js"

View File

@ -75,6 +75,7 @@ class L10n(BaseLib):
value = self.marionette.execute_script("""
Cu.importGlobalProperties(["DOMParser"]);
var parser = new DOMParser();
parser.forceEnableDTD();
var doc = parser.parseFromString(arguments[0], "text/xml");
var node = doc.querySelector("elem[id='entity']");

View File

@ -94,7 +94,8 @@ class Permissions(BaseLib):
self.marionette.execute_script("""
Components.utils.import("resource://gre/modules/Services.jsm");
let uri = Services.io.newURI(arguments[0], null, null);
Services.perms.add(uri, arguments[1],
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.perms.addFromPrincipal(principal, arguments[1],
Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
""", script_args=[host, permission])
@ -112,5 +113,6 @@ class Permissions(BaseLib):
self.marionette.execute_script("""
Components.utils.import("resource://gre/modules/Services.jsm");
let uri = Services.io.newURI(arguments[0], null, null);
Services.perms.remove(uri, arguments[1]);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.perms.removeFromPrincipal(principal, arguments[1]);
""", script_args=[host, permission])

View File

@ -188,9 +188,14 @@ max-width: ${width}px; max-height: ${height}px`;
return reftestWin;
}
abort() {
if (this.reftestWin) {
async abort() {
if (this.reftestWin && this.reftestWin != this.parentWindow) {
this.driver.closeChromeWindow();
let parentHandle = this.driver.findWindow(
[this.parentWindow],
() => true
);
await this.driver.setWindowHandle(parentHandle);
}
this.reftestWin = null;
}
@ -278,7 +283,7 @@ max-width: ${width}px; max-height: ${height}px`;
let result = await Promise.race([testRunner, timeoutPromise]);
this.parentWindow.clearTimeout(timeoutHandle);
if (result.status === STATUS.TIMEOUT) {
this.abort();
await this.abort();
}
return result;

View File

@ -129,6 +129,7 @@ function loadMochitest(e) {
null,
null,
null,
null,
Services.scriptSecurityManager.getSystemPrincipal()
);
}

View File

@ -1130,7 +1130,7 @@ Tester.prototype = {
let sidebar = document.getElementById("sidebar");
if (sidebar) {
sidebar.setAttribute("src", "data:text/html;charset=utf-8,");
sidebar.docShell.createAboutBlankContentViewer(null);
sidebar.docShell.createAboutBlankContentViewer(null, null);
sidebar.setAttribute("src", "about:blank");
}
}

View File

@ -510,11 +510,6 @@ class MochitestArguments(ArgumentContainer):
"default": None,
"help": "Arguments to pass to the debugger.",
}],
[["--save-recordings"],
{"dest": "recordingPath",
"default": None,
"help": "Directory to save Web Replay recordings in.",
}],
[["--valgrind"],
{"default": None,
"help": "Valgrind binary to run tests with. Program name or path.",

View File

@ -1945,10 +1945,6 @@ toolbar#nav-bar {
prefs['media.cubeb.output_device'] = "Null Output"
prefs['media.volume_scale'] = "1.0"
# Disable web replay rewinding by default if recordings are being saved.
if options.recordingPath:
prefs["devtools.recordreplay.enableRewinding"] = False
self.profile.set_preferences(prefs)
# Extra prefs from --setpref
@ -2753,9 +2749,6 @@ toolbar#nav-bar {
if options.jsdebugger:
options.browserArgs.extend(['-jsdebugger', '-wait-for-jsdebugger'])
if options.recordingPath:
options.browserArgs.extend(['--save-recordings', options.recordingPath])
# Remove the leak detection file so it can't "leak" to the tests run.
# The file is not there if leak logging was not enabled in the
# application build.

View File

@ -133,7 +133,7 @@ char* strtok2(char* string, const char* delims, char** newStr) {
enum client_auth_option { caNone = 0, caRequire = 1, caRequest = 2 };
// Structs for passing data into jobs on the thread pool
typedef struct {
struct server_info_t {
int32_t listen_port;
string cert_nickname;
PLHashTable* host_cert_table;
@ -146,9 +146,9 @@ typedef struct {
PLHashTable* host_tls13_table;
PLHashTable* host_rc4_table;
PLHashTable* host_failhandshake_table;
} server_info_t;
};
typedef struct {
struct connection_info_t {
PRFileDesc* client_sock;
PRNetAddr client_addr;
server_info_t* server_info;
@ -159,12 +159,12 @@ typedef struct {
bool http_proxy_only;
// true if this connection is for a WebSocket
bool iswebsocket;
} connection_info_t;
};
typedef struct {
struct server_match_t {
string fullHost;
bool matched;
} server_match_t;
};
const int32_t BUF_SIZE = 16384;
const int32_t BUF_MARGIN = 1024;

View File

@ -24,7 +24,7 @@ function loadPrivilegedScriptTest() {
var contentProcessType = SpecialPowers.isMainProcess();
var port;
try {
port = SpecialPowers.loadPrivilegedScript(loadPrivilegedScriptTest.toSource());
port = SpecialPowers.loadPrivilegedScript(loadPrivilegedScriptTest.toString());
} catch (e) {
ok(false, "loadPrivilegedScript shoulde not throw");
}

View File

@ -1255,7 +1255,7 @@ SimpleTest.finish = function() {
* message, errorMessage, sourceName, sourceLine, category:
* string or regexp
* lineNumber, columnNumber: number
* isScriptError, isWarning, isException, isStrict: boolean
* isScriptError, isWarning: boolean
* Strings, numbers, and booleans must compare equal to the named
* property of the Nth console message. Regexps must match. Any
* fields present in the message but not in the pattern object are ignored.
@ -1314,7 +1314,7 @@ SimpleTest.monitorConsole = function (continuation, msgs, forbidUnexpectedMsgs)
}
var counter = 0;
var assertionLabel = msgs.toSource();
var assertionLabel = JSON.stringify(msgs);
function listener(msg) {
if (msg.message === "SENTINEL" && !msg.isScriptError) {
is(counter, msgs.length,

View File

@ -323,4 +323,5 @@ def get_default_valgrind_tool_specific_args():
return ['--partial-loads-ok=yes',
'--leak-check=summary',
'--show-possibly-lost=no',
'--show-mismatched-frees=no',
]

View File

@ -14,7 +14,7 @@ impl PrefReaderError {
fn new(
message: &'static str,
position: Position,
parent: Option<Box<Error>>,
parent: Option<Box<dyn Error>>,
) -> PrefReaderError {
PrefReaderError {
message,
@ -39,7 +39,7 @@ impl Error for PrefReaderError {
self.message
}
fn cause(&self) -> Option<&Error> {
fn cause(&self) -> Option<&dyn Error> {
match self.parent {
None => None,
Some(ref cause) => Some(cause.deref()),
@ -143,7 +143,7 @@ impl<'a> PrefToken<'a> {
pub struct PrefReaderError {
message: &'static str,
position: Position,
parent: Option<Box<Error>>,
parent: Option<Box<dyn Error>>,
}
struct TokenData<'a> {
@ -358,9 +358,9 @@ impl<'a> PrefTokenizer<'a> {
Some(x) => {
value = value << 4;
match x {
'0'...'9' => value += x as u32 - '0' as u32,
'a'...'f' => value += x as u32 - 'a' as u32,
'A'...'F' => value += x as u32 - 'A' as u32,
'0'..='9' => value += x as u32 - '0' as u32,
'a'..='f' => value += x as u32 - 'a' as u32,
'A'..='F' => value += x as u32 - 'A' as u32,
_ => {
return Err(PrefReaderError::new(
"Unexpected character in escape",
@ -594,7 +594,7 @@ impl<'a> PrefTokenizer<'a> {
self.unget_char();
TokenizerState::Bool
}
'0'...'9' | '-' | '+' => {
'0'..='9' | '-' | '+' => {
token_data.start(&self, TokenType::Int);
TokenizerState::Number
}
@ -645,7 +645,7 @@ impl<'a> PrefTokenizer<'a> {
_ => TokenizerState::SingleQuotedString,
},
TokenizerState::Number => match c {
'0'...'9' => TokenizerState::Number,
'0'..='9' => TokenizerState::Number,
')' | ',' => {
token_data.end(&self.data, self.pos)?;
self.unget_char();

View File

@ -9,7 +9,7 @@ license = "MPL-2.0"
[dependencies]
log = "0.4"
mozprofile = { path = "../mozprofile" }
plist = "0.4"
plist = "0.5.1"
[target.'cfg(target_os = "windows")'.dependencies]
winreg = "0.5"

View File

@ -8,7 +8,7 @@ fn main() {
.map(|x| (x.to_string_lossy().into_owned(), 0))
.unwrap_or(("Firefox binary not found".to_owned(), 1));
let mut writer: Box<Write> = match code {
let mut writer: Box<dyn Write> = match code {
0 => Box::new(std::io::stdout()),
_ => Box::new(std::io::stderr())
};

View File

@ -106,10 +106,10 @@ impl Error for RunnerError {
}
}
fn cause(&self) -> Option<&Error> {
fn cause(&self) -> Option<&dyn Error> {
Some(match *self {
RunnerError::Io(ref err) => err as &Error,
RunnerError::PrefReader(ref err) => err as &Error,
RunnerError::Io(ref err) => err as &dyn Error,
RunnerError::PrefReader(ref err) => err as &dyn Error,
})
}
}

View File

@ -0,0 +1,29 @@
# mozharness configuration for Android x86 7.0 unit tests
#
# This configuration should be combined with suite definitions and other
# mozharness configuration from android_common.py, or similar.
config = {
"tooltool_manifest_path": "testing/config/tooltool-manifests/androidx86_7_0/releng.manifest",
"emulator_manifest": """
[
{
"algorithm": "sha512",
"visibility": "internal",
"filename": "android-sdk_r28.0.25.0-linux-x86emu.tar.gz",
"unpack": true,
"digest": "e62acc91f41ccef65a4937a2672fcb56362e9946b806bacc25854035b57d5bd2d525a9c7d660a643ab6381ae2e3b660be7fea70e302ed314c4b07880b2328e18",
"size": 241459387
}
] """,
"emulator_avd_name": "test-1",
"emulator_process_name": "emulator64-x86",
"emulator_extra_args": "-gpu swiftshader_indirect -skip-adb-auth -verbose -show-kernel -use-system-libs -ranchu -selinux permissive -memory 3072 -cores 4",
"exes": {
},
"env": {
"DISPLAY": ":0.0",
"PATH": "%(PATH)s:%(abs_work_dir)s/android-sdk-linux/emulator:%(abs_work_dir)s/android-sdk-linux/tools:%(abs_work_dir)s/android-sdk-linux/platform-tools",
"MINIDUMP_SAVEPATH": "%(abs_work_dir)s/minidumps",
},
}

View File

@ -28,7 +28,11 @@ config = {
'min_sdk': 21,
'operating_system': 'android',
'partial_env': {
'PATH': ('%(abs_work_dir)s/src/android-sdk-linux/tools:'
'%(abs_work_dir)s/src/clang/bin/:%(PATH)s'),
'CXXFLAGS': '-stdlib=libstdc++',
'LDFLAGS': '-stdlib=libstdc++',
'PATH': ('{MOZ_FETCHES_DIR}/android-sdk-linux/tools:'
'{MOZ_FETCHES_DIR}/clang/bin:'
'{MOZ_FETCHES_DIR}/nasm:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -28,7 +28,11 @@ config = {
'min_sdk': 16,
'operating_system': 'android',
'partial_env': {
'PATH': ('%(abs_work_dir)s/src/android-sdk-linux/tools:'
'%(abs_work_dir)s/src/clang/bin/:%(PATH)s'),
'CXXFLAGS': '-stdlib=libstdc++',
'LDFLAGS': '-stdlib=libstdc++',
'PATH': ('{MOZ_FETCHES_DIR}/android-sdk-linux/tools:'
'{MOZ_FETCHES_DIR}/clang/bin:'
'{MOZ_FETCHES_DIR}/nasm:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -29,7 +29,11 @@ config = {
'min_sdk': 16,
'operating_system': 'android',
'partial_env': {
'PATH': ('%(abs_work_dir)s/src/android-sdk-linux/tools:'
'%(abs_work_dir)s/src/clang/bin/:%(PATH)s'),
'CXXFLAGS': '-stdlib=libstdc++',
'LDFLAGS': '-stdlib=libstdc++',
'PATH': ('{MOZ_FETCHES_DIR}/android-sdk-linux/tools:'
'{MOZ_FETCHES_DIR}/clang/bin:'
'{MOZ_FETCHES_DIR}/nasm:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -29,7 +29,11 @@ config = {
'min_sdk': 16,
'operating_system': 'android',
'partial_env': {
'PATH': ('%(abs_work_dir)s/src/android-sdk-linux/tools:'
'%(abs_work_dir)s/src/clang/bin/:%(PATH)s'),
'CXXFLAGS': '-stdlib=libstdc++',
'LDFLAGS': '-stdlib=libstdc++',
'PATH': ('{MOZ_FETCHES_DIR}/android-sdk-linux/tools:'
'{MOZ_FETCHES_DIR}/clang/bin:'
'{MOZ_FETCHES_DIR}/nasm:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -19,6 +19,9 @@ config = {
'avoid_avx2': True,
'operating_system': 'linux',
'partial_env': {
'PATH': '%(abs_work_dir)s/src/clang/bin/:%(PATH)s',
'PATH': ('{MOZ_FETCHES_DIR}/clang/bin:'
'{MOZ_FETCHES_DIR}/binutils/bin:'
'{MOZ_FETCHES_DIR}/nasm:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -19,6 +19,9 @@ config = {
'avoid_avx2': True,
'operating_system': 'linux',
'partial_env': {
'PATH': '%(abs_work_dir)s/src/clang/bin/:%(PATH)s',
'PATH': ('{MOZ_FETCHES_DIR}/clang/bin:'
'{MOZ_FETCHES_DIR}/binutils/bin:'
'{MOZ_FETCHES_DIR}/nasm:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -19,15 +19,17 @@ config = {
'use_yasm': True,
'operating_system': 'darwin',
'partial_env': {
'CXXFLAGS': ('-target x86_64-apple-darwin11 '
'-B %(abs_work_dir)s/src/cctools/bin '
'CXXFLAGS': ('-target x86_64-apple-darwin '
'-B {MOZ_FETCHES_DIR}/cctools/bin '
'-isysroot %(abs_work_dir)s/src/MacOSX10.11.sdk '
'-mmacosx-version-min=10.11'),
'LDFLAGS': ('-target x86_64-apple-darwin11 '
'-B %(abs_work_dir)s/src/cctools/bin '
'-mmacosx-version-min=10.11'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
'LDFLAGS': ('-target x86_64-apple-darwin '
'-B {MOZ_FETCHES_DIR}/cctools/bin '
'-isysroot %(abs_work_dir)s/src/MacOSX10.11.sdk '
'-mmacosx-version-min=10.11 '
'-fuse-ld=%(abs_work_dir)s/src/cctools/bin/x86_64-darwin11-ld'),
'PATH': '%(abs_work_dir)s/src/clang/bin/:%(PATH)s',
'-mmacosx-version-min=10.11'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
'PATH': ('{MOZ_FETCHES_DIR}/clang/bin/:%(PATH)s'
.format(MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR'])),
},
}

View File

@ -19,13 +19,13 @@ config = {
'arch': 'x86',
'use_yasm': True,
'partial_env': {
'PATH': ('%(abs_work_dir)s\\src\\clang\\bin\\;'
'PATH': ('{MOZ_FETCHES_DIR}\\clang\\bin\\;'
'{_VSPATH}\\VC\\bin\\Hostx64\\x64;%(PATH)s'
# 32-bit redist here for our dump_syms.exe
'{_VSPATH}/VC/redist/x86/Microsoft.VC141.CRT;'
'{_VSPATH}/SDK/Redist/ucrt/DLLs/x86;'
'{_VSPATH}/DIA SDK/bin'
).format(_VSPATH=VSPATH),
).format(_VSPATH=VSPATH, MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR']),
'INCLUDES': (
'-I{_VSPATH}\\VC\\include '
'-I{_VSPATH}\\VC\\atlmfc\\include '

View File

@ -20,14 +20,14 @@ config = {
'use_yasm': False,
'partial_env': {
'PATH': ('%(abs_work_dir)s\\openh264;'
'%(abs_work_dir)s\\src\\clang\\bin\\;'
'{MOZ_FETCHES_DIR}\\clang\\bin\\;'
'{_VSPATH}\\VC\\bin\\Hostx64\\arm64;'
'{_VSPATH}\\VC\\bin\\Hostx64\\x64;'
# 32-bit redist here for our dump_syms.exe
'{_VSPATH}/VC/redist/x86/Microsoft.VC141.CRT;'
'{_VSPATH}/SDK/Redist/ucrt/DLLs/x86;'
'{_VSPATH}/DIA SDK/bin;%(PATH)s;'
).format(_VSPATH=VSPATH),
).format(_VSPATH=VSPATH, MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR']),
'INCLUDES': (
'-I{_VSPATH}\\VC\\include '
'-I{_VSPATH}\\VC\\atlmfc\\include '

View File

@ -19,13 +19,13 @@ config = {
'arch': 'x64',
'use_yasm': True,
'partial_env': {
'PATH': ('%(abs_work_dir)s\\src\\clang\\bin\\;'
'PATH': ('{MOZ_FETCHES_DIR}\\clang\\bin\\;'
'{_VSPATH}\\VC\\bin\\Hostx64\\x64;%(PATH)s;'
# 32-bit redist here for our dump_syms.exe
'{_VSPATH}/VC/redist/x86/Microsoft.VC141.CRT;'
'{_VSPATH}/SDK/Redist/ucrt/DLLs/x86;'
'{_VSPATH}/DIA SDK/bin'
).format(_VSPATH=VSPATH),
).format(_VSPATH=VSPATH, MOZ_FETCHES_DIR=os.environ['MOZ_FETCHES_DIR']),
'INCLUDES': (
'-I{_VSPATH}\\VC\\include '
'-I{_VSPATH}\\VC\\atlmfc\\include '

View File

@ -140,7 +140,6 @@ config = {
"mochitest-webgl2-deqp": ["--subsuite=webgl2-deqp"],
"mochitest-devtools-chrome": ["--flavor=browser", "--subsuite=devtools"],
"mochitest-devtools-chrome-chunked": ["--flavor=browser", "--subsuite=devtools", "--chunk-by-runtime"],
"mochitest-devtools-chrome-webreplay": ["--flavor=browser", "--subsuite=devtools-webreplay"],
"mochitest-a11y": ["--flavor=a11y", "--disable-e10s"],
},
# local reftest suites

View File

@ -302,6 +302,11 @@ class AndroidMixin(object):
self.info("Found Android bogomips: %d" % bogomips)
break
def logcat_path(self):
logcat_filename = 'logcat-%s.log' % self.device_serial
return os.path.join(self.query_abs_dirs()['abs_blob_upload_dir'],
logcat_filename)
def logcat_start(self):
"""
Start recording logcat. Writes logcat to the upload directory.
@ -310,10 +315,7 @@ class AndroidMixin(object):
# corresponding device is stopped. Output is written directly to
# the blobber upload directory so that it is uploaded automatically
# at the end of the job.
logcat_filename = 'logcat-%s.log' % self.device_serial
logcat_path = os.path.join(self.abs_dirs['abs_blob_upload_dir'],
logcat_filename)
self.logcat_file = open(logcat_path, 'w')
self.logcat_file = open(self.logcat_path(), 'w')
logcat_cmd = [self.adb_path, '-s', self.device_serial, 'logcat', '-v',
'threadtime', 'Trace:S', 'StrictMode:S',
'ExchangeService:S']
@ -330,19 +332,19 @@ class AndroidMixin(object):
self.logcat_proc.kill()
self.logcat_file.close()
def install_apk(self, apk):
def install_apk(self, apk, replace=False):
"""
Install the specified apk.
"""
import mozdevice
try:
self.device.install_app(apk)
self.device.install_app(apk, replace=replace)
except (mozdevice.ADBError, mozdevice.ADBTimeoutError), e:
self.info('Failed to install %s on %s: %s %s' %
(self.installer_path, self.device_name,
(apk, self.device_name,
type(e).__name__, e))
self.fatal('INFRA-ERROR: Failed to install %s' %
os.path.basename(self.installer_path),
os.path.basename(apk),
EXIT_STATUS_DICT[TBPL_RETRY])
def is_boot_completed(self):

View File

@ -0,0 +1,245 @@
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
import datetime
import os
import subprocess
import sys
import time
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
from mozharness.base.script import BaseScript
from mozharness.mozilla.automation import (
EXIT_STATUS_DICT,
TBPL_FAILURE,
)
from mozharness.mozilla.mozbase import MozbaseMixin
from mozharness.mozilla.testing.android import AndroidMixin
from mozharness.mozilla.testing.testbase import TestingMixin
class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
def __init__(self, require_config_file=False):
# code in BaseScript.__init__ iterates all the properties to attach
# pre- and post-flight listeners, so we need _is_emulator be defined
# before that happens. Doesn't need to be a real value though.
self._is_emulator = None
super(AndroidWrench, self).__init__()
if self.device_serial is None:
# Running on an emulator. Need absolute path to adb
# to satisfy android.py's start_emulator function.
self._is_emulator = True
self.device_serial = 'emulator-5554'
self._adb_path = os.path.join(
self.query_abs_dirs()['abs_work_dir'],
'android-sdk-linux',
'platform-tools',
'adb')
self.use_gles3 = True
else:
# Running on a device, ensure self.is_emulator returns False.
# Also don't set the adb path explicitly, since it should be
# on the $PATH anyway and we don't have an easy way to get the
# absolute path in automation (it's preinstalled on the bitbar
# image).
self._is_emulator = False
self._errored = False
@property
def is_emulator(self):
"""Overrides the is_emulator property on AndroidMixin."""
return self._is_emulator
def query_abs_dirs(self):
if self.abs_dirs:
return self.abs_dirs
abs_dirs = {}
abs_dirs['abs_work_dir'] = os.path.expanduser("~/.wrench")
if os.environ.get('MOZ_AUTOMATION', '0') == '1':
# In automation use the standard work dir if there is one
parent_abs_dirs = super(AndroidWrench, self).query_abs_dirs()
if 'abs_work_dir' in parent_abs_dirs:
abs_dirs['abs_work_dir'] = parent_abs_dirs['abs_work_dir']
abs_dirs['abs_avds_dir'] = os.path.join(
abs_dirs['abs_work_dir'], 'avds')
abs_dirs['abs_blob_upload_dir'] = os.path.join(
abs_dirs['abs_work_dir'], 'logs')
abs_dirs['abs_apk_path'] = os.environ.get(
'WRENCH_APK',
'gfx/wr/target/android-artifacts/app/build/outputs/apk/app-debug.apk')
abs_dirs['abs_reftests_path'] = os.environ.get(
'WRENCH_REFTESTS',
'gfx/wr/wrench/reftests')
self.abs_dirs = abs_dirs
return self.abs_dirs
def logcat_start(self):
"""Overrides logcat_start in android.py - ensures any pre-existing logcat
is cleared before starting to record the new logcat. This is helpful
when running multiple times in a local emulator."""
logcat_cmd = [self.adb_path, '-s', self.device_serial, 'logcat', '-c']
self.info(' '.join(logcat_cmd))
subprocess.check_call(logcat_cmd)
super(AndroidWrench, self).logcat_start()
def wait_until_process_done(self, process_name, timeout):
"""Waits until the specified process has exited. Polls the process list
every 5 seconds until the process disappears.
:param process_name: string containing the package name of the
application.
:param timeout: integer specifying the maximum time in seconds
to wait for the application to finish.
:returns: boolean - True if the process exited within the indicated
timeout, False if the process had not exited by the timeout.
"""
end_time = datetime.datetime.now() + datetime.timedelta(seconds=timeout)
while self.device.process_exist(process_name, timeout=timeout):
if datetime.datetime.now() > end_time:
return False
time.sleep(5)
return True
def setup_sdcard(self):
# Note that we hard-code /sdcard/wrench as the path here, rather than
# using something like self.device.test_root, because it needs to be
# kept in sync with the path hard-coded inside the wrench source code.
self.device.rm('/sdcard/wrench', recursive=True, force=True)
self.device.mkdir('/sdcard/wrench', parents=True)
self.device.push(self.query_abs_dirs()['abs_reftests_path'], '/sdcard/wrench/reftests')
args_file = os.path.join(
self.query_abs_dirs()['abs_work_dir'], "wrench_args")
with open(args_file, 'w') as argfile:
if self.is_emulator:
argfile.write("env: WRENCH_REFTEST_CONDITION_EMULATOR=1\n")
else:
argfile.write("env: WRENCH_REFTEST_CONDITION_DEVICE=1\n")
argfile.write("reftest")
self.device.push(args_file, '/sdcard/wrench/args')
def run_tests(self):
self.timed_screenshots(None)
self.device.launch_application(
app_name='org.mozilla.wrench',
activity_name='rust.wrench.MainActivity',
intent=None)
self.info("App launched")
done = self.wait_until_process_done('org.mozilla.wrench', timeout=60 * 30)
if not done:
self._errored = True
self.error("Wrench still running after timeout")
def scrape_logcat(self):
"""Wrench will dump the test output to logcat, but for convenience we
want it to show up in the main log. So we scrape it out of the logcat
and dump it to our own log. Note that all output from wrench goes
through the cargo-apk glue stuff, which uses the RustAndroidGlueStdouterr
tag on the output. Also it limits the line length to 512 bytes
(including the null terminator). For reftest unexpected-fail output
this means that the base64 image dump gets wrapped over multiple
lines, so part of what this function does is unwrap that so that the
resulting log is readable by the reftest analyzer."""
with open(self.logcat_path(), 'r') as f:
self.info("=== scraped logcat output ===")
tag = "RustAndroidGlueStdouterr: "
long_line = None
for line in f:
tag_index = line.find(tag)
if tag_index == -1:
# not a line we care about
continue
line = line[tag_index + len(tag):].rstrip()
if long_line is None and "REFTEST " not in line and "panicked" not in line:
# non-interesting line
continue
if long_line is not None:
# continuation of a wrapped line
long_line += line
if len(line) >= 511:
if long_line is None:
# start of a new long line
long_line = line
# else "middle" of a long line that keeps going to the next line
continue
# this line doesn't wrap over to the next, so we can
# print it
if long_line is not None:
line = long_line
long_line = None
if "UNEXPECTED-FAIL" in line or "panicked" in line:
self._errored = True
self.error(line)
else:
self.info(line)
self.info("=== end scraped logcat output ===")
self.info("(see logcat artifact for full logcat")
def setup_emulator(self):
# Running setup_avds will clobber the existing AVD and redownload it.
# For local testing that's kinda expensive, so we omit that if we
# already have that dir.
if not os.path.exists(self.query_abs_dirs()['abs_avds_dir']):
self.setup_avds()
if os.environ.get('MOZ_AUTOMATION', '0') == '1':
self.start_emulator()
else:
# Can't use start_emulator because it tries to download a non-public
# artifact. Instead we just symlink the presumably already-existing
# SDK into the right place, and manually run the launch.
sdk_path = os.path.join(
self.query_abs_dirs()['abs_work_dir'],
'android-sdk-linux')
if not os.path.exists(sdk_path):
mozbuild_path = os.environ.get(
'MOZBUILD_STATE_PATH',
os.path.expanduser('~/.mozbuild'))
mozbuild_sdk = os.environ.get(
'ANDROID_SDK_HOME',
os.path.join(mozbuild_path, 'android-sdk-linux'))
if os.path.exists(mozbuild_sdk):
os.symlink(mozbuild_sdk, sdk_path)
else:
self.error('Unable to find android SDK at %s' % mozbuild_sdk)
return
self._launch_emulator()
def do_test(self):
if self.is_emulator:
self.setup_emulator()
self.verify_device()
self.info('Installing APK...')
self.install_apk(self.query_abs_dirs()['abs_apk_path'], replace=True)
self.info('Setting up SD card...')
self.setup_sdcard()
self.info('Running tests...')
self.run_tests()
self.info('Tests done; parsing logcat...')
self.logcat_stop()
self.scrape_logcat()
self.info('All done!')
def check_errors(self):
if self._errored:
self.info("Errors encountered, terminating with error code...")
exit(EXIT_STATUS_DICT[TBPL_FAILURE])
if __name__ == '__main__':
test = AndroidWrench()
test.do_test()
test.check_errors()

View File

@ -174,7 +174,6 @@ class OpenH264Build(TransferMixin, VCSScript, TooltoolMixin):
self.fatal("can't determine platform")
def query_make_params(self):
dirs = self.query_abs_dirs()
retval = []
if self.config['debug_build']:
retval.append('BUILDTYPE=Debug')
@ -198,7 +197,7 @@ class OpenH264Build(TransferMixin, VCSScript, TooltoolMixin):
retval.append("ARCH=arm")
retval.append('TARGET=invalid')
retval.append('NDKLEVEL=%s' % self.config['min_sdk'])
retval.append('NDKROOT=%s/src/android-ndk' % dirs['abs_work_dir'])
retval.append('NDKROOT=%s/android-ndk' % os.environ['MOZ_FETCHES_DIR'])
retval.append('NDK_TOOLCHAIN_VERSION=clang')
if self.config["operating_system"] == "darwin":
retval.append('OS=darwin')
@ -285,7 +284,7 @@ class OpenH264Build(TransferMixin, VCSScript, TooltoolMixin):
# os.symlink is not available on Windows until we switch to
# Python 3.
os.system('ln -s %s %s' % (
os.path.join(dirs['abs_work_dir'], 'src', 'clang',
os.path.join(os.environ['MOZ_FETCHES_DIR'], 'clang',
'bin', 'clang.exe'),
os.path.join(openh264_dir, 'cpp')))
return 0

View File

@ -16,8 +16,6 @@ user_pref("layout.css.grid-template-subgrid-value.enabled", true);
user_pref("layout.css.initial-letter.enabled", true);
// Enable -webkit-{min|max}-device-pixel-ratio media queries for testing
user_pref("layout.css.prefixes.device-pixel-ratio-webkit", true);
// Enable webkit prefixed CSS features for testing
user_pref("layout.css.prefixes.webkit", true);
// Enable Media Source Extensions for testing
user_pref("media.mediasource.mp4.enabled", true);
user_pref("media.mediasource.webm.enabled", true);

View File

@ -82,8 +82,6 @@ user_pref("datareporting.healthreport.uploadEnabled", false);
user_pref("devtools.browsertoolbox.panel", "jsdebugger");
user_pref("devtools.debugger.remote-port", 6023);
user_pref("devtools.testing", true);
// Required to set values in wpt metadata files (bug 1485842)
user_pref("dom.audioworklet.enabled", false);
user_pref("dom.allow_scripts_to_close_windows", true);
user_pref("dom.disable_open_during_load", false);
user_pref("dom.ipc.reportProcessHangs", false); // process hang monitor

View File

@ -13,6 +13,8 @@ user_pref("media.gmp-manager.url.override", "http://%(server)s/dummy-gmp-manager
user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy");
// Prevent Remote Settings to issue non local connections.
user_pref("services.settings.server", "http://localhost/remote-settings-dummy/v1");
// Prevent intermediate preloads to be downloaded on Remote Settings polling.
user_pref("security.remote_settings.intermediates.enabled", false);
// The process priority manager only shifts priorities when it has at least
// one active tab. xpcshell tabs don't have any active tabs, which would mean
// all processes would run at low priority, which is not desirable, so we

Some files were not shown because too many files have changed in this diff Show More