This commit is contained in:
Phil Ringnalda 2015-10-31 17:24:44 -07:00
Родитель 3b01811afd dd60c5be0a
Коммит 82c5571626
15 изменённых файлов: 44 добавлений и 102 удалений

Просмотреть файл

@ -6968,6 +6968,11 @@ var gIdentityHandler = {
return this._identityPopupMixedContentLearnMore =
document.getElementById("identity-popup-mcb-learn-more");
},
get _identityPopupInsecureLoginFormsLearnMore () {
delete this._identityPopupInsecureLoginFormsLearnMore;
return this._identityPopupInsecureLoginFormsLearnMore =
document.getElementById("identity-popup-insecure-login-forms-learn-more");
},
get _identityIconLabel () {
delete this._identityIconLabel;
return this._identityIconLabel = document.getElementById("identity-icon-label");
@ -7289,10 +7294,12 @@ var gIdentityHandler = {
* applicable
*/
refreshIdentityPopup() {
// Update the "Learn More" hrefs for Mixed Content Blocking.
// Update "Learn More" for Mixed Content Blocking and Insecure Login Forms.
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
let learnMoreHref = `${baseURL}mixed-content`;
this._identityPopupMixedContentLearnMore.setAttribute("href", learnMoreHref);
this._identityPopupMixedContentLearnMore
.setAttribute("href", baseURL + "mixed-content");
this._identityPopupInsecureLoginFormsLearnMore
.setAttribute("href", baseURL + "insecure-password");
// Determine connection security information.
let connection = "not-secure";

Просмотреть файл

@ -403,6 +403,7 @@ run-if = e10s
[browser_star_hsts.js]
[browser_subframe_favicons_not_used.js]
[browser_syncui.js]
skip-if = os == "mac" && debug # Bug 1217332
[browser_tabDrop.js]
skip-if = buildapp == 'mulet' || e10s
[browser_tabReorder.js]

Просмотреть файл

@ -55,6 +55,9 @@ add_task(function* test_simple() {
is(securityContentBG,
"url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
"Using expected icon image in the Control Center subview");
is(Array.filter(document.querySelectorAll("[observes=identity-popup-insecure-login-forms-learn-more]"),
element => !is_hidden(element)).length, 1,
"The 'Learn more' link should be visible once.");
}
// Messages should be visible when the scheme is HTTP, and invisible when

Просмотреть файл

@ -12,6 +12,7 @@
<broadcasterset>
<broadcaster id="identity-popup-content-host" class="identity-popup-headline" crop="start"/>
<broadcaster id="identity-popup-mcb-learn-more" class="text-link plain" value="&identity.learnMore;"/>
<broadcaster id="identity-popup-insecure-login-forms-learn-more" class="text-link plain" value="&identity.learnMore;"/>
</broadcasterset>
<panelmultiview id="identity-popup-multiView"
@ -121,7 +122,7 @@
and-when-loginforms="secure">&identity.description.insecure;</description>
<!-- Insecure login forms -->
<description when-loginforms="insecure">&identity.description.insecureLoginForms;</description>
<description when-loginforms="insecure">&identity.description.insecureLoginForms; <label observes="identity-popup-insecure-login-forms-learn-more"/></description>
<!-- Weak Cipher -->
<description when-ciphers="weak">&identity.description.weakCipher;</description>

Просмотреть файл

@ -10,6 +10,14 @@ body {
background: none;
}
/* Beta Ribbon */
.beta-ribbon {
background: url("../shared/img/beta-ribbon.svg") no-repeat;
background-size: 30px;
width: 30px;
height: 30px;
}
/* Panel styles */
.panel {
@ -30,6 +38,13 @@ body {
align-items: flex-start;
}
.panel-content > .beta-ribbon {
position: fixed;
left: 0;
top: 0;
z-index: 1000;
}
/* Notifications displayed over tabs */
.panel .messages {

Просмотреть файл

@ -806,9 +806,7 @@ loop.panel = (function(_, mozL10n) {
},
handleCreateButtonClick: function() {
var createRoomAction = new sharedActions.CreateRoom({
nameTemplate: mozL10n.get("rooms_default_room_name_template")
});
var createRoomAction = new sharedActions.CreateRoom();
createRoomAction.urls = [{
location: this.state.url,
@ -944,6 +942,7 @@ loop.panel = (function(_, mozL10n) {
return (
React.createElement("div", {className: "panel-content"},
React.createElement("div", {className: "beta-ribbon"}),
React.createElement(NotificationListView, {
clearOnDocumentHidden: true,
notifications: this.props.notifications}),

Просмотреть файл

@ -806,9 +806,7 @@ loop.panel = (function(_, mozL10n) {
},
handleCreateButtonClick: function() {
var createRoomAction = new sharedActions.CreateRoom({
nameTemplate: mozL10n.get("rooms_default_room_name_template")
});
var createRoomAction = new sharedActions.CreateRoom();
createRoomAction.urls = [{
location: this.state.url,
@ -944,6 +942,7 @@ loop.panel = (function(_, mozL10n) {
return (
<div className="panel-content">
<div className="beta-ribbon" />
<NotificationListView
clearOnDocumentHidden={true}
notifications={this.props.notifications} />

Просмотреть файл

@ -239,40 +239,6 @@ loop.store = loop.store || {};
});
},
/**
* Finds the next available room number in the provided room list.
*
* @param {String} nameTemplate The room name template; should contain a
* {{conversationLabel}} placeholder.
* @return {Number}
*/
findNextAvailableRoomNumber: function(nameTemplate) {
var searchTemplate = nameTemplate.replace("{{conversationLabel}}", "");
var searchRegExp = new RegExp("^" + searchTemplate + "(\\d+)$");
var roomNumbers = this._storeState.rooms.map(function(room) {
var match = searchRegExp.exec(room.decryptedContext.roomName);
return match && match[1] ? parseInt(match[1], 10) : 0;
});
if (!roomNumbers.length) {
return 1;
}
return Math.max.apply(null, roomNumbers) + 1;
},
/**
* Generates a room names against the passed template string.
*
* @param {String} nameTemplate The room name template.
* @return {String}
*/
_generateNewRoomName: function(nameTemplate) {
var roomLabel = this.findNextAvailableRoomNumber(nameTemplate);
return nameTemplate.replace("{{conversationLabel}}", roomLabel);
},
/**
* Creates a new room.
*
@ -285,9 +251,7 @@ loop.store = loop.store || {};
});
var roomCreationData = {
decryptedContext: {
roomName: this._generateNewRoomName(actionData.nameTemplate)
},
decryptedContext: {},
maxSize: this.maxRoomCreationSize
};
@ -296,7 +260,6 @@ loop.store = loop.store || {};
}
this._notifications.remove("create-room-error");
this._mozLoop.rooms.create(roomCreationData, function(err, createdRoom) {
var buckets = this._mozLoop.ROOM_CREATE;
if (err) {

Просмотреть файл

@ -241,9 +241,6 @@ loop.shared.actions = (function() {
* XXX: should move to some roomActions module - refs bug 1079284
*/
CreateRoom: Action.define("createRoom", {
// The localized template to use to name the new room
// (eg. "Conversation {{conversationLabel}}").
nameTemplate: String
// See https://wiki.mozilla.org/Loop/Architecture/Context#Format_of_context.value
// urls: Object - Optional
}),

Просмотреть файл

@ -1000,7 +1000,6 @@ describe("loop.panel", function() {
TestUtils.Simulate.click(node.querySelector(".new-room-button"));
sinon.assert.calledWith(dispatch, new sharedActions.CreateRoom({
nameTemplate: "Fake title",
urls: [{
location: "http://invalid.com",
description: "fakeSite",

Просмотреть файл

@ -214,44 +214,7 @@ describe("loop.store.RoomStore", function() {
});
});
describe("#findNextAvailableRoomNumber", function() {
var fakeNameTemplate = "RoomWord {{conversationLabel}}";
it("should find next available room number from an empty room list",
function() {
store.setStoreState({ rooms: [] });
expect(store.findNextAvailableRoomNumber(fakeNameTemplate)).eql(1);
});
it("should find next available room number from a non empty room list",
function() {
store.setStoreState({
rooms: [{ decryptedContext: { roomName: "RoomWord 1" } }]
});
expect(store.findNextAvailableRoomNumber(fakeNameTemplate)).eql(2);
});
it("should not be sensitive to initial list order", function() {
store.setStoreState({
rooms: [{
decryptedContext: {
roomName: "RoomWord 99"
}
}, {
decryptedContext: {
roomName: "RoomWord 98"
}
}]
});
expect(store.findNextAvailableRoomNumber(fakeNameTemplate)).eql(100);
});
});
describe("#createRoom", function() {
var fakeNameTemplate = "Conversation {{conversationLabel}}";
var fakeLocalRoomId = "777";
var fakeOwner = "fake@invalid";
var fakeRoomCreationData;
@ -259,9 +222,7 @@ describe("loop.store.RoomStore", function() {
beforeEach(function() {
sandbox.stub(dispatcher, "dispatch");
store.setStoreState({ pendingCreation: false, rooms: [] });
fakeRoomCreationData = {
nameTemplate: fakeNameTemplate
};
fakeRoomCreationData = {};
});
it("should clear any existing room errors", function() {
@ -298,9 +259,7 @@ describe("loop.store.RoomStore", function() {
store.createRoom(new sharedActions.CreateRoom(fakeRoomCreationData));
sinon.assert.calledWith(fakeMozLoop.rooms.create, {
decryptedContext: {
roomName: "Conversation 1"
},
decryptedContext: { },
maxSize: store.maxRoomCreationSize
});
});
@ -318,7 +277,6 @@ describe("loop.store.RoomStore", function() {
sinon.assert.calledWith(fakeMozLoop.rooms.create, {
decryptedContext: {
roomName: "Conversation 1",
urls: [{
location: "http://invalid.com",
description: "fakeSite",

Просмотреть файл

@ -179,9 +179,6 @@ feedback_request_button=Leave Feedback
help_label=Help
tour_label=Tour
## LOCALIZATION NOTE(rooms_default_room_name_template): {{conversationLabel}}
## will be replaced by a number. For example "Conversation 1" or "Conversation 12".
rooms_default_room_name_template=Conversation {{conversationLabel}}
rooms_leave_button_label=Leave
## LOCALIZATION NOTE (rooms_list_recently_browsed): String is in all caps
## for emphasis reasons, it is a heading. Proceed as appropriate for locale.

Просмотреть файл

@ -22,7 +22,7 @@ public class FormHistoryRecord extends Record {
public static final String COLLECTION_NAME = "forms";
private static final String PAYLOAD_NAME = "name";
private static final String PAYLOAD_VALUE = "value";
public static final long FORMS_TTL = 60 * 24 * 60 * 60; // 60 days in seconds.
public static final long FORMS_TTL = 3 * 365 * 24 * 60 * 60; // Three years in seconds.
/**
* The name of the saved form field.

Просмотреть файл

@ -16,7 +16,7 @@ Cu.import("resource://services-sync/util.js");
Cu.import("resource://services-sync/constants.js");
Cu.import("resource://gre/modules/Log.jsm");
const FORMS_TTL = 5184000; // 60 days
const FORMS_TTL = 3 * 365 * 24 * 60 * 60; // Three years in seconds.
this.FormRec = function FormRec(collection, id) {
CryptoWrapper.call(this, collection, id);

Просмотреть файл

@ -839,7 +839,10 @@ or run without that action (ie: --no-{action})"
env['MOZ_BUILD_DATE'] = self.query_buildid()
if self.query_is_nightly() or self.query_is_nightly_promotion():
env["IS_NIGHTLY"] = "yes"
if self.query_is_nightly():
# nightly promotion needs to set update_channel but not do all the 'IS_NIGHTLY'
# automation parts like uploading symbols for now
env["IS_NIGHTLY"] = "yes"
# in branch_specifics.py we might set update_channel explicitly
if c.get('update_channel'):
env["MOZ_UPDATE_CHANNEL"] = c['update_channel']