merge autoland to mozilla-central a=merge
@ -7,6 +7,9 @@ module.exports = {
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/import-globals": "warn",
|
||||
|
||||
// No (!foo in bar) or (!object instanceof Class)
|
||||
"no-unsafe-negation": "error",
|
||||
},
|
||||
"env": {
|
||||
"es6": true
|
||||
|
@ -1,5 +1,7 @@
|
||||
import os, shutil
|
||||
from marionette import MarionetteTestCase
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from marionette_harness import MarionetteTestCase
|
||||
|
||||
|
||||
class TestFirefoxRefresh(MarionetteTestCase):
|
||||
|
@ -1,9 +1,19 @@
|
||||
. "$topsrcdir/browser/config/mozconfigs/common"
|
||||
. "$topsrcdir/build/macosx/mozconfig.common"
|
||||
|
||||
ac_add_options --with-l10n-base=../../l10n
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --with-branding=browser/branding/nightly
|
||||
|
||||
if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
|
||||
ac_add_options --with-macbundlename-prefix=Firefox
|
||||
fi
|
||||
|
||||
export MOZILLA_OFFICIAL=1
|
||||
|
||||
# Enable Telemetry
|
||||
export MOZ_TELEMETRY_REPORTING=1
|
||||
|
||||
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
|
||||
# Bug 1283438
|
||||
mk_add_options AUTOCLOBBER=
|
||||
|
@ -17,8 +17,8 @@
|
||||
},
|
||||
{
|
||||
"version": "rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16) repack",
|
||||
"size": 96275316,
|
||||
"digest": "26c11e34df81f5d7ffafc3492df9c6821f644a2e2eda5cfbbcdb1ac23e4ee196007b417c862c60a97bbf66e4be9c801400990938cd3aefec19b1cf9eaf1a9b54",
|
||||
"size": 94830820,
|
||||
"digest": "6f2a1cf325d957f0328d2d853fc07944a857e872f6e44df15f6ebb45c032c0ebbf52f56c872bc72927ebcdd830002d759dd92e8fc90048b52c07058955c69c4c",
|
||||
"algorithm": "sha512",
|
||||
"filename": "rustc.tar.xz",
|
||||
"unpack": true
|
||||
|
@ -150,9 +150,6 @@ module.exports = { // eslint-disable-line no-undef
|
||||
// No reassigning native JS objects
|
||||
"no-native-reassign": "error",
|
||||
|
||||
// No (!foo in bar)
|
||||
"no-negated-in-lhs": "error",
|
||||
|
||||
// Nested ternary statements are confusing
|
||||
"no-nested-ternary": "error",
|
||||
|
||||
|
@ -68,7 +68,7 @@ SEARCH_PATHS = [
|
||||
'testing/firefox-ui/harness',
|
||||
'testing/marionette/client',
|
||||
'testing/marionette/harness',
|
||||
'testing/marionette/harness/marionette/runner/mixins/browsermob-proxy-py',
|
||||
'testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py',
|
||||
'testing/marionette/puppeteer/firefox',
|
||||
'testing/mozbase/mozcrash',
|
||||
'testing/mozbase/mozdebug',
|
||||
|
@ -122,7 +122,7 @@ def rust_triple_alias(host_or_target):
|
||||
# OpenBSD
|
||||
('x86_64', 'OpenBSD'): 'x86_64-unknown-openbsd',
|
||||
# Linux
|
||||
('x86', 'Linux'): 'i586-unknown-linux-gnu',
|
||||
('x86', 'Linux'): 'i686-unknown-linux-gnu',
|
||||
# Linux
|
||||
('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu',
|
||||
# OS X and iOS
|
||||
|
@ -1,8 +1,8 @@
|
||||
altgraph.pth:python/altgraph
|
||||
marionette_driver.pth:testing/marionette/client
|
||||
browsermobproxy.pth:testing/marionette/harness/marionette/runner/mixins/browsermob-proxy-py
|
||||
marionette_harness.pth:testing/marionette/harness
|
||||
browsermobproxy.pth:testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py
|
||||
wptserve.pth:testing/web-platform/tests/tools/wptserve
|
||||
marionette.pth:testing/marionette/harness
|
||||
blessings.pth:python/blessings
|
||||
configobj.pth:python/configobj
|
||||
jsmin.pth:python/jsmin
|
||||
|
@ -27,6 +27,10 @@ const {
|
||||
getUrlHost,
|
||||
parseQueryString,
|
||||
} = require("./request-utils");
|
||||
const { createFactory } = require("devtools/client/shared/vendor/react");
|
||||
const ReactDOM = require("devtools/client/shared/vendor/react-dom");
|
||||
const Provider = createFactory(require("devtools/client/shared/vendor/react-redux").Provider);
|
||||
const TimingsPanel = createFactory(require("./shared/components/timings-panel"));
|
||||
|
||||
// 100 KB in bytes
|
||||
const SOURCE_SYNTAX_HIGHLIGHT_MAX_FILE_SIZE = 102400;
|
||||
@ -86,9 +90,16 @@ DetailsView.prototype = {
|
||||
/**
|
||||
* Initialization function, called when the network monitor is started.
|
||||
*/
|
||||
initialize: function () {
|
||||
initialize: function (store) {
|
||||
dumpn("Initializing the DetailsView");
|
||||
|
||||
this._timingsPanelNode = $("#react-timings-tabpanel-hook");
|
||||
|
||||
ReactDOM.render(Provider(
|
||||
{ store },
|
||||
TimingsPanel()
|
||||
), this._timingsPanelNode);
|
||||
|
||||
this.widget = $("#event-details-pane");
|
||||
this.sidebar = new ToolSidebar(this.widget, this, "netmonitor", {
|
||||
disableTelemetry: true,
|
||||
@ -134,6 +145,7 @@ DetailsView.prototype = {
|
||||
*/
|
||||
destroy: function () {
|
||||
dumpn("Destroying the DetailsView");
|
||||
ReactDOM.unmountComponentAtNode(this._timingsPanelNode);
|
||||
this.sidebar.destroy();
|
||||
$("tabpanels", this.widget).removeEventListener("select",
|
||||
this._onTabSelect);
|
||||
@ -243,10 +255,6 @@ DetailsView.prototype = {
|
||||
case 3:
|
||||
yield view._setResponseBody(src.url, src.responseContent);
|
||||
break;
|
||||
// "Timings"
|
||||
case 4:
|
||||
yield view._setTimingsInformation(src.eventTimings);
|
||||
break;
|
||||
// "Security"
|
||||
case 5:
|
||||
yield view._setSecurityInfo(src.securityInfo, src.url);
|
||||
@ -685,87 +693,6 @@ DetailsView.prototype = {
|
||||
window.emit(EVENTS.RESPONSE_BODY_DISPLAYED);
|
||||
}),
|
||||
|
||||
/**
|
||||
* Sets the timings information shown in this view.
|
||||
*
|
||||
* @param object response
|
||||
* The message received from the server.
|
||||
*/
|
||||
_setTimingsInformation: function (response) {
|
||||
if (!response) {
|
||||
return;
|
||||
}
|
||||
let { blocked, dns, connect, send, wait, receive } = response.timings;
|
||||
|
||||
let tabboxWidth = $("#details-pane").getAttribute("width");
|
||||
|
||||
// Other nodes also take some space.
|
||||
let availableWidth = tabboxWidth / 2;
|
||||
let scale = (response.totalTime > 0 ?
|
||||
Math.max(availableWidth / response.totalTime, 0) :
|
||||
0);
|
||||
|
||||
$("#timings-summary-blocked .requests-menu-timings-box")
|
||||
.setAttribute("width", blocked * scale);
|
||||
$("#timings-summary-blocked .requests-menu-timings-total")
|
||||
.setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", blocked));
|
||||
|
||||
$("#timings-summary-dns .requests-menu-timings-box")
|
||||
.setAttribute("width", dns * scale);
|
||||
$("#timings-summary-dns .requests-menu-timings-total")
|
||||
.setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", dns));
|
||||
|
||||
$("#timings-summary-connect .requests-menu-timings-box")
|
||||
.setAttribute("width", connect * scale);
|
||||
$("#timings-summary-connect .requests-menu-timings-total")
|
||||
.setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", connect));
|
||||
|
||||
$("#timings-summary-send .requests-menu-timings-box")
|
||||
.setAttribute("width", send * scale);
|
||||
$("#timings-summary-send .requests-menu-timings-total")
|
||||
.setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", send));
|
||||
|
||||
$("#timings-summary-wait .requests-menu-timings-box")
|
||||
.setAttribute("width", wait * scale);
|
||||
$("#timings-summary-wait .requests-menu-timings-total")
|
||||
.setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", wait));
|
||||
|
||||
$("#timings-summary-receive .requests-menu-timings-box")
|
||||
.setAttribute("width", receive * scale);
|
||||
$("#timings-summary-receive .requests-menu-timings-total")
|
||||
.setAttribute("value", L10N.getFormatStr("networkMenu.totalMS", receive));
|
||||
|
||||
$("#timings-summary-dns .requests-menu-timings-box")
|
||||
.style.transform = "translateX(" + (scale * blocked) + "px)";
|
||||
$("#timings-summary-connect .requests-menu-timings-box")
|
||||
.style.transform = "translateX(" + (scale * (blocked + dns)) + "px)";
|
||||
$("#timings-summary-send .requests-menu-timings-box")
|
||||
.style.transform =
|
||||
"translateX(" + (scale * (blocked + dns + connect)) + "px)";
|
||||
$("#timings-summary-wait .requests-menu-timings-box")
|
||||
.style.transform =
|
||||
"translateX(" + (scale * (blocked + dns + connect + send)) + "px)";
|
||||
$("#timings-summary-receive .requests-menu-timings-box")
|
||||
.style.transform =
|
||||
"translateX(" + (scale * (blocked + dns + connect + send + wait)) +
|
||||
"px)";
|
||||
|
||||
$("#timings-summary-dns .requests-menu-timings-total")
|
||||
.style.transform = "translateX(" + (scale * blocked) + "px)";
|
||||
$("#timings-summary-connect .requests-menu-timings-total")
|
||||
.style.transform = "translateX(" + (scale * (blocked + dns)) + "px)";
|
||||
$("#timings-summary-send .requests-menu-timings-total")
|
||||
.style.transform =
|
||||
"translateX(" + (scale * (blocked + dns + connect)) + "px)";
|
||||
$("#timings-summary-wait .requests-menu-timings-total")
|
||||
.style.transform =
|
||||
"translateX(" + (scale * (blocked + dns + connect + send)) + "px)";
|
||||
$("#timings-summary-receive .requests-menu-timings-total")
|
||||
.style.transform =
|
||||
"translateX(" + (scale * (blocked + dns + connect + send + wait)) +
|
||||
"px)";
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the preview for HTML responses shown in this view.
|
||||
*
|
||||
|
@ -9,6 +9,7 @@ DIRS += [
|
||||
'middleware',
|
||||
'reducers',
|
||||
'selectors',
|
||||
'shared',
|
||||
'utils',
|
||||
]
|
||||
|
||||
|
@ -50,7 +50,7 @@ var NetMonitorView = {
|
||||
|
||||
this.Toolbar.initialize(gStore);
|
||||
this.RequestsMenu.initialize(gStore);
|
||||
this.NetworkDetails.initialize();
|
||||
this.NetworkDetails.initialize(gStore);
|
||||
this.CustomRequest.initialize();
|
||||
this.PerformanceStatistics.initialize(gStore);
|
||||
},
|
||||
|
@ -262,56 +262,8 @@
|
||||
</tabpanel>
|
||||
<tabpanel id="timings-tabpanel"
|
||||
class="tabpanel-content">
|
||||
<vbox flex="1">
|
||||
<hbox id="timings-summary-blocked"
|
||||
class="tabpanel-summary-container"
|
||||
align="center">
|
||||
<label class="plain tabpanel-summary-label"
|
||||
data-localization="content=netmonitor.timings.blocked"/>
|
||||
<hbox class="requests-menu-timings-box blocked"/>
|
||||
<label class="plain requests-menu-timings-total"/>
|
||||
</hbox>
|
||||
<hbox id="timings-summary-dns"
|
||||
class="tabpanel-summary-container"
|
||||
align="center">
|
||||
<label class="plain tabpanel-summary-label"
|
||||
data-localization="content=netmonitor.timings.dns"/>
|
||||
<hbox class="requests-menu-timings-box dns"/>
|
||||
<label class="plain requests-menu-timings-total"/>
|
||||
</hbox>
|
||||
<hbox id="timings-summary-connect"
|
||||
class="tabpanel-summary-container"
|
||||
align="center">
|
||||
<label class="plain tabpanel-summary-label"
|
||||
data-localization="content=netmonitor.timings.connect"/>
|
||||
<hbox class="requests-menu-timings-box connect"/>
|
||||
<label class="plain requests-menu-timings-total"/>
|
||||
</hbox>
|
||||
<hbox id="timings-summary-send"
|
||||
class="tabpanel-summary-container"
|
||||
align="center">
|
||||
<label class="plain tabpanel-summary-label"
|
||||
data-localization="content=netmonitor.timings.send"/>
|
||||
<hbox class="requests-menu-timings-box send"/>
|
||||
<label class="plain requests-menu-timings-total"/>
|
||||
</hbox>
|
||||
<hbox id="timings-summary-wait"
|
||||
class="tabpanel-summary-container"
|
||||
align="center">
|
||||
<label class="plain tabpanel-summary-label"
|
||||
data-localization="content=netmonitor.timings.wait"/>
|
||||
<hbox class="requests-menu-timings-box wait"/>
|
||||
<label class="plain requests-menu-timings-total"/>
|
||||
</hbox>
|
||||
<hbox id="timings-summary-receive"
|
||||
class="tabpanel-summary-container"
|
||||
align="center">
|
||||
<label class="plain tabpanel-summary-label"
|
||||
data-localization="content=netmonitor.timings.receive"/>
|
||||
<hbox class="requests-menu-timings-box receive"/>
|
||||
<label class="plain requests-menu-timings-total"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<html:div xmlns="http://www.w3.org/1999/xhtml"
|
||||
id="react-timings-tabpanel-hook"/>
|
||||
</tabpanel>
|
||||
<tabpanel id="security-tabpanel"
|
||||
class="tabpanel-content">
|
||||
|
7
devtools/client/netmonitor/shared/components/moz.build
Normal file
@ -0,0 +1,7 @@
|
||||
# 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/.
|
||||
|
||||
DevToolsModules(
|
||||
'timings-panel.js',
|
||||
)
|
@ -0,0 +1,85 @@
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { DOM, PropTypes } = require("devtools/client/shared/vendor/react");
|
||||
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
||||
const { L10N } = require("../../l10n");
|
||||
const { getSelectedRequest } = require("../../selectors/index");
|
||||
|
||||
const { div, span } = DOM;
|
||||
const types = ["blocked", "dns", "connect", "send", "wait", "receive"];
|
||||
const TIMINGS_END_PADDING = "80px";
|
||||
|
||||
/*
|
||||
* Timings panel component
|
||||
* Display timeline bars that shows the total wait time for various stages
|
||||
*/
|
||||
function TimingsPanel({
|
||||
timings = {},
|
||||
totalTime = 0,
|
||||
}) {
|
||||
const timelines = types.map((type, idx) => {
|
||||
// Determine the relative offset for each timings box. For example, the
|
||||
// offset of third timings box will be 0 + blocked offset + dns offset
|
||||
const offset = types
|
||||
.slice(0, idx)
|
||||
.reduce((acc, cur) => (acc + timings[cur] || 0), 0);
|
||||
const offsetScale = offset / totalTime || 0;
|
||||
const timelineScale = timings[type] / totalTime || 0;
|
||||
|
||||
return div({
|
||||
key: type,
|
||||
id: `timings-summary-${type}`,
|
||||
className: "tabpanel-summary-container",
|
||||
},
|
||||
span({ className: "tabpanel-summary-label" },
|
||||
L10N.getStr(`netmonitor.timings.${type}`)
|
||||
),
|
||||
div({ className: "requests-menu-timings-container" },
|
||||
span({
|
||||
className: "requests-menu-timings-offset",
|
||||
style: {
|
||||
width: `calc(${offsetScale} * (100% - ${TIMINGS_END_PADDING})`,
|
||||
},
|
||||
}),
|
||||
span({
|
||||
className: `requests-menu-timings-box ${type}`,
|
||||
style: {
|
||||
width: `calc(${timelineScale} * (100% - ${TIMINGS_END_PADDING}))`,
|
||||
},
|
||||
}),
|
||||
span({ className: "requests-menu-timings-total" },
|
||||
L10N.getFormatStr("networkMenu.totalMS", timings[type])
|
||||
)
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
return div({}, timelines);
|
||||
}
|
||||
|
||||
TimingsPanel.displayName = "TimingsPanel";
|
||||
|
||||
TimingsPanel.propTypes = {
|
||||
timings: PropTypes.object,
|
||||
totalTime: PropTypes.number,
|
||||
};
|
||||
|
||||
module.exports = connect(
|
||||
(state) => {
|
||||
const selectedRequest = getSelectedRequest(state);
|
||||
|
||||
if (selectedRequest && selectedRequest.eventTimings) {
|
||||
const { timings, totalTime } = selectedRequest.eventTimings;
|
||||
return {
|
||||
timings,
|
||||
totalTime,
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
)(TimingsPanel);
|
7
devtools/client/netmonitor/shared/moz.build
Normal file
@ -0,0 +1,7 @@
|
||||
# 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/.
|
||||
|
||||
DIRS += [
|
||||
'components',
|
||||
]
|
@ -539,6 +539,7 @@
|
||||
}
|
||||
|
||||
.requests-menu-timings-total {
|
||||
display: inline-block;
|
||||
padding-inline-start: 4px;
|
||||
font-size: 85%;
|
||||
font-weight: 600;
|
||||
@ -548,6 +549,7 @@
|
||||
}
|
||||
|
||||
.requests-menu-timings-box {
|
||||
display: inline-block;
|
||||
height: 9px;
|
||||
}
|
||||
|
||||
@ -672,6 +674,7 @@
|
||||
}
|
||||
|
||||
.tabpanel-summary-label {
|
||||
display: inline-block;
|
||||
padding-inline-start: 4px;
|
||||
padding-inline-end: 3px;
|
||||
font-weight: 600;
|
||||
@ -744,18 +747,28 @@
|
||||
|
||||
/* Timings tabpanel */
|
||||
|
||||
#timings-tabpanel .tabpanel-summary-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#timings-tabpanel .tabpanel-summary-label {
|
||||
width: 10em;
|
||||
}
|
||||
|
||||
#timings-tabpanel .requests-menu-timings-box {
|
||||
transition: transform 0.2s ease-out;
|
||||
border: none;
|
||||
min-width: 1px;
|
||||
#timings-tabpanel .requests-menu-timings-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#timings-tabpanel .requests-menu-timings-total {
|
||||
transition: transform 0.2s ease-out;
|
||||
#timings-tabpanel .requests-menu-timings-offset {
|
||||
transition: width 0.2s ease-out;
|
||||
}
|
||||
|
||||
#timings-tabpanel .requests-menu-timings-box {
|
||||
border: none;
|
||||
min-width: 1px;
|
||||
transition: width 0.2s ease-out;
|
||||
}
|
||||
|
||||
.theme-firebug #timings-tabpanel .requests-menu-timings-total {
|
||||
@ -1070,3 +1083,13 @@
|
||||
font-size: 85%;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: normal html block element cannot fill outer XUL element
|
||||
* This workaround should be removed after sidebar is migrated to react
|
||||
*/
|
||||
#react-timings-tabpanel-hook {
|
||||
display: -moz-box;
|
||||
-moz-box-orient: vertical;
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ try {
|
||||
try {
|
||||
m = require(module);
|
||||
|
||||
if (!setupChild in m) {
|
||||
if (!(setupChild in m)) {
|
||||
dumpn(`ERROR: module '${module}' does not export '${setupChild}'`);
|
||||
return false;
|
||||
}
|
||||
|
@ -1049,7 +1049,7 @@ var DebuggerServer = {
|
||||
try {
|
||||
m = require(module);
|
||||
|
||||
if (!setupParent in m) {
|
||||
if (!(setupParent in m)) {
|
||||
dumpn(`ERROR: module '${module}' does not export '${setupParent}'`);
|
||||
return false;
|
||||
}
|
||||
|
@ -2,15 +2,19 @@
|
||||
# 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 manifestparser import read_ini
|
||||
import os
|
||||
import sys
|
||||
|
||||
from marionette import BaseMarionetteTestRunner, BaseMarionetteArguments
|
||||
from marionette.runner import BrowserMobProxyArguments
|
||||
from marionette.runtests import MarionetteHarness, cli as mn_cli
|
||||
import mozlog
|
||||
|
||||
from manifestparser import read_ini
|
||||
from marionette_harness import (
|
||||
BaseMarionetteTestRunner,
|
||||
BaseMarionetteArguments,
|
||||
BrowserMobProxyArguments,
|
||||
)
|
||||
from marionette_harness.runtests import MarionetteHarness, cli as mn_cli
|
||||
|
||||
import external_media_tests
|
||||
from testcase import MediaTestCase
|
||||
from external_media_tests.media_utils.video_puppeteer import debug_script
|
||||
|
@ -4,12 +4,15 @@
|
||||
|
||||
import re
|
||||
import os
|
||||
import time
|
||||
|
||||
from marionette import BrowserMobProxyTestCaseMixin, MarionetteTestCase, Marionette
|
||||
from marionette_driver import Wait
|
||||
from marionette_driver.errors import TimeoutException
|
||||
from marionette.marionette_test import SkipTest
|
||||
from marionette_harness import (
|
||||
BrowserMobProxyTestCaseMixin,
|
||||
MarionetteTestCase,
|
||||
Marionette,
|
||||
SkipTest,
|
||||
)
|
||||
|
||||
from firefox_puppeteer import PuppeteerMixin
|
||||
from external_media_tests.utils import (timestamp_now, verbose_until)
|
||||
|
@ -1,11 +1,12 @@
|
||||
# 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/.
|
||||
|
||||
from collections import namedtuple
|
||||
from time import clock, sleep
|
||||
|
||||
from marionette import Marionette
|
||||
from marionette_driver import By, expected, Wait
|
||||
from marionette_harness import Marionette
|
||||
|
||||
from external_media_tests.utils import verbose_until
|
||||
|
||||
|
@ -1,14 +1,17 @@
|
||||
# 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/.
|
||||
from collections import namedtuple
|
||||
from time import sleep
|
||||
import re
|
||||
from json import loads
|
||||
|
||||
from marionette import Marionette
|
||||
import re
|
||||
|
||||
from collections import namedtuple
|
||||
from json import loads
|
||||
from time import sleep
|
||||
|
||||
from marionette_driver import By, expected, Wait
|
||||
from marionette_driver.errors import TimeoutException, NoSuchElementException
|
||||
from marionette_harness import Marionette
|
||||
|
||||
from video_puppeteer import VideoPuppeteer, VideoException
|
||||
from external_media_tests.utils import verbose_until
|
||||
|
||||
|
@ -2,7 +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 marionette import BrowserMobProxyTestCaseMixin
|
||||
from marionette_harness import BrowserMobProxyTestCaseMixin
|
||||
|
||||
from external_media_harness.testcase import (
|
||||
EMESetupMixin,
|
||||
@ -10,6 +10,7 @@ from external_media_harness.testcase import (
|
||||
NetworkBandwidthTestsMixin,
|
||||
)
|
||||
|
||||
|
||||
class TestEMEPlaybackLimitingBandwidth(NetworkBandwidthTestCase,
|
||||
BrowserMobProxyTestCaseMixin,
|
||||
NetworkBandwidthTestsMixin,
|
||||
|
@ -2,8 +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 marionette_harness import Marionette
|
||||
|
||||
from marionette import Marionette
|
||||
from external_media_harness.testcase import MediaTestCase
|
||||
from external_media_tests.media_utils.video_puppeteer import VideoPuppeteer
|
||||
|
||||
|
@ -2,7 +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 marionette import BrowserMobProxyTestCaseMixin
|
||||
from marionette_harness import BrowserMobProxyTestCaseMixin
|
||||
|
||||
from external_media_harness.testcase import (
|
||||
NetworkBandwidthTestCase, NetworkBandwidthTestsMixin
|
||||
|
@ -2,8 +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 marionette_harness import Marionette
|
||||
|
||||
from marionette import Marionette
|
||||
from external_media_harness.testcase import MediaTestCase
|
||||
from external_media_tests.media_utils.video_puppeteer import VideoPuppeteer
|
||||
|
||||
|
@ -2,7 +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 marionette import BrowserMobProxyTestCaseMixin
|
||||
from marionette_harness import BrowserMobProxyTestCaseMixin
|
||||
|
||||
from external_media_harness.testcase import NetworkBandwidthTestCase
|
||||
|
||||
|
@ -2,9 +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 marionette import Marionette
|
||||
from marionette_driver import Wait
|
||||
from marionette_driver.errors import TimeoutException
|
||||
from marionette_harness import Marionette
|
||||
|
||||
from external_media_tests.utils import verbose_until
|
||||
from external_media_harness.testcase import MediaTestCase
|
||||
|
@ -1,4 +1,5 @@
|
||||
from marionette import Marionette
|
||||
from marionette_harness import Marionette
|
||||
|
||||
from external_media_harness.testcase import MediaTestCase
|
||||
|
||||
|
||||
|
23
dom/media/test/external/requirements.txt
vendored
@ -1,20 +1,5 @@
|
||||
browsermob-proxy==0.7.1
|
||||
manifestparser==1.1
|
||||
mozcrash==0.17
|
||||
mozdevice==0.48
|
||||
mozfile==1.2
|
||||
mozhttpd==0.7
|
||||
mozinfo==0.9
|
||||
# optional - mozharness install step
|
||||
mozInstall==1.12
|
||||
mozlog==3.3
|
||||
moznetwork==0.27
|
||||
mozprocess==0.23
|
||||
mozprofile==0.28
|
||||
mozrunner==6.12
|
||||
moztest==0.7
|
||||
mozversion==1.4
|
||||
wptserve==1.3.0
|
||||
marionette-client==3.1.0
|
||||
marionette-driver==2.0.0
|
||||
firefox-puppeteer >= 52.1.0, <53.0.0
|
||||
manifestparser==1.1
|
||||
marionette-driver==2.2.0
|
||||
marionette-harness==4.0.0
|
||||
mozlog==3.3
|
||||
|
@ -29,8 +29,6 @@ Script B (ril_consts.js) not.
|
||||
The above merge way ensures the correct scope of 'strict mode.'
|
||||
"""
|
||||
|
||||
|
||||
from marionette.marionette_test import MarionetteTestCase
|
||||
import bisect
|
||||
import inspect
|
||||
import os
|
||||
@ -38,6 +36,8 @@ import os.path
|
||||
import re
|
||||
import unicodedata
|
||||
|
||||
from marionette_harness import MarionetteTestCase
|
||||
|
||||
|
||||
class StringUtility:
|
||||
|
||||
|
@ -423,7 +423,7 @@ public:
|
||||
return mLayer->GetScrollbarTargetContainerId();
|
||||
}
|
||||
|
||||
int32_t GetScrollbarSize() const
|
||||
int32_t GetScrollThumbLength() const
|
||||
{
|
||||
if (GetScrollbarDirection() == Layer::VERTICAL) {
|
||||
return mLayer->GetVisibleRegion().GetBounds().height;
|
||||
|
@ -478,7 +478,7 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
|
||||
GetEventRegionsOverride(aParent, aLayer));
|
||||
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
|
||||
aLayer.GetScrollbarDirection(),
|
||||
aLayer.GetScrollbarSize(),
|
||||
aLayer.GetScrollThumbLength(),
|
||||
aLayer.IsScrollbarContainer());
|
||||
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
|
||||
return node;
|
||||
@ -665,7 +665,7 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
|
||||
|
||||
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
|
||||
aLayer.GetScrollbarDirection(),
|
||||
aLayer.GetScrollbarSize(),
|
||||
aLayer.GetScrollThumbLength(),
|
||||
aLayer.IsScrollbarContainer());
|
||||
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
|
||||
return node;
|
||||
|
@ -40,8 +40,8 @@ public:
|
||||
AsyncDragMetrics(const FrameMetrics::ViewID& aViewId,
|
||||
uint32_t aPresShellId,
|
||||
uint64_t aDragStartSequenceNumber,
|
||||
CSSIntCoord aScrollbarDragOffset,
|
||||
const CSSIntRect& aScrollTrack,
|
||||
CSSCoord aScrollbarDragOffset,
|
||||
const CSSRect& aScrollTrack,
|
||||
DragDirection aDirection)
|
||||
: mViewId(aViewId)
|
||||
, mPresShellId(aPresShellId)
|
||||
@ -54,8 +54,8 @@ public:
|
||||
FrameMetrics::ViewID mViewId;
|
||||
uint32_t mPresShellId;
|
||||
uint64_t mDragStartSequenceNumber;
|
||||
CSSIntCoord mScrollbarDragOffset;
|
||||
CSSIntRect mScrollTrack;
|
||||
CSSCoord mScrollbarDragOffset;
|
||||
CSSRect mScrollTrack;
|
||||
DragDirection mDirection;
|
||||
};
|
||||
|
||||
|
@ -861,7 +861,7 @@ static IntCoordTyped<Units> GetAxisStart(AsyncDragMetrics::DragDirection aDir, c
|
||||
}
|
||||
|
||||
template <typename Units>
|
||||
static IntCoordTyped<Units> GetAxisEnd(AsyncDragMetrics::DragDirection aDir, const IntRectTyped<Units>& aValue) {
|
||||
static CoordTyped<Units> GetAxisEnd(AsyncDragMetrics::DragDirection aDir, const RectTyped<Units>& aValue) {
|
||||
if (aDir == AsyncDragMetrics::HORIZONTAL) {
|
||||
return aValue.x + aValue.width;
|
||||
} else {
|
||||
@ -870,7 +870,7 @@ static IntCoordTyped<Units> GetAxisEnd(AsyncDragMetrics::DragDirection aDir, con
|
||||
}
|
||||
|
||||
template <typename Units>
|
||||
static CoordTyped<Units> GetAxisSize(AsyncDragMetrics::DragDirection aDir, const RectTyped<Units>& aValue) {
|
||||
static CoordTyped<Units> GetAxisLength(AsyncDragMetrics::DragDirection aDir, const RectTyped<Units>& aValue) {
|
||||
if (aDir == AsyncDragMetrics::HORIZONTAL) {
|
||||
return aValue.width;
|
||||
} else {
|
||||
@ -898,6 +898,10 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
if (aEvent.mType != MouseInput::MouseType::MOUSE_MOVE) {
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
RefPtr<HitTestingTreeNode> node =
|
||||
GetApzcTreeManager()->FindScrollNode(aDragMetrics);
|
||||
if (!node) {
|
||||
@ -915,12 +919,12 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
|
||||
CSSRect cssCompositionBound = mFrameMetrics.CalculateCompositedRectInCssPixels();
|
||||
|
||||
CSSCoord mousePosition = GetAxisStart(aDragMetrics.mDirection, scrollbarPoint) -
|
||||
CSSCoord(aDragMetrics.mScrollbarDragOffset) -
|
||||
aDragMetrics.mScrollbarDragOffset -
|
||||
GetAxisStart(aDragMetrics.mDirection, cssCompositionBound) -
|
||||
CSSCoord(GetAxisStart(aDragMetrics.mDirection, aDragMetrics.mScrollTrack));
|
||||
GetAxisStart(aDragMetrics.mDirection, aDragMetrics.mScrollTrack);
|
||||
|
||||
CSSCoord scrollMax = CSSCoord(GetAxisEnd(aDragMetrics.mDirection, aDragMetrics.mScrollTrack));
|
||||
scrollMax -= node->GetScrollSize() /
|
||||
CSSCoord scrollMax = GetAxisLength(aDragMetrics.mDirection, aDragMetrics.mScrollTrack);
|
||||
scrollMax -= node->GetScrollThumbLength() /
|
||||
GetAxisScale(aDragMetrics.mDirection, mFrameMetrics.GetZoom()) *
|
||||
mFrameMetrics.GetPresShellResolution();
|
||||
|
||||
@ -929,8 +933,8 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
|
||||
CSSCoord minScrollPosition =
|
||||
GetAxisStart(aDragMetrics.mDirection, mFrameMetrics.GetScrollableRect().TopLeft());
|
||||
CSSCoord maxScrollPosition =
|
||||
GetAxisSize(aDragMetrics.mDirection, mFrameMetrics.GetScrollableRect()) -
|
||||
GetAxisSize(aDragMetrics.mDirection, cssCompositionBound);
|
||||
GetAxisLength(aDragMetrics.mDirection, mFrameMetrics.GetScrollableRect()) -
|
||||
GetAxisLength(aDragMetrics.mDirection, cssCompositionBound);
|
||||
CSSCoord scrollPosition = scrollPercent * maxScrollPosition;
|
||||
|
||||
scrollPosition = std::max(scrollPosition, minScrollPosition);
|
||||
|
@ -27,7 +27,7 @@ HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc,
|
||||
, mLayersId(aLayersId)
|
||||
, mScrollViewId(FrameMetrics::NULL_SCROLL_ID)
|
||||
, mScrollDir(Layer::NONE)
|
||||
, mScrollSize(0)
|
||||
, mScrollThumbLength(0)
|
||||
, mIsScrollbarContainer(false)
|
||||
, mFixedPosTarget(FrameMetrics::NULL_SCROLL_ID)
|
||||
, mOverride(EventRegionsOverride::NoOverride)
|
||||
@ -96,12 +96,12 @@ HitTestingTreeNode::SetLastChild(HitTestingTreeNode* aChild)
|
||||
void
|
||||
HitTestingTreeNode::SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
|
||||
Layer::ScrollDirection aDir,
|
||||
int32_t aScrollSize,
|
||||
int32_t aScrollThumbLength,
|
||||
bool aIsScrollContainer)
|
||||
{
|
||||
mScrollViewId = aScrollViewId;
|
||||
mScrollDir = aDir;
|
||||
mScrollSize = aScrollSize;;
|
||||
mScrollThumbLength = aScrollThumbLength;
|
||||
mIsScrollbarContainer = aIsScrollContainer;
|
||||
}
|
||||
|
||||
@ -115,10 +115,10 @@ HitTestingTreeNode::MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetric
|
||||
mScrollViewId == aDragMetrics.mViewId;
|
||||
}
|
||||
|
||||
int32_t
|
||||
HitTestingTreeNode::GetScrollSize() const
|
||||
LayerIntCoord
|
||||
HitTestingTreeNode::GetScrollThumbLength() const
|
||||
{
|
||||
return mScrollSize;
|
||||
return mScrollThumbLength;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -93,10 +93,10 @@ public:
|
||||
|
||||
void SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
|
||||
Layer::ScrollDirection aDir,
|
||||
int32_t aScrollSize,
|
||||
int32_t aScrollThumbLength,
|
||||
bool aIsScrollContainer);
|
||||
bool MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetrics) const;
|
||||
int32_t GetScrollSize() const;
|
||||
LayerIntCoord GetScrollThumbLength() const;
|
||||
bool IsScrollbarNode() const;
|
||||
|
||||
/* Fixed pos info */
|
||||
@ -130,7 +130,7 @@ private:
|
||||
|
||||
FrameMetrics::ViewID mScrollViewId;
|
||||
Layer::ScrollDirection mScrollDir;
|
||||
int32_t mScrollSize;
|
||||
int32_t mScrollThumbLength;
|
||||
bool mIsScrollbarContainer;
|
||||
|
||||
FrameMetrics::ViewID mFixedPosTarget;
|
||||
|
@ -2197,11 +2197,10 @@ class BaseCompiler
|
||||
JitStackAlignment);
|
||||
}
|
||||
|
||||
void endCall(FunctionCall& call)
|
||||
void endCall(FunctionCall& call, size_t stackSpace)
|
||||
{
|
||||
size_t adjustment = call.stackArgAreaSize + call.frameAlignAdjustment;
|
||||
if (adjustment)
|
||||
masm.freeStack(adjustment);
|
||||
masm.freeStack(stackSpace + adjustment);
|
||||
|
||||
if (call.reloadMachineStateAfter) {
|
||||
loadFromFramePtr(WasmTlsReg, frameOffsetFromSlot(tlsSlot_, MIRType::Pointer));
|
||||
@ -5744,13 +5743,9 @@ BaseCompiler::emitCall()
|
||||
else
|
||||
callDefinition(funcIndex, baselineCall);
|
||||
|
||||
endCall(baselineCall);
|
||||
|
||||
// TODO / OPTIMIZE (bug 1316827): It would be better to merge this
|
||||
// freeStack() into the one in endCall, if we can.
|
||||
endCall(baselineCall, stackSpace);
|
||||
|
||||
popValueStackBy(numArgs);
|
||||
masm.freeStack(stackSpace);
|
||||
|
||||
if (!IsVoid(sig.ret()))
|
||||
pushReturned(baselineCall, sig.ret());
|
||||
@ -5798,28 +5793,21 @@ BaseCompiler::emitCallIndirect(bool oldStyle)
|
||||
if (!emitCallArgs(sig.args(), baselineCall))
|
||||
return false;
|
||||
|
||||
if (oldStyle) {
|
||||
if (!iter_.readOldCallIndirectCallee(&callee_))
|
||||
return false;
|
||||
}
|
||||
if (oldStyle && !iter_.readOldCallIndirectCallee(&callee_))
|
||||
return false;
|
||||
|
||||
if (!iter_.readCallReturn(sig.ret()))
|
||||
return false;
|
||||
|
||||
callIndirect(sigIndex, callee, baselineCall);
|
||||
|
||||
endCall(baselineCall);
|
||||
endCall(baselineCall, stackSpace);
|
||||
|
||||
// For new style calls, the callee was popped off the compiler's
|
||||
// stack above.
|
||||
|
||||
popValueStackBy(oldStyle ? numArgs + 1 : numArgs);
|
||||
|
||||
// TODO / OPTIMIZE (bug 1316827): It would be better to merge this
|
||||
// freeStack() into the one in endCall, if we can.
|
||||
|
||||
masm.freeStack(stackSpace);
|
||||
|
||||
if (!IsVoid(sig.ret()))
|
||||
pushReturned(baselineCall, sig.ret());
|
||||
|
||||
@ -5846,13 +5834,9 @@ BaseCompiler::emitCommonMathCall(uint32_t lineOrBytecode, SymbolicAddress callee
|
||||
|
||||
builtinCall(callee, baselineCall);
|
||||
|
||||
endCall(baselineCall);
|
||||
|
||||
// TODO / OPTIMIZE (bug 1316827): It would be better to merge this
|
||||
// freeStack() into the one in endCall, if we can.
|
||||
endCall(baselineCall, stackSpace);
|
||||
|
||||
popValueStackBy(numArgs);
|
||||
masm.freeStack(stackSpace);
|
||||
|
||||
pushReturned(baselineCall, retType);
|
||||
|
||||
@ -6650,10 +6634,9 @@ BaseCompiler::emitGrowMemory()
|
||||
startCallArgs(baselineCall, stackArgAreaSize(SigI_));
|
||||
passArg(baselineCall, ValType::I32, peek(0));
|
||||
builtinInstanceMethodCall(SymbolicAddress::GrowMemory, instanceArg, baselineCall);
|
||||
endCall(baselineCall);
|
||||
endCall(baselineCall, stackSpace);
|
||||
|
||||
popValueStackBy(numArgs);
|
||||
masm.freeStack(stackSpace);
|
||||
|
||||
pushReturned(baselineCall, ExprType::I32);
|
||||
|
||||
@ -6680,7 +6663,7 @@ BaseCompiler::emitCurrentMemory()
|
||||
|
||||
startCallArgs(baselineCall, stackArgAreaSize(Sig_));
|
||||
builtinInstanceMethodCall(SymbolicAddress::CurrentMemory, instanceArg, baselineCall);
|
||||
endCall(baselineCall);
|
||||
endCall(baselineCall, 0);
|
||||
|
||||
pushReturned(baselineCall, ExprType::I32);
|
||||
|
||||
|
@ -5,12 +5,13 @@
|
||||
|
||||
import string
|
||||
|
||||
from marionette.marionette_test import (
|
||||
MarionetteTestCase, parameterized
|
||||
)
|
||||
from marionette_driver.by import By
|
||||
from marionette_driver.marionette import Actions
|
||||
from marionette_driver.selection import SelectionManager
|
||||
from marionette_harness.marionette_test import (
|
||||
MarionetteTestCase,
|
||||
parameterized,
|
||||
)
|
||||
|
||||
|
||||
class AccessibleCaretCursorModeTestCase(MarionetteTestCase):
|
||||
|
@ -5,12 +5,14 @@
|
||||
|
||||
import re
|
||||
|
||||
from marionette.marionette_test import (
|
||||
MarionetteTestCase, SkipTest, parameterized
|
||||
)
|
||||
from marionette_driver.by import By
|
||||
from marionette_driver.marionette import Actions
|
||||
from marionette_driver.selection import SelectionManager
|
||||
from marionette_harness.marionette_test import (
|
||||
MarionetteTestCase,
|
||||
SkipTest,
|
||||
parameterized
|
||||
)
|
||||
|
||||
|
||||
def skip_if_not_rotatable(target):
|
||||
|
@ -35,8 +35,8 @@ from mozrunner.utils import get_stack_fixer_function, test_environment
|
||||
from mozscreenshot import printstatus, dump_screen
|
||||
|
||||
try:
|
||||
from marionette import Marionette
|
||||
from marionette_driver.addons import Addons
|
||||
from marionette_harness import Marionette
|
||||
except ImportError, e:
|
||||
# Defer ImportError until attempt to use Marionette
|
||||
def reraise(*args, **kwargs):
|
||||
|
@ -21,8 +21,9 @@ from remotereftest import RemoteReftestResolver, ReftestServer
|
||||
from runreftest import RefTest
|
||||
import reftestcommandline
|
||||
|
||||
from marionette_harness import Marionette
|
||||
from mozdevice import DeviceManagerADB, DMError
|
||||
from marionette import Marionette
|
||||
|
||||
|
||||
class ProfileConfigParser(ConfigParser.RawConfigParser):
|
||||
"""Subclass of RawConfigParser that outputs .ini files in the exact
|
||||
|
@ -936,16 +936,21 @@ nsSliderFrame::StartAPZDrag()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsContainerFrame* cf = GetScrollbar()->GetParent();
|
||||
if (!cf) {
|
||||
nsContainerFrame* scrollFrame = GetScrollbar()->GetParent();
|
||||
if (!scrollFrame) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIContent* scrollableContent = cf->GetContent();
|
||||
nsIContent* scrollableContent = scrollFrame->GetContent();
|
||||
if (!scrollableContent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIScrollableFrame* scrollFrameAsScrollable = do_QueryFrame(scrollFrame);
|
||||
if (!scrollFrameAsScrollable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mozilla::layers::FrameMetrics::ViewID scrollTargetId;
|
||||
bool hasID = nsLayoutUtils::FindIDFor(scrollableContent, &scrollTargetId);
|
||||
bool hasAPZView = hasID && (scrollTargetId != layers::FrameMetrics::NULL_SCROLL_ID);
|
||||
@ -957,14 +962,18 @@ nsSliderFrame::StartAPZDrag()
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
nsCOMPtr<nsIContent> scrollbar = GetContentOfBox(scrollbarBox);
|
||||
|
||||
nsRect sliderTrack;
|
||||
GetXULClientRect(sliderTrack);
|
||||
|
||||
// This rect is the range in which the scroll thumb can slide in.
|
||||
nsRect sliderTrack = GetRect() - scrollbarBox->GetPosition();
|
||||
CSSIntRect sliderTrackCSS = CSSIntRect::FromAppUnitsRounded(sliderTrack);
|
||||
sliderTrack = sliderTrack + GetRect().TopLeft() + scrollbarBox->GetPosition() -
|
||||
scrollFrameAsScrollable->GetScrollPortRect().TopLeft();
|
||||
CSSRect sliderTrackCSS = CSSRect::FromAppUnits(sliderTrack);
|
||||
|
||||
uint64_t inputblockId = InputAPZContext::GetInputBlockId();
|
||||
uint32_t presShellId = PresContext()->PresShell()->GetPresShellId();
|
||||
AsyncDragMetrics dragMetrics(scrollTargetId, presShellId, inputblockId,
|
||||
NSAppUnitsToIntPixels(mDragStart,
|
||||
NSAppUnitsToFloatPixels(mDragStart,
|
||||
float(AppUnitsPerCSSPixel())),
|
||||
sliderTrackCSS,
|
||||
IsXULHorizontal() ? AsyncDragMetrics::HORIZONTAL :
|
||||
|
@ -263,6 +263,7 @@ public abstract class HomeFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "home_add_to_launcher");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class ActivityStream extends FrameLayout {
|
||||
|
||||
adapter = new StreamRecyclerAdapter();
|
||||
|
||||
RecyclerView rv = (RecyclerView) findViewById(R.id.activity_stream_main_recyclerview);
|
||||
final RecyclerView rv = (RecyclerView) findViewById(R.id.activity_stream_main_recyclerview);
|
||||
|
||||
rv.setAdapter(adapter);
|
||||
rv.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
@ -4,6 +4,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
package org.mozilla.gecko.home.activitystream;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
@ -13,9 +15,12 @@ import android.text.TextUtils;
|
||||
import android.text.format.DateUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.mozilla.gecko.GeckoSharedPrefs;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.activitystream.ActivityStream.LabelCallback;
|
||||
import org.mozilla.gecko.db.BrowserContract;
|
||||
@ -43,11 +48,59 @@ public abstract class StreamItem extends RecyclerView.ViewHolder {
|
||||
public static class HighlightsTitle extends StreamItem {
|
||||
public static final int LAYOUT_ID = R.layout.activity_stream_main_highlightstitle;
|
||||
|
||||
public HighlightsTitle(View itemView) {
|
||||
public HighlightsTitle(final View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
|
||||
public static class WelcomePanel
|
||||
extends StreamItem
|
||||
implements View.OnClickListener {
|
||||
public static final int LAYOUT_ID = R.layout.activity_stream_main_welcomepanel;
|
||||
|
||||
public static final String PREF_WELCOME_DISMISSED = "activitystream.welcome_dismissed";
|
||||
|
||||
private final RecyclerView.Adapter<StreamItem> adapter;
|
||||
private final Context context;
|
||||
|
||||
public WelcomePanel(final View itemView, final RecyclerView.Adapter<StreamItem> adapter) {
|
||||
super(itemView);
|
||||
|
||||
this.adapter = adapter;
|
||||
this.context = itemView.getContext();
|
||||
|
||||
final SharedPreferences sharedPrefs = GeckoSharedPrefs.forApp(itemView.getContext());
|
||||
|
||||
if (!sharedPrefs.getBoolean(PREF_WELCOME_DISMISSED, false)) {
|
||||
final ViewStub welcomePanelStub = (ViewStub) itemView.findViewById(R.id.welcomepanel_stub);
|
||||
|
||||
welcomePanelStub.inflate();
|
||||
|
||||
final Button dismissButton = (Button) itemView.findViewById(R.id.dismiss_welcomepanel);
|
||||
|
||||
dismissButton.setOnClickListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// To animate between item changes, RecyclerView keeps around the old version of the view,
|
||||
// and creates a new equivalent item (which is bound using the new data) - followed by
|
||||
// animating between those two versions. Hence we just need to make sure that
|
||||
// any future calls to onCreateViewHolder create a version of the Header Item
|
||||
// with the welcome panel hidden (i.e. we don't need to care about animations ourselves).
|
||||
// We communicate this state change via the pref.
|
||||
|
||||
final SharedPreferences sharedPrefs = GeckoSharedPrefs.forApp(context);
|
||||
|
||||
sharedPrefs.edit()
|
||||
.putBoolean(WelcomePanel.PREF_WELCOME_DISMISSED, true)
|
||||
.apply();
|
||||
|
||||
adapter.notifyItemChanged(getAdapterPosition());
|
||||
}
|
||||
}
|
||||
|
||||
public static class TopPanel extends StreamItem {
|
||||
public static final int LAYOUT_ID = R.layout.activity_stream_main_toppanel;
|
||||
|
||||
|
@ -16,6 +16,8 @@ import org.mozilla.gecko.TelemetryContract;
|
||||
import org.mozilla.gecko.db.BrowserContract;
|
||||
import org.mozilla.gecko.home.HomePager;
|
||||
import org.mozilla.gecko.home.activitystream.StreamItem.HighlightItem;
|
||||
import org.mozilla.gecko.home.activitystream.StreamItem.WelcomePanel;
|
||||
import org.mozilla.gecko.home.activitystream.StreamItem.HighlightsTitle;
|
||||
import org.mozilla.gecko.home.activitystream.StreamItem.TopPanel;
|
||||
import org.mozilla.gecko.widget.RecyclerViewClickSupport;
|
||||
|
||||
@ -32,6 +34,10 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
||||
private int tilesWidth;
|
||||
private int tilesHeight;
|
||||
|
||||
public StreamRecyclerAdapter() {
|
||||
setHasStableIds(true);
|
||||
}
|
||||
|
||||
void setOnUrlOpenListeners(HomePager.OnUrlOpenListener onUrlOpenListener, HomePager.OnUrlOpenInBackgroundListener onUrlOpenInBackgroundListener) {
|
||||
this.onUrlOpenListener = onUrlOpenListener;
|
||||
this.onUrlOpenInBackgroundListener = onUrlOpenInBackgroundListener;
|
||||
@ -50,7 +56,9 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
||||
if (position == 0) {
|
||||
return TopPanel.LAYOUT_ID;
|
||||
} else if (position == 1) {
|
||||
return StreamItem.HighlightsTitle.LAYOUT_ID;
|
||||
return WelcomePanel.LAYOUT_ID;
|
||||
} else if (position == 2) {
|
||||
return HighlightsTitle.LAYOUT_ID;
|
||||
} else if (position < getItemCount()) {
|
||||
return HighlightItem.LAYOUT_ID;
|
||||
} else {
|
||||
@ -64,10 +72,12 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
||||
|
||||
if (type == TopPanel.LAYOUT_ID) {
|
||||
return new TopPanel(inflater.inflate(type, parent, false), onUrlOpenListener, onUrlOpenInBackgroundListener);
|
||||
} else if (type == StreamItem.HighlightsTitle.LAYOUT_ID) {
|
||||
return new StreamItem.HighlightsTitle(inflater.inflate(type, parent, false));
|
||||
} else if (type == WelcomePanel.LAYOUT_ID) {
|
||||
return new WelcomePanel(inflater.inflate(type, parent, false), this);
|
||||
} else if (type == HighlightItem.LAYOUT_ID) {
|
||||
return new HighlightItem(inflater.inflate(type, parent, false), onUrlOpenListener, onUrlOpenInBackgroundListener);
|
||||
} else if (type == HighlightsTitle.LAYOUT_ID) {
|
||||
return new HighlightsTitle(inflater.inflate(type, parent, false));
|
||||
} else {
|
||||
throw new IllegalStateException("Missing inflation for ViewType " + type);
|
||||
}
|
||||
@ -78,8 +88,8 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
||||
throw new IllegalArgumentException("Requested cursor position for invalid item");
|
||||
}
|
||||
|
||||
// We have two blank panels at the top, hence remove that to obtain the cursor position
|
||||
return position - 2;
|
||||
// We have three blank panels at the top, hence remove that to obtain the cursor position
|
||||
return position - 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -124,7 +134,7 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
||||
highlightsCount = 0;
|
||||
}
|
||||
|
||||
return highlightsCount + 2;
|
||||
return highlightsCount + 3;
|
||||
}
|
||||
|
||||
public void swapHighlightsCursor(Cursor cursor) {
|
||||
@ -138,4 +148,47 @@ public class StreamRecyclerAdapter extends RecyclerView.Adapter<StreamItem> impl
|
||||
|
||||
notifyItemChanged(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
final int type = getItemViewType(position);
|
||||
|
||||
// To avoid having clashing IDs, we:
|
||||
// - use history ID's as is
|
||||
// - use hardcoded negative ID's for fixed panels
|
||||
// - multiply bookmark ID's by -1 to not clash with history, and add an offset to not
|
||||
// clash with the fixed panels above
|
||||
final int offset = -10;
|
||||
|
||||
// RecyclerView.NO_ID is -1, so start our hard-coded IDs at -2.
|
||||
switch (type) {
|
||||
case TopPanel.LAYOUT_ID:
|
||||
return -2;
|
||||
case WelcomePanel.LAYOUT_ID:
|
||||
return -3;
|
||||
case HighlightsTitle.LAYOUT_ID:
|
||||
return -4;
|
||||
case HighlightItem.LAYOUT_ID:
|
||||
final int cursorPosition = translatePositionToCursor(position);
|
||||
highlightsCursor.moveToPosition(cursorPosition);
|
||||
|
||||
final long historyID = highlightsCursor.getLong(highlightsCursor.getColumnIndexOrThrow(BrowserContract.Combined.HISTORY_ID));
|
||||
final boolean isHistory = -1 != historyID;
|
||||
|
||||
if (isHistory) {
|
||||
return historyID;
|
||||
}
|
||||
|
||||
final long bookmarkID = highlightsCursor.getLong(highlightsCursor.getColumnIndexOrThrow(BrowserContract.Combined.BOOKMARK_ID));
|
||||
final boolean isBookmark = -1 != bookmarkID;
|
||||
|
||||
if (isBookmark) {
|
||||
return -1 * bookmarkID + offset;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unhandled highlight type in getItemId - has no history or bookmark ID");
|
||||
default:
|
||||
throw new IllegalArgumentException("StreamItem with LAYOUT_ID=" + type + " not handled in getItemId()");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import org.mozilla.gecko.TelemetryContract;
|
||||
import org.mozilla.gecko.annotation.RobocopTarget;
|
||||
import org.mozilla.gecko.db.BrowserDB;
|
||||
import org.mozilla.gecko.home.HomePager;
|
||||
import org.mozilla.gecko.reader.SavedReaderViewHelper;
|
||||
import org.mozilla.gecko.util.Clipboard;
|
||||
import org.mozilla.gecko.util.HardwareUtils;
|
||||
import org.mozilla.gecko.util.ThreadUtils;
|
||||
@ -153,12 +154,31 @@ public abstract class ActivityStreamContextMenu
|
||||
public void run() {
|
||||
final BrowserDB db = BrowserDB.from(context);
|
||||
|
||||
final TelemetryContract.Event telemetryEvent;
|
||||
final String telemetryExtra;
|
||||
if (isAlreadyBookmarked) {
|
||||
db.removeBookmarksWithURL(context.getContentResolver(), url);
|
||||
|
||||
SavedReaderViewHelper rch = SavedReaderViewHelper.getSavedReaderViewHelper(context);
|
||||
final boolean isReaderViewPage = rch.isURLCached(url);
|
||||
|
||||
telemetryEvent = TelemetryContract.Event.UNSAVE;
|
||||
|
||||
if (isReaderViewPage) {
|
||||
telemetryExtra = "as_bookmark_reader";
|
||||
} else {
|
||||
telemetryExtra = "as_bookmark";
|
||||
}
|
||||
} else {
|
||||
// We only store raw URLs in history (and bookmarks), hence we won't ever show about:reader
|
||||
// URLs in AS topsites or highlights. Therefore we don't need to do any special about:reader handling here.
|
||||
db.addBookmark(context.getContentResolver(), title, url);
|
||||
|
||||
telemetryEvent = TelemetryContract.Event.SAVE;
|
||||
telemetryExtra = "as_bookmark";
|
||||
}
|
||||
|
||||
Telemetry.sendUIEvent(telemetryEvent, TelemetryContract.Method.CONTEXT_MENU, telemetryExtra);
|
||||
}
|
||||
});
|
||||
break;
|
||||
@ -169,6 +189,8 @@ public abstract class ActivityStreamContextMenu
|
||||
|
||||
case R.id.add_homescreen:
|
||||
GeckoAppShell.createShortcut(title, url);
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "as_add_to_launcher");
|
||||
break;
|
||||
|
||||
case R.id.open_new_tab:
|
||||
|
@ -72,9 +72,7 @@ public final class CodecProxy {
|
||||
public void onOutput(Sample sample) throws RemoteException {
|
||||
if (mOutputSurface != null) {
|
||||
// Don't render to surface just yet. Callback will make that happen when it's time.
|
||||
if (!sample.isEOS() || sample.info.size > 0) {
|
||||
mSurfaceOutputs.offer(sample);
|
||||
}
|
||||
mSurfaceOutputs.offer(sample);
|
||||
mCallbacks.onOutput(sample);
|
||||
} else {
|
||||
// Non-surface output needs no rendering.
|
||||
|
@ -851,3 +851,6 @@ and allows hiding a URL/page from highlights or topsites. The page remains in hi
|
||||
is simply hidden from the Activity Stream panel. -->
|
||||
<!ENTITY activity_stream_dismiss "Dismiss">
|
||||
<!ENTITY activity_stream_delete_history "Delete from History">
|
||||
|
||||
<!ENTITY activity_stream_welcome_title "Welcome to your Highlights">
|
||||
<!ENTITY activity_stream_welcome_content "Firefox now creates highlights of things you\'ve discovered on the web so you can find your way back to great articles, videos, bookmarks, and other pages.">
|
||||
|
BIN
mobile/android/base/resources/drawable-hdpi/foxfinder.webp
Normal file
After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
mobile/android/base/resources/drawable-nodpi/firstrun_sync.webp
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 9.9 KiB |
BIN
mobile/android/base/resources/drawable-xhdpi/foxfinder.webp
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
mobile/android/base/resources/drawable-xxhdpi/foxfinder.webp
Normal file
After Width: | Height: | Size: 16 KiB |
@ -3,8 +3,9 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:id="@+id/divider1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:padding="4dp"
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Viewstub requires a parent (since inflation involves removing the stub and replacing it with
|
||||
the new layout, hence we need this empty framelayout (we don't attach the welcomepanel
|
||||
to it's enclosing RecyclerView until after inflation - otherwise this issue wouldn't exist).
|
||||
In this case, we need a FrameLayout for animations to work correctly, it would originally have lived
|
||||
within welcomepanel_content, but this placing it here is just as good. -->
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ViewStub android:id="@+id/welcomepanel_stub"
|
||||
android:layout="@layout/activity_stream_main_welcomepanel_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</FrameLayout>
|
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- We need an enclosing layout for the animation calculations to work correctly. This is provided
|
||||
in the enclosing layout which wraps the ViewStub in a FrameLayout. -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/welcome_panel"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:id="@+id/divider0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="#ffe0e0e0"
|
||||
android:padding="4dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/welcome_fox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginBottom="@dimen/activity_stream_base_margin"
|
||||
android:layout_marginLeft="-30dp"
|
||||
android:layout_marginTop="@dimen/activity_stream_base_margin"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/foxfinder"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_welcome"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/activity_stream_base_margin"
|
||||
android:layout_marginEnd="@dimen/activity_stream_base_margin"
|
||||
android:layout_marginLeft="@dimen/activity_stream_base_margin"
|
||||
android:layout_marginRight="@dimen/activity_stream_base_margin"
|
||||
android:layout_marginStart="@dimen/activity_stream_base_margin"
|
||||
android:layout_marginTop="@dimen/activity_stream_base_margin"
|
||||
android:text="@string/activity_stream_welcome_title"
|
||||
android:textColor="#FF858585"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/welcome_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/title_welcome"
|
||||
android:layout_alignStart="@+id/title_welcome"
|
||||
android:layout_below="@+id/title_welcome"
|
||||
android:layout_toLeftOf="@+id/welcome_fox"
|
||||
android:layout_toStartOf="@+id/welcome_fox"
|
||||
android:text="@string/activity_stream_welcome_content"
|
||||
android:textColor="#FF858585"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/dismiss_welcomepanel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/welcome_fox"
|
||||
android:layout_alignLeft="@+id/title_welcome"
|
||||
android:layout_alignStart="@+id/title_welcome"
|
||||
android:elevation="1dp"
|
||||
android:text="@string/activity_stream_dismiss"
|
||||
android:theme="@style/ActivityStreamButton"/>
|
||||
|
||||
</RelativeLayout>
|
@ -763,4 +763,9 @@
|
||||
<item name="android:listDivider">@drawable/as_contextmenu_divider</item>
|
||||
</style>
|
||||
|
||||
<style name="ActivityStreamButton" parent="Widget.AppCompat.Button.Colored">
|
||||
<item name="colorButtonNormal">@color/link_blue</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
@ -639,4 +639,7 @@
|
||||
<string name="activity_stream_highlight_label_visited">&activity_stream_highlight_label_visited;</string>
|
||||
<string name="activity_stream_dismiss">&activity_stream_dismiss;</string>
|
||||
<string name="activity_stream_delete_history">&activity_stream_delete_history;</string>
|
||||
|
||||
<string name="activity_stream_welcome_title">&activity_stream_welcome_title;</string>
|
||||
<string name="activity_stream_welcome_content">&activity_stream_welcome_content;</string>
|
||||
</resources>
|
||||
|
@ -63,7 +63,7 @@ var InputWidgetHelper = {
|
||||
},
|
||||
|
||||
hasInputWidget: function(aElement) {
|
||||
if (!aElement instanceof HTMLInputElement)
|
||||
if (!(aElement instanceof HTMLInputElement))
|
||||
return false;
|
||||
|
||||
let type = aElement.getAttribute('type');
|
||||
|
@ -12,7 +12,6 @@ pref("security.ssl.treat_unsafe_negotiation_as_broken", false);
|
||||
pref("security.ssl.require_safe_negotiation", false);
|
||||
pref("security.ssl.enable_ocsp_stapling", true);
|
||||
pref("security.ssl.enable_false_start", true);
|
||||
pref("security.ssl.false_start.require-npn", false);
|
||||
pref("security.ssl.enable_alpn", true);
|
||||
|
||||
pref("security.ssl3.ecdhe_rsa_aes_128_gcm_sha256", true);
|
||||
|
@ -105,8 +105,8 @@ ARCHIVE_FILES = {
|
||||
],
|
||||
'dest': 'marionette',
|
||||
'ignore': [
|
||||
'harness/docs',
|
||||
'harness/marionette/tests',
|
||||
'client/docs',
|
||||
'harness/marionette_harness/tests',
|
||||
'puppeteer/firefox/docs',
|
||||
],
|
||||
},
|
||||
@ -114,11 +114,11 @@ ARCHIVE_FILES = {
|
||||
'source': buildconfig.topsrcdir,
|
||||
'base': '',
|
||||
'manifests': [
|
||||
'testing/marionette/harness/marionette/tests/unit-tests.ini',
|
||||
'testing/marionette/harness/marionette/tests/webapi-tests.ini',
|
||||
'testing/marionette/harness/marionette_harness/tests/unit-tests.ini',
|
||||
'testing/marionette/harness/marionette_harness/tests/webapi-tests.ini',
|
||||
],
|
||||
# We also need the manifests and harness_unit tests
|
||||
'pattern': 'testing/marionette/harness/marionette/tests/**',
|
||||
'pattern': 'testing/marionette/harness/marionette_harness/tests/**',
|
||||
'dest': 'marionette/tests',
|
||||
},
|
||||
{
|
||||
|
@ -131,9 +131,6 @@ module.exports = { // eslint-disable-line no-undef
|
||||
// No reassigning native JS objects
|
||||
"no-native-reassign": "error",
|
||||
|
||||
// No (!foo in bar)
|
||||
"no-negated-in-lhs": "error",
|
||||
|
||||
// Nested ternary statements are confusing
|
||||
"no-nested-ternary": "error",
|
||||
|
||||
|
@ -48,7 +48,6 @@ namespace {
|
||||
// Bits in bit mask for SSL_REASONS_FOR_NOT_FALSE_STARTING telemetry probe
|
||||
// These bits are numbered so that the least subtle issues have higher values.
|
||||
// This should make it easier for us to interpret the results.
|
||||
const uint32_t NPN_NOT_NEGOTIATED = 64;
|
||||
const uint32_t POSSIBLE_VERSION_DOWNGRADE = 4;
|
||||
const uint32_t POSSIBLE_CIPHER_SUITE_DOWNGRADE = 2;
|
||||
const uint32_t KEA_NOT_SUPPORTED = 1;
|
||||
@ -947,8 +946,6 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart)
|
||||
return SECSuccess;
|
||||
}
|
||||
|
||||
nsSSLIOLayerHelpers& helpers = infoObject->SharedState().IOLayerHelpers();
|
||||
|
||||
// Prevent version downgrade attacks from TLS 1.2, and avoid False Start for
|
||||
// TLS 1.3 and later. See Bug 861310 for all the details as to why.
|
||||
if (channelInfo.protocolVersion != SSL_LIBRARY_VERSION_TLS_1_2) {
|
||||
@ -983,18 +980,6 @@ CanFalseStartCallback(PRFileDesc* fd, void* client_data, PRBool *canFalseStart)
|
||||
// to the same protocol we previously saw for the server, after the
|
||||
// first successful connection to the server.
|
||||
|
||||
// Enforce NPN to do false start if policy requires it. Do this as an
|
||||
// indicator if server compatibility.
|
||||
if (helpers.mFalseStartRequireNPN) {
|
||||
nsAutoCString negotiatedNPN;
|
||||
if (NS_FAILED(infoObject->GetNegotiatedNPN(negotiatedNPN)) ||
|
||||
!negotiatedNPN.Length()) {
|
||||
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("CanFalseStartCallback [%p] failed - "
|
||||
"NPN cannot be verified\n", fd));
|
||||
reasonsForNotFalseStarting |= NPN_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
Telemetry::Accumulate(Telemetry::SSL_REASONS_FOR_NOT_FALSE_STARTING,
|
||||
reasonsForNotFalseStarting);
|
||||
|
||||
|
@ -70,13 +70,6 @@ getSiteKey(const nsACString& hostName, uint16_t port,
|
||||
key.AppendInt(port);
|
||||
}
|
||||
|
||||
// Historically, we have required that the server negotiate ALPN or NPN in
|
||||
// order to false start, as a compatibility hack to work around
|
||||
// implementations that just stop responding during false start. However, now
|
||||
// false start is resricted to modern crypto (TLS 1.2 and AEAD cipher suites)
|
||||
// so it is less likely that requring NPN or ALPN is still necessary.
|
||||
static const bool FALSE_START_REQUIRE_NPN_DEFAULT = false;
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
extern LazyLogModule gPIPNSSLog;
|
||||
@ -1291,7 +1284,6 @@ nsSSLIOLayerPoll(PRFileDesc* fd, int16_t in_flags, int16_t* out_flags)
|
||||
nsSSLIOLayerHelpers::nsSSLIOLayerHelpers()
|
||||
: mTreatUnsafeNegotiationAsBroken(false)
|
||||
, mTLSIntoleranceInfo()
|
||||
, mFalseStartRequireNPN(false)
|
||||
, mVersionFallbackLimit(SSL_LIBRARY_VERSION_TLS_1_0)
|
||||
, mutex("nsSSLIOLayerHelpers.mutex")
|
||||
{
|
||||
@ -1501,10 +1493,6 @@ PrefObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
bool enabled;
|
||||
Preferences::GetBool("security.ssl.treat_unsafe_negotiation_as_broken", &enabled);
|
||||
mOwner->setTreatUnsafeNegotiationAsBroken(enabled);
|
||||
} else if (prefName.EqualsLiteral("security.ssl.false_start.require-npn")) {
|
||||
mOwner->mFalseStartRequireNPN =
|
||||
Preferences::GetBool("security.ssl.false_start.require-npn",
|
||||
FALSE_START_REQUIRE_NPN_DEFAULT);
|
||||
} else if (prefName.EqualsLiteral("security.tls.version.fallback-limit")) {
|
||||
mOwner->loadVersionFallbackLimit();
|
||||
} else if (prefName.EqualsLiteral("security.tls.insecure_fallback_hosts")) {
|
||||
@ -1543,8 +1531,6 @@ nsSSLIOLayerHelpers::~nsSSLIOLayerHelpers()
|
||||
if (mPrefObserver) {
|
||||
Preferences::RemoveObserver(mPrefObserver,
|
||||
"security.ssl.treat_unsafe_negotiation_as_broken");
|
||||
Preferences::RemoveObserver(mPrefObserver,
|
||||
"security.ssl.false_start.require-npn");
|
||||
Preferences::RemoveObserver(mPrefObserver,
|
||||
"security.tls.version.fallback-limit");
|
||||
Preferences::RemoveObserver(mPrefObserver,
|
||||
@ -1601,17 +1587,12 @@ nsSSLIOLayerHelpers::Init()
|
||||
Preferences::GetBool("security.ssl.treat_unsafe_negotiation_as_broken", &enabled);
|
||||
setTreatUnsafeNegotiationAsBroken(enabled);
|
||||
|
||||
mFalseStartRequireNPN =
|
||||
Preferences::GetBool("security.ssl.false_start.require-npn",
|
||||
FALSE_START_REQUIRE_NPN_DEFAULT);
|
||||
loadVersionFallbackLimit();
|
||||
initInsecureFallbackSites();
|
||||
|
||||
mPrefObserver = new PrefObserver(this);
|
||||
Preferences::AddStrongObserver(mPrefObserver,
|
||||
"security.ssl.treat_unsafe_negotiation_as_broken");
|
||||
Preferences::AddStrongObserver(mPrefObserver,
|
||||
"security.ssl.false_start.require-npn");
|
||||
Preferences::AddStrongObserver(mPrefObserver,
|
||||
"security.tls.version.fallback-limit");
|
||||
Preferences::AddStrongObserver(mPrefObserver,
|
||||
|
@ -218,7 +218,6 @@ public:
|
||||
void removeInsecureFallbackSite(const nsACString& hostname, uint16_t port);
|
||||
bool isInsecureFallbackSite(const nsACString& hostname);
|
||||
|
||||
bool mFalseStartRequireNPN;
|
||||
uint16_t mVersionFallbackLimit;
|
||||
private:
|
||||
mozilla::Mutex mutex;
|
||||
|
@ -89,7 +89,7 @@ this.FxAccountsProfileClient.prototype = {
|
||||
try {
|
||||
return (yield this._rawRequest(path, method, token));
|
||||
} catch (ex) {
|
||||
if (!ex instanceof FxAccountsProfileClientError || ex.code != 401) {
|
||||
if (!(ex instanceof FxAccountsProfileClientError) || ex.code != 401) {
|
||||
throw ex;
|
||||
}
|
||||
// If this object was instantiated with a token then we don't refresh it.
|
||||
@ -105,7 +105,7 @@ this.FxAccountsProfileClient.prototype = {
|
||||
try {
|
||||
return (yield this._rawRequest(path, method, token));
|
||||
} catch (ex) {
|
||||
if (!ex instanceof FxAccountsProfileClientError || ex.code != 401) {
|
||||
if (!(ex instanceof FxAccountsProfileClientError) || ex.code != 401) {
|
||||
throw ex;
|
||||
}
|
||||
log.info("Retry fetching the profile still returned a 401 - revoking our token and failing");
|
||||
|
@ -403,7 +403,7 @@ this.FxAccountsStorageManager.prototype = {
|
||||
try {
|
||||
yield this.secureStorage.set(this.cachedPlain.uid, toWriteSecure);
|
||||
} catch (ex) {
|
||||
if (!ex instanceof this.secureStorage.STORAGE_LOCKED) {
|
||||
if (!(ex instanceof this.secureStorage.STORAGE_LOCKED)) {
|
||||
throw ex;
|
||||
}
|
||||
// This shouldn't be possible as once it is unlocked it can't be
|
||||
|
@ -43,7 +43,7 @@ WBORecord.prototype = {
|
||||
// Get thyself from your URI, then deserialize.
|
||||
// Set thine 'response' field.
|
||||
fetch: function fetch(resource) {
|
||||
if (!resource instanceof Resource) {
|
||||
if (!(resource instanceof Resource)) {
|
||||
throw new Error("First argument must be a Resource instance.");
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ WBORecord.prototype = {
|
||||
},
|
||||
|
||||
upload: function upload(resource) {
|
||||
if (!resource instanceof Resource) {
|
||||
if (!(resource instanceof Resource)) {
|
||||
throw new Error("First argument must be a Resource instance.");
|
||||
}
|
||||
|
||||
|
@ -456,7 +456,7 @@ Sync11Service.prototype = {
|
||||
this.clientsEngine = new ClientEngine(this);
|
||||
|
||||
for (let name of engines) {
|
||||
if (!name in ENGINE_MODULES) {
|
||||
if (!(name in ENGINE_MODULES)) {
|
||||
this._log.info("Do not know about engine: " + name);
|
||||
continue;
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ function browserAdditions (controller) {
|
||||
}, "Timeout", timeout, aInterval);
|
||||
}
|
||||
catch (ex) {
|
||||
if (!ex instanceof errors.TimeoutError) {
|
||||
if (!(ex instanceof errors.TimeoutError)) {
|
||||
throw ex;
|
||||
}
|
||||
timed_out = true;
|
||||
|
@ -659,7 +659,7 @@ Expect.prototype.waitFor = function Expect_waitFor(aCallback, aMessage, aTimeout
|
||||
Assert.prototype.waitFor.apply(this, arguments);
|
||||
}
|
||||
catch (ex) {
|
||||
if (!ex instanceof errors.AssertionError) {
|
||||
if (!(ex instanceof errors.AssertionError)) {
|
||||
throw ex;
|
||||
}
|
||||
message = ex.message;
|
||||
|
@ -41,7 +41,7 @@ jobs:
|
||||
command:
|
||||
- "bash"
|
||||
- "/home/worker/bin/build.sh"
|
||||
- "--tests=testing/marionette/harness/marionette/tests/harness_unit"
|
||||
- "--tests=testing/marionette/harness/marionette_harness/tests/harness_unit"
|
||||
- "--work-dir=mozharness_workspace"
|
||||
max-run-time: 1800
|
||||
when:
|
||||
|
@ -4,7 +4,7 @@
|
||||
# testing directory, we could use ./marionette_requirements.txt instead
|
||||
../web-platform/tests/tools/wptserve
|
||||
../marionette/client
|
||||
../marionette/harness/marionette/runner/mixins/browsermob-proxy-py
|
||||
../marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py
|
||||
../marionette/harness
|
||||
|
||||
# pytest
|
||||
|
@ -1,7 +1,8 @@
|
||||
-r mozbase_requirements.txt
|
||||
|
||||
../tools/wptserve
|
||||
../marionette/client
|
||||
../marionette/harness/marionette/runner/mixins/browsermob-proxy-py
|
||||
../marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py
|
||||
../marionette/harness
|
||||
|
||||
# Allows to use the Puppeteer page object model for Firefox
|
||||
|
@ -2,7 +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 marionette import BaseMarionetteArguments
|
||||
from marionette_harness import BaseMarionetteArguments
|
||||
|
||||
|
||||
class FirefoxUIBaseArguments(object):
|
||||
|
@ -4,7 +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 marionette.runtests import cli as mn_cli
|
||||
from marionette_harness.runtests import cli as mn_cli
|
||||
|
||||
from firefox_ui_harness.arguments import FirefoxUIArguments
|
||||
from firefox_ui_harness.runners import FirefoxUITestRunner
|
||||
|
@ -4,7 +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 marionette.runtests import cli as mn_cli
|
||||
from marionette_harness.runtests import cli as mn_cli
|
||||
|
||||
from firefox_ui_harness.arguments import UpdateArguments
|
||||
from firefox_ui_harness.runners import UpdateTestRunner
|
||||
|
@ -9,7 +9,7 @@ import tempfile
|
||||
import mozfile
|
||||
import mozinfo
|
||||
|
||||
from marionette import BaseMarionetteTestRunner, MarionetteTestCase
|
||||
from marionette_harness import BaseMarionetteTestRunner, MarionetteTestCase
|
||||
|
||||
|
||||
class FirefoxUITestRunner(BaseMarionetteTestRunner):
|
||||
|
@ -12,10 +12,9 @@ from firefox_puppeteer import PuppeteerMixin
|
||||
from firefox_puppeteer.api.prefs import Preferences
|
||||
from firefox_puppeteer.api.software_update import SoftwareUpdate
|
||||
from firefox_puppeteer.ui.update_wizard import UpdateWizardDialog
|
||||
|
||||
from marionette import MarionetteTestCase
|
||||
from marionette_driver import Wait
|
||||
from marionette_driver.errors import NoSuchWindowException
|
||||
from marionette_harness import MarionetteTestCase
|
||||
|
||||
|
||||
class UpdateTestCase(PuppeteerMixin, MarionetteTestCase):
|
||||
|
@ -1,5 +1,5 @@
|
||||
firefox-puppeteer >= 52.1.0, <53.0.0
|
||||
marionette-client >= 2.3.0
|
||||
marionette-harness >= 4.0.0
|
||||
mozfile >= 1.2
|
||||
mozinfo >= 0.8
|
||||
mozinstall >= 1.12
|
||||
|
@ -3,8 +3,8 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from firefox_puppeteer import PuppeteerMixin
|
||||
from marionette import MarionetteTestCase
|
||||
from marionette_driver import Wait
|
||||
from marionette_harness import MarionetteTestCase
|
||||
|
||||
|
||||
class TestBrowserWindowShortcuts(PuppeteerMixin, MarionetteTestCase):
|
||||
|