mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
merge fx-team to mozilla-central to pick up rc1 bustage fix on a CLOSED TREE
This commit is contained in:
commit
ca6314e244
4
.gitignore
vendored
4
.gitignore
vendored
@ -32,8 +32,8 @@ security/manager/.nss.checkout
|
||||
/obj*/
|
||||
|
||||
# Build directories for js shell
|
||||
*/_DBG.OBJ/
|
||||
*/_OPT.OBJ/
|
||||
_DBG.OBJ/
|
||||
_OPT.OBJ/
|
||||
|
||||
# SpiderMonkey configury
|
||||
js/src/configure
|
||||
|
@ -46,6 +46,12 @@ var gSyncUI = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Sync isn't ready yet, but we can still update the UI with an initial
|
||||
// state - we haven't called initUI() yet, but that's OK - that's more
|
||||
// about observers for state changes, and will be called once Sync is
|
||||
// ready to start sending notifications.
|
||||
this.updateUI();
|
||||
|
||||
Services.obs.addObserver(this, "weave:service:ready", true);
|
||||
|
||||
// Remove the observer if the window is closed before the observer
|
||||
@ -143,6 +149,13 @@ var gSyncUI = {
|
||||
// still need to track a login-failed state so the "Tools" menu updates
|
||||
// with the correct state.
|
||||
_loginFailed: function () {
|
||||
// If Sync isn't already ready, we don't want to force it to initialize
|
||||
// by referencing Weave.Status - and it isn't going to be accurate before
|
||||
// Sync is ready anyway.
|
||||
if (!this.weaveService.ready) {
|
||||
this.log.debug("_loginFailed has sync not ready, so returning false");
|
||||
return false;
|
||||
}
|
||||
this.log.debug("_loginFailed has sync state=${sync}",
|
||||
{ sync: Weave.Status.login});
|
||||
return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED;
|
||||
|
@ -7,6 +7,7 @@ const TEST_LIST = "test-track-simple";
|
||||
const TRACK_SUFFIX = "-track-digest256";
|
||||
const TRACKING_TABLE_PREF = "urlclassifier.trackingTable";
|
||||
const LISTS_PREF_BRANCH = "browser.safebrowsing.provider.mozilla.lists.";
|
||||
const UPDATE_TIME_PREF = "browser.safebrowsing.provider.mozilla.nextupdatetime";
|
||||
|
||||
var gBlocklistManager = {
|
||||
_type: "",
|
||||
@ -133,6 +134,7 @@ var gBlocklistManager = {
|
||||
if (shouldProceed) {
|
||||
let trackingTable = TEST_LIST + "," + selected.id + TRACK_SUFFIX;
|
||||
Services.prefs.setCharPref(TRACKING_TABLE_PREF, trackingTable);
|
||||
Services.prefs.setCharPref(UPDATE_TIME_PREF, 42);
|
||||
|
||||
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit |
|
||||
Ci.nsIAppStartup.eRestart);
|
||||
|
@ -1198,6 +1198,7 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
#back-button > .toolbarbutton-icon,
|
||||
#forward-button > .toolbarbutton-icon {
|
||||
max-width: none;
|
||||
width: 18px;
|
||||
}
|
||||
|
||||
/* Back button styles */
|
||||
|
@ -816,6 +816,12 @@ toolbar .toolbarbutton-1:-moz-any(@primaryToolbarButtons@) > :-moz-any(.toolbarb
|
||||
-moz-padding-end: 17px;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1[type=panel] > .toolbarbutton-icon,
|
||||
#nav-bar .toolbarbutton-1[type=menu]:not(#PanelUI-menu-button):not(#back-button):not(#forward-button) > .toolbarbutton-icon {
|
||||
/* horizontal padding + border + icon width */
|
||||
max-width: 43px;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menu-dropmarker {
|
||||
-moz-margin-start: -15px;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
<div id="timeline-toolbar" class="theme-toolbar">
|
||||
<button id="rewind-timeline" standalone="true" class="devtools-button"></button>
|
||||
<button id="pause-resume-timeline" standalone="true" class="devtools-button pause-button paused"></button>
|
||||
<span id="timeline-current-time" class="label"></span>
|
||||
</div>
|
||||
<div id="players"></div>
|
||||
<div id="error-message">
|
||||
|
@ -9,6 +9,7 @@
|
||||
"use strict";
|
||||
|
||||
const {AnimationsTimeline} = require("devtools/client/animationinspector/components");
|
||||
const {formatStopwatchTime} = require("devtools/client/animationinspector/utils");
|
||||
|
||||
var $ = (selector, target = document) => target.querySelector(selector);
|
||||
|
||||
@ -37,6 +38,7 @@ var AnimationsPanel = {
|
||||
this.toggleAllButtonEl = $("#toggle-all");
|
||||
this.playTimelineButtonEl = $("#pause-resume-timeline");
|
||||
this.rewindTimelineButtonEl = $("#rewind-timeline");
|
||||
this.timelineCurrentTimeEl = $("#timeline-current-time");
|
||||
|
||||
// If the server doesn't support toggling all animations at once, hide the
|
||||
// whole global toolbar.
|
||||
@ -84,6 +86,7 @@ var AnimationsPanel = {
|
||||
this.playersEl = this.errorMessageEl = null;
|
||||
this.toggleAllButtonEl = this.pickerButtonEl = null;
|
||||
this.playTimelineButtonEl = this.rewindTimelineButtonEl = null;
|
||||
this.timelineCurrentTimeEl = null;
|
||||
|
||||
this.destroyed.resolve();
|
||||
}),
|
||||
@ -190,6 +193,16 @@ var AnimationsPanel = {
|
||||
.catch(error => console.error(error))
|
||||
.then(() => this.setCurrentTimeAllPromise = null);
|
||||
}
|
||||
|
||||
this.displayTimelineCurrentTime();
|
||||
},
|
||||
|
||||
displayTimelineCurrentTime: function() {
|
||||
let {isMoving, isPaused, time} = this.timelineData;
|
||||
|
||||
if (isMoving || isPaused) {
|
||||
this.timelineCurrentTimeEl.textContent = formatStopwatchTime(time);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -674,7 +674,7 @@ AnimationsTimeline.prototype = {
|
||||
!this.isAtLeastOneAnimationPlaying()) {
|
||||
this.stopAnimatingScrubber();
|
||||
this.emit("timeline-data-changed", {
|
||||
isPaused: false,
|
||||
isPaused: !this.isAtLeastOneAnimationPlaying(),
|
||||
isMoving: false,
|
||||
time: TimeScale.distanceToRelativeTime(x, this.timeHeaderEl.offsetWidth)
|
||||
});
|
||||
|
@ -24,6 +24,7 @@ support-files =
|
||||
[browser_animation_shows_player_on_valid_node.js]
|
||||
[browser_animation_target_highlight_select.js]
|
||||
[browser_animation_target_highlighter_lock.js]
|
||||
[browser_animation_timeline_currentTime.js]
|
||||
[browser_animation_timeline_header.js]
|
||||
[browser_animation_timeline_pause_button.js]
|
||||
[browser_animation_timeline_rewind_button.js]
|
||||
|
@ -0,0 +1,46 @@
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Check that the timeline toolbar displays the current time, and that it
|
||||
// changes when animations are playing, gets back to 0 when animations are
|
||||
// rewound, and stops when animations are paused.
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab(TEST_URL_ROOT + "doc_simple_animation.html");
|
||||
|
||||
let {panel} = yield openAnimationInspector();
|
||||
let label = panel.timelineCurrentTimeEl;
|
||||
ok(label, "The current time label exists");
|
||||
|
||||
// On page load animations are playing so the time shoud change, although we
|
||||
// don't want to test the exact value of the time displayed, just that it
|
||||
// actually changes.
|
||||
info("Make sure the time displayed actually changes");
|
||||
yield isCurrentTimeLabelChanging(panel, true);
|
||||
|
||||
info("Pause the animations and check that the time stops changing");
|
||||
yield clickTimelinePlayPauseButton(panel);
|
||||
yield isCurrentTimeLabelChanging(panel, false);
|
||||
|
||||
info("Rewind the animations and check that the time stops changing");
|
||||
yield clickTimelineRewindButton(panel);
|
||||
yield isCurrentTimeLabelChanging(panel, false);
|
||||
is(label.textContent, "00:00.000");
|
||||
});
|
||||
|
||||
function* isCurrentTimeLabelChanging(panel, isChanging) {
|
||||
let label = panel.timelineCurrentTimeEl;
|
||||
|
||||
let time1 = label.textContent;
|
||||
yield new Promise(r => setTimeout(r, 200));
|
||||
let time2 = label.textContent;
|
||||
|
||||
if (isChanging) {
|
||||
ok(time1 !== time2, "The text displayed in the label changes with time");
|
||||
} else {
|
||||
is(time1, time2, "The text displayed in the label doesn't change");
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
const {require} = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
|
||||
const {formatStopwatchTime} = require("devtools/client/animationinspector/utils");
|
||||
|
||||
|
||||
const TEST_DATA = [{
|
||||
desc: "Formatting 0",
|
||||
time: 0,
|
||||
expected: "00:00.000"
|
||||
}, {
|
||||
desc: "Formatting null",
|
||||
time: null,
|
||||
expected: "00:00.000"
|
||||
}, {
|
||||
desc: "Formatting undefined",
|
||||
time: undefined,
|
||||
expected: "00:00.000"
|
||||
}, {
|
||||
desc: "Formatting a small number of ms",
|
||||
time: 13,
|
||||
expected: "00:00.013"
|
||||
}, {
|
||||
desc: "Formatting a slightly larger number of ms",
|
||||
time: 500,
|
||||
expected: "00:00.500"
|
||||
}, {
|
||||
desc: "Formatting 1 second",
|
||||
time: 1000,
|
||||
expected: "00:01.000"
|
||||
}, {
|
||||
desc: "Formatting a number of seconds",
|
||||
time: 1532,
|
||||
expected: "00:01.532"
|
||||
}, {
|
||||
desc: "Formatting a big number of seconds",
|
||||
time: 58450,
|
||||
expected: "00:58.450"
|
||||
}, {
|
||||
desc: "Formatting 1 minute",
|
||||
time: 60000,
|
||||
expected: "01:00.000"
|
||||
}, {
|
||||
desc: "Formatting a number of minutes",
|
||||
time: 263567,
|
||||
expected: "04:23.567"
|
||||
}, {
|
||||
desc: "Formatting a large number of minutes",
|
||||
time: 1000 * 60 * 60 * 3,
|
||||
expected: "180:00.000"
|
||||
}];
|
||||
|
||||
function run_test() {
|
||||
for (let {desc, time, expected} of TEST_DATA) {
|
||||
equal(formatStopwatchTime(time), expected, desc);
|
||||
}
|
||||
}
|
@ -6,4 +6,5 @@ firefox-appdir = browser
|
||||
skip-if = toolkit == 'android' || toolkit == 'gonk'
|
||||
|
||||
[test_findOptimalTimeInterval.js]
|
||||
[test_formatStopwatchTime.js]
|
||||
[test_timeScale.js]
|
||||
|
@ -177,3 +177,34 @@ var TargetNodeHighlighter = {
|
||||
|
||||
EventEmitter.decorate(TargetNodeHighlighter);
|
||||
exports.TargetNodeHighlighter = TargetNodeHighlighter;
|
||||
|
||||
/**
|
||||
* Format a timestamp (in ms) as a mm:ss.mmm string.
|
||||
* @param {Number} time
|
||||
* @return {String}
|
||||
*/
|
||||
function formatStopwatchTime(time) {
|
||||
// Format falsy values as 0
|
||||
if (!time) {
|
||||
return "00:00.000";
|
||||
}
|
||||
|
||||
let milliseconds = parseInt(time % 1000, 10);
|
||||
let seconds = parseInt((time / 1000) % 60, 10);
|
||||
let minutes = parseInt((time / (1000 * 60)), 10);
|
||||
|
||||
let pad = (nb, max) => {
|
||||
if (nb < max) {
|
||||
return new Array((max+"").length - (nb+"").length + 1).join("0") + nb;
|
||||
}
|
||||
return nb;
|
||||
}
|
||||
|
||||
minutes = pad(minutes, 10);
|
||||
seconds = pad(seconds, 10);
|
||||
milliseconds = pad(milliseconds, 100);
|
||||
|
||||
return `${minutes}:${seconds}.${milliseconds}`;
|
||||
}
|
||||
|
||||
exports.formatStopwatchTime = formatStopwatchTime;
|
||||
|
@ -62,7 +62,8 @@ body {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#global-toolbar .label {
|
||||
#global-toolbar .label,
|
||||
#timeline-toolbar .label {
|
||||
padding: 1px 4px;
|
||||
}
|
||||
|
||||
|
@ -368,6 +368,13 @@ class GeckoInputConnection
|
||||
final InputMethodManager imm = getInputMethodManager();
|
||||
if (imm != null) {
|
||||
final View v = getView();
|
||||
|
||||
if (v.hasFocus() && !imm.isActive(v)) {
|
||||
// Workaround: The view has focus but it is not the active view for the input method. (Bug 1211848)
|
||||
v.clearFocus();
|
||||
v.requestFocus();
|
||||
}
|
||||
|
||||
imm.showSoftInput(v, 0);
|
||||
}
|
||||
}
|
||||
|
@ -74,19 +74,9 @@ public class RestrictedProfiles {
|
||||
return false;
|
||||
}
|
||||
|
||||
// The user is on a restricted profile if, and only if, we injected application restrictions during account setup.
|
||||
final UserManager mgr = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
final Bundle restrictions = new Bundle();
|
||||
restrictions.putAll(mgr.getApplicationRestrictions(context.getPackageName()));
|
||||
restrictions.putAll(mgr.getUserRestrictions());
|
||||
|
||||
for (String key : restrictions.keySet()) {
|
||||
if (restrictions.getBoolean(key)) {
|
||||
// At least one restriction is enabled -> We are a restricted profile
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return !mgr.getApplicationRestrictions(context.getPackageName()).isEmpty();
|
||||
}
|
||||
|
||||
public static void update(Context context) {
|
||||
|
@ -520,7 +520,7 @@ public class testDistribution extends ContentProviderTest {
|
||||
JSONObject response = clickTrackingTile(mStringHelper.DISTRIBUTION1_LABEL);
|
||||
mAsserter.is(response.getInt("click"), 0, "JSON click index matched");
|
||||
mAsserter.is(response.getString("locale"), localeCode, "JSON locale code matched");
|
||||
mAsserter.is(response.getString("tiles"), "[{\"id\":123},{\"id\":456},{\"id\":632},{\"id\":629},{\"id\":630},{\"id\":631}]", "JSON tiles data matched");
|
||||
mAsserter.is(response.getString("tiles"), "[{\"id\":123},{\"id\":456},{\"id\":632},{\"id\":630},{\"id\":631}]", "JSON tiles data matched");
|
||||
|
||||
inputAndLoadUrl(mStringHelper.ABOUT_HOME_URL);
|
||||
|
||||
@ -530,7 +530,7 @@ public class testDistribution extends ContentProviderTest {
|
||||
// Click the second tracking tile and verify the posted data.
|
||||
response = clickTrackingTile(mStringHelper.DISTRIBUTION2_LABEL);
|
||||
mAsserter.is(response.getInt("click"), 1, "JSON click index matched");
|
||||
mAsserter.is(response.getString("tiles"), "[{\"id\":123},{\"id\":456,\"pin\":true},{\"id\":632},{\"id\":629},{\"id\":630},{\"id\":631}]", "JSON tiles data matched");
|
||||
mAsserter.is(response.getString("tiles"), "[{\"id\":123},{\"id\":456,\"pin\":true},{\"id\":632},{\"id\":630},{\"id\":631}]", "JSON tiles data matched");
|
||||
|
||||
inputAndLoadUrl(mStringHelper.ABOUT_HOME_URL);
|
||||
|
||||
|
@ -46,6 +46,11 @@ browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s
|
||||
# browser.suggestedsites.NAME.title=Displayed name
|
||||
# browser.suggestedsites.NAME.url=Website URL
|
||||
# browser.suggestedsites.NAME.bgcolor= Color (hex format)
|
||||
#
|
||||
# Note that if you remove or add items to this set, you need to adjust
|
||||
# mobile/android/tests/browser/robocop/testDistribution.java
|
||||
# to reflect the new set of IDs reported as tiles data.
|
||||
#
|
||||
browser.suggestedsites.list.0=mozilla
|
||||
browser.suggestedsites.list.1=fxaddons
|
||||
browser.suggestedsites.list.2=fxsupport
|
||||
|
Loading…
Reference in New Issue
Block a user