Merge f-t to m-c, a=merge

This commit is contained in:
Phil Ringnalda 2015-01-31 09:06:14 -08:00
commit 1c0ae8ffca
110 changed files with 23163 additions and 20039 deletions

View File

@ -0,0 +1,8 @@
/* 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/. */
html:not(.crashDumpSubmitted) #reportSent,
html:not(.crashDumpAvailable) #report-box {
display: none;
}

View File

@ -12,21 +12,35 @@ function parseQueryString() {
document.title = parseQueryString();
addEventListener("DOMContentLoaded", () => {
let tryAgain = document.getElementById("tryAgain");
let sendCrashReport = document.getElementById("checkSendReport");
function shouldSendReport() {
if (!document.documentElement.classList.contains("crashDumpAvailable"))
return false;
return document.getElementById("sendReport").checked;
}
tryAgain.addEventListener("click", () => {
let event = new CustomEvent("AboutTabCrashedTryAgain", {
function sendEvent(message) {
let event = new CustomEvent("AboutTabCrashedMessage", {
bubbles: true,
detail: {
sendCrashReport: sendCrashReport.checked,
message,
sendCrashReport: shouldSendReport(),
},
});
document.dispatchEvent(event);
});
});
}
function closeTab() {
sendEvent("closeTab");
}
function restoreTab() {
sendEvent("restoreTab");
}
function restoreAll() {
sendEvent("restoreAll");
}
// Error pages are loaded as LOAD_BACKGROUND, so they don't get load events.
var event = new CustomEvent("AboutTabCrashedLoad", {bubbles:true});

View File

@ -12,18 +12,19 @@
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % browserDTD
SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % tabCrashedDTD
SYSTEM "chrome://browser/locale/aboutTabCrashed.dtd">
%tabCrashedDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://global/skin/in-content/info-pages.css"/>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://browser/content/aboutTabCrashed.css"/>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://browser/skin/aboutTabCrashed.css"/>
</head>
@ -36,12 +37,19 @@
<p>&tabCrashed.message;</p>
<div id="report-box">
<input type="checkbox" id="checkSendReport" checked="checked"/>
<label for="checkSendReport">&tabCrashed.checkSendReport;</label>
<input type="checkbox" id="sendReport" checked="checked"/>
<label for="sendReport">&tabCrashed.sendReport;</label>
</div>
<p id="reportSent">&tabCrashed.reportSent;</p>
<div class="button-container">
<button id="tryAgain">&tabCrashed.tryAgain;</button>
<button id="closeTab" onclick="closeTab()">
&tabCrashed.closeTab;</button>
<button id="restoreTab" onclick="restoreTab()">
&tabCrashed.restoreTab;</button>
<button id="restoreAll" onclick="restoreAll()" autofocus="true" class="primary">
&tabCrashed.restoreAll;</button>
</div>
</div>
</body>

View File

@ -271,6 +271,12 @@ XPCOMUtils.defineLazyGetter(this, "PageMenuParent", function() {
return new tmp.PageMenuParent();
});
function* browserWindows() {
let windows = Services.wm.getEnumerator("navigator:browser");
while (windows.hasMoreElements())
yield windows.getNext();
}
/**
* We can avoid adding multiple load event listeners and save some time by adding
* one listener that calls all real handlers.
@ -1116,7 +1122,7 @@ var gBrowserInit = {
#endif
}, false, true);
gBrowser.addEventListener("AboutTabCrashedTryAgain", function(event) {
gBrowser.addEventListener("AboutTabCrashedMessage", function(event) {
let ownerDoc = event.originalTarget;
if (!ownerDoc.documentURI.startsWith("about:tabcrashed")) {
@ -1134,8 +1140,23 @@ var gBrowserInit = {
TabCrashReporter.submitCrashReport(browser);
}
#endif
let tab = gBrowser.getTabForBrowser(browser);
switch (event.detail.message) {
case "closeTab":
gBrowser.removeTab(tab, { animate: true });
break;
case "restoreTab":
SessionStore.reviveCrashedTab(tab);
break;
case "restoreAll":
for (let browserWin of browserWindows()) {
for (let tab of window.gBrowser.tabs) {
SessionStore.reviveCrashedTab(tab);
}
}
break;
}
}, false, true);
let uriToLoad = this._getUriToLoad();
@ -6471,11 +6492,9 @@ function warnAboutClosingWindow() {
return gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL);
// Figure out if there's at least one other browser window around.
let e = Services.wm.getEnumerator("navigator:browser");
let otherPBWindowExists = false;
let nonPopupPresent = false;
while (e.hasMoreElements()) {
let win = e.getNext();
for (let win of browserWindows()) {
if (!win.closed && win != window) {
if (isPBWindow && PrivateBrowsingUtils.isWindowPrivate(win))
otherPBWindowExists = true;
@ -7574,9 +7593,7 @@ function switchToTabHavingURI(aURI, aOpenNew, aOpenParams={}) {
if (isBrowserWindow && switchIfURIInWindow(window))
return true;
let winEnum = Services.wm.getEnumerator("navigator:browser");
while (winEnum.hasMoreElements()) {
let browserWin = winEnum.getNext();
for (let browserWin of browserWindows()) {
// Skip closed (but not yet destroyed) windows,
// and the current window (which was checked earlier).
if (browserWin.closed || browserWin == window)

View File

@ -51,9 +51,10 @@ tabpanels {
}
}
.tab-icon-image:not([src]):not([pinned]),
.tab-icon-image:not([src]):not([pinned]):not([crashed]),
.tab-throbber:not([busy]),
.tab-throbber[busy] + .tab-icon-image {
.tab-icon-image[busy],
.tab-icon-overlay[busy] {
display: none;
}

View File

@ -664,9 +664,13 @@
// We need to add 2 because loadURIWithFlags may have
// cancelled a pending load which would have cleared
// its anchor scroll detection temporary increment.
if (aWebProgress.isTopLevel)
if (aWebProgress.isTopLevel) {
this.mBrowser.userTypedClear += 2;
// If the browser is loading it must not be crashed anymore
this.mTab.removeAttribute("crashed");
}
if (this._shouldShowProgress(aRequest)) {
if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
this.mTab.setAttribute("busy", "true");
@ -1484,6 +1488,10 @@
if (aShouldBeRemote) {
tab.setAttribute("remote", "true");
// Switching the browser to be remote will connect to a new child
// process so the browser can no longer be considered to be
// crashed.
tab.removeAttribute("crashed");
} else {
tab.removeAttribute("remote");
aBrowser.messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: tab.pinned })
@ -3579,6 +3587,7 @@
browser.docShell.displayLoadError(Cr.NS_ERROR_CONTENT_CRASHED, uri, null);
browser.removeAttribute("crashedPageTitle");
let tab = this.getTabForBrowser(browser);
tab.setAttribute("crashed", true);
this.setIcon(tab, icon);
]]>
</handler>
@ -4980,11 +4989,14 @@
class="tab-throbber"
role="presentation"
layer="true" />
<xul:image xbl:inherits="src=image,fadein,pinned,selected"
<xul:image xbl:inherits="src=image,fadein,pinned,selected,busy,crashed"
anonid="tab-icon-image"
class="tab-icon-image"
validate="never"
role="presentation"/>
<xul:image xbl:inherits="crashed,busy"
class="tab-icon-overlay"
role="presentation"/>
<xul:label flex="1"
anonid="tab-label"
xbl:inherits="value=visibleLabel,crop,accesskey,fadein,pinned,selected"

View File

@ -69,6 +69,7 @@ browser.jar:
content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
content/browser/aboutSocialError.xhtml (content/aboutSocialError.xhtml)
content/browser/aboutProviderDirectory.xhtml (content/aboutProviderDirectory.xhtml)
content/browser/aboutTabCrashed.css (content/aboutTabCrashed.css)
content/browser/aboutTabCrashed.js (content/aboutTabCrashed.js)
content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml)
* content/browser/browser.css (content/browser.css)

View File

@ -3,11 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Shared conversation window styles */
.standalone .video-layout-wrapper,
.conversation .media video {
background-color: #444;
}
.conversation {
position: relative;
}
@ -508,10 +503,11 @@
* XXX this approach is fragile because it makes assumptions
* about the generated OT markup, any change will break it
*/
.local-stream.local-stream-audio,
.standalone .OT_subscriber .OT_video-poster,
.fx-embedded .OT_video-container .OT_video-poster,
.local-stream-audio .OT_publisher .OT_video-poster {
/*
* For any audio-only streams, we want to display our own background
*/
.OT_audio-only .OT_widget-container .OT_video-poster {
background-image: url("../img/audio-call-avatar.svg");
background-repeat: no-repeat;
background-color: #4BA6E7;
@ -519,6 +515,22 @@
background-position: center;
}
/*
* Audio-only. For local streams, cancel out the SDK's opacity of 0.25.
* For remote streams we leave them shaded, as otherwise its too bright.
*/
.local-stream-audio .OT_publisher .OT_video-poster {
opacity: 1
}
/*
* In audio-only mode, don't display the video element, doing so interferes
* with the background opacity of the video-poster element.
*/
.OT_audio-only .OT_widget-container .OT_video-element {
display: none;
}
/*
* Ensure that the publisher (i.e. local) video is never cropped, so that it's
* not possible for someone to be presented with a picture that displays
@ -537,7 +549,7 @@
* Another less ugly possibility would be to work with Ted Mielczarek to use
* the fake camera drivers he has for Linux.
*/
.room-conversation .OT_publisher .OT_video-container {
.room-conversation .OT_publisher .OT_widget-container {
height: 100% !important;
width: 100% !important;
top: 0 !important;
@ -545,12 +557,12 @@
background-color: transparent; /* avoid visually obvious letterboxing */
}
.room-conversation .OT_publisher .OT_video-container video {
.room-conversation .OT_publisher .OT_widget-container video {
background-color: transparent; /* avoid visually obvious letterboxing */
}
.fx-embedded .room-conversation .room-preview .OT_publisher .OT_video-container,
.fx-embedded .room-conversation .room-preview .OT_publisher .OT_video-container video {
.fx-embedded .room-conversation .room-preview .OT_publisher .OT_widget-container,
.fx-embedded .room-conversation .room-preview .OT_publisher .OT_widget-container video {
/* Desktop conversation window room preview local stream actually wants
a black background */
background-color: #000;
@ -673,7 +685,6 @@ html, .fx-embedded, #main,
}
.standalone {
max-width: 1000px;
margin: 0 auto;
}
}
@ -905,11 +916,6 @@ html, .fx-embedded, #main,
width: 75%;
}
.standalone .room-conversation .local-stream {
width: 33%;
height: 26.5%;
}
.standalone .room-conversation .conversation-toolbar {
background: #000;
border: none;
@ -945,11 +951,6 @@ html, .fx-embedded, #main,
.standalone .room-conversation .video_wrapper.remote_wrapper {
width: 100%;
}
.standalone .room-conversation .local-stream {
/* Assumes 4:3 aspect ratio */
width: 180px;
height: 135px;
}
.standalone .conversation-toolbar {
height: 38px;
padding: 8px;

View File

@ -176,6 +176,15 @@ loop.shared.actions = (function() {
MediaConnected: Action.define("mediaConnected", {
}),
/**
* Used for notifying that the dimensions of a stream just changed. Also
* dispatched when a stream connects for the first time.
*/
VideoDimensionsChanged: Action.define("videoDimensionsChanged", {
videoType: String,
dimensions: Object
}),
/**
* Used to mute or unmute a stream
*/

View File

@ -68,7 +68,9 @@ loop.store.ActiveRoomStore = (function() {
// session. 'Used' means at least one call has been placed
// with it. Entering and leaving the room without seeing
// anyone is not considered as 'used'
used: false
used: false,
localVideoDimensions: {},
remoteVideoDimensions: {}
};
},
@ -119,7 +121,8 @@ loop.store.ActiveRoomStore = (function() {
"remotePeerConnected",
"windowUnload",
"leaveRoom",
"feedbackComplete"
"feedbackComplete",
"videoDimensionsChanged"
]);
},
@ -477,6 +480,23 @@ loop.store.ActiveRoomStore = (function() {
// Note, that we want some values, such as the windowId, so we don't
// do a full reset here.
this.setStoreState(this.getInitialStoreState());
},
/**
* Handles a change in dimensions of a video stream and updates the store data
* with the new dimensions of a local or remote stream.
*
* @param {sharedActions.VideoDimensionsChanged} actionData
*/
videoDimensionsChanged: function(actionData) {
// NOTE: in the future, when multiple remote video streams are supported,
// we'll need to make this support multiple remotes as well. Good
// starting point for video tiling.
var storeProp = (actionData.isLocal ? "local" : "remote") + "VideoDimensions";
var nextState = {};
nextState[storeProp] = this.getStoreState()[storeProp];
nextState[storeProp][actionData.videoType] = actionData.dimensions;
this.setStoreState(nextState);
}
});

View File

@ -157,29 +157,217 @@ loop.shared.mixins = (function() {
* elements and handling updates of the media containers.
*/
var MediaSetupMixin = {
_videoDimensionsCache: {
local: {},
remote: {}
},
componentDidMount: function() {
rootObject.addEventListener('orientationchange', this.updateVideoContainer);
rootObject.addEventListener('resize', this.updateVideoContainer);
rootObject.addEventListener("orientationchange", this.updateVideoContainer);
rootObject.addEventListener("resize", this.updateVideoContainer);
},
componentWillUnmount: function() {
rootObject.removeEventListener('orientationchange', this.updateVideoContainer);
rootObject.removeEventListener('resize', this.updateVideoContainer);
rootObject.removeEventListener("orientationchange", this.updateVideoContainer);
rootObject.removeEventListener("resize", this.updateVideoContainer);
},
/**
* Whenever the dimensions change of a video stream, this function is called
* by `updateVideoDimensions` to store the new values and notifies the callee
* if the dimensions changed compared to the currently stored values.
*
* @param {String} which Type of video stream. May be 'local' or 'remote'
* @param {Object} newDimensions Object containing 'width' and 'height' properties
* @return {Boolean} `true` when the dimensions have changed,
* `false` if not
*/
_updateDimensionsCache: function(which, newDimensions) {
var cache = this._videoDimensionsCache[which];
var cacheKeys = Object.keys(cache);
var changed = false;
Object.keys(newDimensions).forEach(function(videoType) {
if (cacheKeys.indexOf(videoType) === -1) {
cache[videoType] = newDimensions[videoType];
cache[videoType].aspectRatio = this.getAspectRatio(cache[videoType]);
changed = true;
return;
}
if (cache[videoType].width !== newDimensions[videoType].width) {
cache[videoType].width = newDimensions[videoType].width;
changed = true;
}
if (cache[videoType].height !== newDimensions[videoType].height) {
cache[videoType].height = newDimensions[videoType].height;
changed = true;
}
if (changed) {
cache[videoType].aspectRatio = this.getAspectRatio(cache[videoType]);
}
}, this);
return changed;
},
/**
* Whenever the dimensions change of a video stream, this function is called
* to process these changes and possibly trigger an update to the video
* container elements.
*
* @param {Object} localVideoDimensions Object containing 'width' and 'height'
* properties grouped by stream name
* @param {Object} remoteVideoDimensions Object containing 'width' and 'height'
* properties grouped by stream name
*/
updateVideoDimensions: function(localVideoDimensions, remoteVideoDimensions) {
var localChanged = this._updateDimensionsCache("local", localVideoDimensions);
var remoteChanged = this._updateDimensionsCache("remote", remoteVideoDimensions);
if (localChanged || remoteChanged) {
this.updateVideoContainer();
}
},
/**
* Get the aspect ratio of a width/ height pair, which should be the dimensions
* of a stream. The returned object is an aspect ratio indexed by 1; the leading
* size has a value smaller than 1 and the slave size has a value of 1.
* this is exactly the same as notations like 4:3 and 16:9, which are merely
* human-readable forms of their fractional counterparts. 4:3 === 1:0.75 and
* 16:9 === 1:0.5625.
* So we're using the aspect ratios in their original form, because that's
* easier to do calculus with.
*
* Example:
* A stream with dimensions `{ width: 640, height: 480 }` yields an indexed
* aspect ratio of `{ width: 1, height: 0.75 }`. This means that the 'height'
* will determine the value of 'width' when the stream is stretched or shrunk
* to fit inside its container element at the maximum size.
*
* @param {Object} dimensions Object containing 'width' and 'height' properties
* @return {Object} Contains the indexed aspect ratio for 'width'
* and 'height' assigned to the corresponding
* properties.
*/
getAspectRatio: function(dimensions) {
if (dimensions.width === dimensions.height) {
return {width: 1, height: 1};
}
var denominator = Math.max(dimensions.width, dimensions.height);
return {
width: dimensions.width / denominator,
height: dimensions.height / denominator
};
},
/**
* Retrieve the dimensions of the remote video stream.
* Example output:
* {
* width: 680,
* height: 480,
* streamWidth: 640,
* streamHeight: 480,
* offsetX: 20,
* offsetY: 0
* }
*
* Note: Once we support multiple remote video streams, this function will
* need to be updated.
* @return {Object} contains the remote stream dimension properties of its
* container node, the stream itself and offset of the stream
* relative to its container node in pixels.
*/
getRemoteVideoDimensions: function() {
var remoteVideoDimensions;
Object.keys(this._videoDimensionsCache.remote).forEach(function(videoType) {
var node = this._getElement("." + (videoType === "camera" ? "remote" : videoType));
var width = node.offsetWidth;
// If the width > 0 then we record its real size by taking its aspect
// ratio in account. Due to the 'contain' fit-mode, the stream will be
// centered inside the video element.
// We'll need to deal with more than one remote video stream whenever
// that becomes something we need to support.
if (width) {
remoteVideoDimensions = {
width: width,
height: node.offsetHeight
};
var ratio = this._videoDimensionsCache.remote[videoType].aspectRatio;
var leadingAxis = Math.min(ratio.width, ratio.height) === ratio.width ?
"width" : "height";
var slaveSize = remoteVideoDimensions[leadingAxis] +
(remoteVideoDimensions[leadingAxis] * (1 - ratio[leadingAxis]));
remoteVideoDimensions.streamWidth = leadingAxis === "width" ?
remoteVideoDimensions.width : slaveSize;
remoteVideoDimensions.streamHeight = leadingAxis === "height" ?
remoteVideoDimensions.height: slaveSize;
}
}, this);
// Supply some sensible defaults for the remoteVideoDimensions if no remote
// stream is connected (yet).
if (!remoteVideoDimensions) {
var node = this._getElement(".remote");
var width = node.offsetWidth;
var height = node.offsetHeight;
remoteVideoDimensions = {
width: width,
height: height,
streamWidth: width,
streamHeight: height
};
}
// Calculate the size of each individual letter- or pillarbox for convenience.
remoteVideoDimensions.offsetX = remoteVideoDimensions.width -
remoteVideoDimensions.streamWidth
if (remoteVideoDimensions.offsetX > 0) {
remoteVideoDimensions.offsetX /= 2;
}
remoteVideoDimensions.offsetY = remoteVideoDimensions.height -
remoteVideoDimensions.streamHeight;
if (remoteVideoDimensions.offsetY > 0) {
remoteVideoDimensions.offsetY /= 2;
}
return remoteVideoDimensions;
},
/**
* Used to update the video container whenever the orientation or size of the
* display area changes.
*
* Buffer the calls to this function to make sure we don't overflow the stack
* with update calls when many 'resize' event are fired, to prevent blocking
* the event loop.
*/
updateVideoContainer: function() {
var localStreamParent = this._getElement('.local .OT_publisher');
var remoteStreamParent = this._getElement('.remote .OT_subscriber');
if (this._bufferedUpdateVideo) {
rootObject.clearTimeout(this._bufferedUpdateVideo);
this._bufferedUpdateVideo = null;
}
this._bufferedUpdateVideo = rootObject.setTimeout(function() {
this._bufferedUpdateVideo = null;
var localStreamParent = this._getElement(".local .OT_publisher");
var remoteStreamParent = this._getElement(".remote .OT_subscriber");
if (localStreamParent) {
localStreamParent.style.width = "100%";
}
if (remoteStreamParent) {
remoteStreamParent.style.height = "100%";
}
// Update the position and dimensions of the containers of local video
// streams, if necessary. The consumer of this mixin should implement the
// actual updating mechanism.
Object.keys(this._videoDimensionsCache.local).forEach(function(videoType) {
var ratio = this._videoDimensionsCache.local[videoType].aspectRatio
if (videoType == "camera" && this.updateLocalCameraPosition) {
this.updateLocalCameraPosition(ratio);
}
}, this);
}.bind(this), 0);
},
/**
@ -198,15 +386,11 @@ loop.shared.mixins = (function() {
// @see https://bugzilla.mozilla.org/show_bug.cgi?id=1020445
return {
insertMode: "append",
fitMode: "contain",
width: "100%",
height: "100%",
publishVideo: options.publishVideo,
style: {
audioLevelDisplayMode: "off",
buttonDisplayMode: "off",
nameDisplayMode: "off",
videoDisabledDisplayMode: "off"
}
showControls: false,
};
},

View File

@ -9,6 +9,7 @@ loop.OTSdkDriver = (function() {
var sharedActions = loop.shared.actions;
var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS;
var STREAM_PROPERTIES = loop.shared.utils.STREAM_PROPERTIES;
/**
* This is a wrapper for the OT sdk. It is used to translate the SDK events into
@ -51,6 +52,7 @@ loop.OTSdkDriver = (function() {
// the media.
this.publisher = this.sdk.initPublisher(this.getLocalElement(),
this.publisherConfig);
this.publisher.on("streamCreated", this._onLocalStreamCreated.bind(this));
this.publisher.on("accessAllowed", this._onPublishComplete.bind(this));
this.publisher.on("accessDenied", this._onPublishDenied.bind(this));
this.publisher.on("accessDialogOpened",
@ -91,6 +93,7 @@ loop.OTSdkDriver = (function() {
this._onConnectionDestroyed.bind(this));
this.session.on("sessionDisconnected",
this._onSessionDisconnected.bind(this));
this.session.on("streamPropertyChanged", this._onStreamPropertyChanged.bind(this));
// This starts the actual session connection.
this.session.connect(sessionData.apiKey, sessionData.sessionToken,
@ -102,12 +105,13 @@ loop.OTSdkDriver = (function() {
*/
disconnectSession: function() {
if (this.session) {
this.session.off("streamCreated connectionDestroyed sessionDisconnected");
this.session.off("streamCreated streamDestroyed connectionDestroyed " +
"sessionDisconnected streamPropertyChanged");
this.session.disconnect();
delete this.session;
}
if (this.publisher) {
this.publisher.off("accessAllowed accessDenied accessDialogOpened");
this.publisher.off("accessAllowed accessDenied accessDialogOpened streamCreated");
this.publisher.destroy();
delete this.publisher;
}
@ -234,6 +238,14 @@ loop.OTSdkDriver = (function() {
* https://tokbox.com/opentok/libraries/client/js/reference/StreamEvent.html
*/
_onRemoteStreamCreated: function(event) {
if (event.stream[STREAM_PROPERTIES.HAS_VIDEO]) {
this.dispatcher.dispatch(new sharedActions.VideoDimensionsChanged({
isLocal: false,
videoType: event.stream.videoType,
dimensions: event.stream[STREAM_PROPERTIES.VIDEO_DIMENSIONS]
}));
}
this.session.subscribe(event.stream,
this.getRemoteElement(), this.publisherConfig);
@ -243,6 +255,22 @@ loop.OTSdkDriver = (function() {
}
},
/**
* Handles the event when the local stream is created.
*
* @param {StreamEvent} event The event details:
* https://tokbox.com/opentok/libraries/client/js/reference/StreamEvent.html
*/
_onLocalStreamCreated: function(event) {
if (event.stream[STREAM_PROPERTIES.HAS_VIDEO]) {
this.dispatcher.dispatch(new sharedActions.VideoDimensionsChanged({
isLocal: true,
videoType: event.stream.videoType,
dimensions: event.stream[STREAM_PROPERTIES.VIDEO_DIMENSIONS]
}));
}
},
/**
* Called from the sdk when the media access dialog is opened.
* Prevents the default action, to prevent the SDK's "allow access"
@ -282,6 +310,19 @@ loop.OTSdkDriver = (function() {
}));
},
/**
* Handles publishing of property changes to a stream.
*/
_onStreamPropertyChanged: function(event) {
if (event.changedProperty == STREAM_PROPERTIES.VIDEO_DIMENSIONS) {
this.dispatcher.dispatch(new sharedActions.VideoDimensionsChanged({
isLocal: event.stream.connection.id == this.session.connection.id,
videoType: event.stream.videoType,
dimensions: event.stream[STREAM_PROPERTIES.VIDEO_DIMENSIONS]
}));
}
},
/**
* Publishes the local stream if the session is connected
* and the publisher is ready.

View File

@ -42,6 +42,12 @@ loop.shared.utils = (function(mozL10n) {
UNKNOWN: "reason-unknown"
};
var STREAM_PROPERTIES = {
VIDEO_DIMENSIONS: "videoDimensions",
HAS_AUDIO: "hasAudio",
HAS_VIDEO: "hasVideo"
};
/**
* Format a given date into an l10n-friendly string.
*
@ -138,6 +144,7 @@ loop.shared.utils = (function(mozL10n) {
FAILURE_DETAILS: FAILURE_DETAILS,
REST_ERRNOS: REST_ERRNOS,
WEBSOCKET_REASONS: WEBSOCKET_REASONS,
STREAM_PROPERTIES: STREAM_PROPERTIES,
Helper: Helper,
composeCallUrlEmail: composeCallUrlEmail,
formatDate: formatDate,

View File

@ -20,7 +20,6 @@
vertical-align: baseline;
}
/**
* Specific Element Reset
*/
@ -77,7 +76,6 @@
font-family: Arial, Helvetica, sans-serif;
}
.OT_root ul, .OT_root ol {
margin: 1em 1em 1em 2em;
}
@ -93,27 +91,28 @@
.OT_root dl {
margin: 4px;
}
.OT_root dl dt,
.OT_root dl dd {
.OT_root dl dt,
.OT_root dl dd {
float: left;
margin: 0;
padding: 0;
}
}
.OT_root dl dt {
.OT_root dl dt {
clear: left;
text-align: right;
width: 50px;
}
.OT_root dl dd {
}
.OT_root dl dd {
margin-left: 10px;
}
}
.OT_root img {
border: 0 none;
}
/* Modal dialog styles */
/* Modal dialog styles */
@ -166,7 +165,6 @@
text-align: center;
}
.OT_dialog-messages-main {
margin-bottom: 36px;
line-height: 36px;
@ -307,22 +305,19 @@
min-height: 48px;
}
.OT_publisher video,
.OT_subscriber video,
.OT_publisher object,
.OT_subscriber object {
.OT_publisher .OT_video-element,
.OT_subscriber .OT_video-element {
display: block;
position: absolute;
width: 100%;
height: 100%;
}
.OT_publisher object,
.OT_subscriber object {
transform-origin: 0 0;
}
/* Styles that are applied when the video element should be mirrored */
.OT_publisher.OT_mirrored video{
-webkit-transform: scale(-1, 1);
-moz-transform:scale(-1,1);
.OT_publisher.OT_mirrored .OT_video-element {
transform: scale(-1, 1);
transform-origin: 50% 50%;
}
.OT_subscriber_error {
@ -386,7 +381,7 @@
bottom: 0;
left: 34px;
padding: 0 4px;
color: rgba(255,255,255,0.8);
color: rgba(255, 255, 255, 0.8);
font-size: 15px;
line-height: 34px;
font-weight: normal;
@ -423,6 +418,7 @@
-moz-box-shadow: 0 0 5px 1px #575757;
box-shadow: 0 0 5px 1px #575757;
}
.OT_archiving-light.OT_active {
background-color: #970d13;
-webkit-animation: OT_pulse 1.3s ease-in;
@ -432,6 +428,7 @@
-moz-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
}
@-moz-keyframes OT_pulse {
0% {
-webkit-box-shadow: 0 0 0px 0px #c70019;
@ -463,6 +460,7 @@
box-shadow: 0 0 0px 0px #c70019;
}
}
@-webkit-keyframes OT_pulse {
0% {
-webkit-box-shadow: 0 0 0px 0px #c70019;
@ -494,6 +492,7 @@
box-shadow: 0 0 0px 0px #c70019;
}
}
@-o-keyframes OT_pulse {
0% {
-webkit-box-shadow: 0 0 0px 0px #c70019;
@ -525,6 +524,7 @@
box-shadow: 0 0 0px 0px #c70019;
}
}
@-ms-keyframes OT_pulse {
0% {
-webkit-box-shadow: 0 0 0px 0px #c70019;
@ -556,6 +556,7 @@
box-shadow: 0 0 0px 0px #c70019;
}
}
@-webkit-keyframes OT_pulse {
0% {
-webkit-box-shadow: 0 0 0px 0px #c70019;
@ -632,8 +633,8 @@
}
.OT_mini .OT_mute,
.OT_mute.OT_mode-mini,
.OT_mute.OT_mode-mini-auto {
.OT_publisher.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold,
.OT_subscriber.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold {
top: 50%;
left: 50%;
right: auto;
@ -672,14 +673,6 @@
/* Default display mode transitions for various chrome elements */
.OT_publisher .OT_edge-bar-item,
.OT_subscriber .OT_edge-bar-item {
-ms-transition-property: top, bottom, opacity;
-ms-transition-duration: 0.5s;
-moz-transition-property: top, bottom, opacity;
-moz-transition-duration: 0.5s;
-webkit-transition-property: top, bottom, opacity;
-webkit-transition-duration: 0.5s;
-o-transition-property: top, bottom, opacity;
-o-transition-duration: 0.5s;
transition-property: top, bottom, opacity;
transition-duration: 0.5s;
transition-timing-function: ease-in;
@ -739,8 +732,9 @@
opacity: 1;
}
/* Contains the video element, used to fix video letter-boxing */
.OT_video-container {
.OT_widget-container {
position: absolute;
background-color: #000000;
overflow: hidden;
@ -755,7 +749,7 @@
/* Load animation */
.OT_root .OT_video-loading {
background: url('../images/rtc/loader.gif') no-repeat;
display:none;
display: none;
position: absolute;
width: 32px;
height: 32px;
@ -770,26 +764,46 @@
display: block;
}
.OT_publisher.OT_loading video,
.OT_subscriber.OT_loading video,
.OT_publisher.OT_loading object,
.OT_subscriber.OT_loading object {
display: none;
.OT_publisher.OT_loading .OT_video-element,
.OT_subscriber.OT_loading .OT_video-element {
/*display: none;*/
}
.OT_video-centering {
display: table;
width: 100%;
height: 100%;
}
.OT_video-container {
display: table-cell;
vertical-align: middle;
}
.OT_video-poster {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
display: none;
opacity: .25;
background-size: auto 76%;
background-repeat: no-repeat;
background-position: center bottom;
background-image: url(../images/rtc/audioonly-silhouette.svg);
}
.OT_fit-mode-cover .OT_video-poster {
background-size: auto 76%;
background-position: center bottom;
}
.OT_fit-mode-contain .OT_video-poster {
background-size: contain;
background-position: center;
}
.OT_audio-level-meter {
position: absolute;
width: 25%;
@ -839,7 +853,7 @@
.OT_audio-level-meter__value {
position: absolute;
border-radius: 50%;
background-image: radial-gradient(circle, rgba(151,206,0,1) 0%, rgba(151,206,0,0) 100%);
background-image: radial-gradient(circle, rgba(151, 206, 0, 1) 0%, rgba(151, 206, 0, 0) 100%);
}
.OT_audio-level-meter.OT_mode-off {
@ -858,7 +872,7 @@
position: absolute;
background-color: transparent;
background-repeat: no-repeat;
background-position:bottom right;
background-position: bottom right;
top: 0;
left: 0;
bottom: 3px;

View File

@ -1,7 +1,7 @@
/*
Copyright (c) 2014 TokBox, Inc.
Released under the MIT license
http://opensource.org/licenses/MIT
*/
/**
* @license
* Copyright (c) 2014 TokBox, Inc.
* Released under the MIT license
* http://opensource.org/licenses/MIT
*/
!function(){TB.Config.replaceWith({global:{exceptionLogging:{enabled:!0,messageLimitPerPartner:100},iceServers:{enabled:!1},instrumentation:{enabled:!1,debugging:!1},tokshow:{textchat:!0}},partners:{change878:{instrumentation:{enabled:!0,debugging:!0}}}})}(TB);

File diff suppressed because it is too large Load Diff

View File

@ -224,7 +224,9 @@ loop.standaloneRoomViews = (function(mozL10n) {
* @private
*/
_onActiveRoomStateChanged: function() {
this.setState(this.props.activeRoomStore.getStoreState());
var state = this.props.activeRoomStore.getStoreState();
this.updateVideoDimensions(state.localVideoDimensions, state.remoteVideoDimensions);
this.setState(state);
},
componentDidMount: function() {
@ -283,6 +285,41 @@ loop.standaloneRoomViews = (function(mozL10n) {
}));
},
/**
* Specifically updates the local camera stream size and position, depending
* on the size and position of the remote video stream.
* This method gets called from `updateVideoContainer`, which is defined in
* the `MediaSetupMixin`.
*
* @param {Object} ratio Aspect ratio of the local camera stream
*/
updateLocalCameraPosition: function(ratio) {
var node = this._getElement(".local");
var parent = node.offsetParent || this._getElement(".media");
// The local camera view should be a sixth of the size of its offset parent
// and positioned to overlap with the remote stream at a quarter of its width.
var parentWidth = parent.offsetWidth;
var targetWidth = parentWidth / 6;
node.style.right = "auto";
if (window.matchMedia && window.matchMedia("screen and (max-width:640px)").matches) {
targetWidth = 180;
node.style.left = "auto";
} else {
// Now position the local camera view correctly with respect to the remote
// video stream.
var remoteVideoDimensions = this.getRemoteVideoDimensions();
var offsetX = (remoteVideoDimensions.streamWidth + remoteVideoDimensions.offsetX);
// The horizontal offset of the stream, and the width of the resulting
// pillarbox, is determined by the height exponent of the aspect ratio.
// Therefore we multiply the width of the local camera view by the height
// ratio.
node.style.left = (offsetX - ((targetWidth * ratio.height) / 4)) + "px";
}
node.style.width = (targetWidth * ratio.width) + "px";
node.style.height = (targetWidth * ratio.height) + "px";
},
/**
* Checks if current room is active.
*

View File

@ -224,7 +224,9 @@ loop.standaloneRoomViews = (function(mozL10n) {
* @private
*/
_onActiveRoomStateChanged: function() {
this.setState(this.props.activeRoomStore.getStoreState());
var state = this.props.activeRoomStore.getStoreState();
this.updateVideoDimensions(state.localVideoDimensions, state.remoteVideoDimensions);
this.setState(state);
},
componentDidMount: function() {
@ -283,6 +285,41 @@ loop.standaloneRoomViews = (function(mozL10n) {
}));
},
/**
* Specifically updates the local camera stream size and position, depending
* on the size and position of the remote video stream.
* This method gets called from `updateVideoContainer`, which is defined in
* the `MediaSetupMixin`.
*
* @param {Object} ratio Aspect ratio of the local camera stream
*/
updateLocalCameraPosition: function(ratio) {
var node = this._getElement(".local");
var parent = node.offsetParent || this._getElement(".media");
// The local camera view should be a sixth of the size of its offset parent
// and positioned to overlap with the remote stream at a quarter of its width.
var parentWidth = parent.offsetWidth;
var targetWidth = parentWidth / 6;
node.style.right = "auto";
if (window.matchMedia && window.matchMedia("screen and (max-width:640px)").matches) {
targetWidth = 180;
node.style.left = "auto";
} else {
// Now position the local camera view correctly with respect to the remote
// video stream.
var remoteVideoDimensions = this.getRemoteVideoDimensions();
var offsetX = (remoteVideoDimensions.streamWidth + remoteVideoDimensions.offsetX);
// The horizontal offset of the stream, and the width of the resulting
// pillarbox, is determined by the height exponent of the aspect ratio.
// Therefore we multiply the width of the local camera view by the height
// ratio.
node.style.left = (offsetX - ((targetWidth * ratio.height) / 4)) + "px";
}
node.style.width = (targetWidth * ratio.width) + "px";
node.style.height = (targetWidth * ratio.height) + "px";
},
/**
* Checks if current room is active.
*

View File

@ -68,7 +68,9 @@ describe("loop.roomViews", function () {
videoMuted: false,
failureReason: undefined,
used: false,
foo: "bar"
foo: "bar",
localVideoDimensions: {},
remoteVideoDimensions: {}
});
});

View File

@ -129,7 +129,7 @@ class Test1BrowserCall(MarionetteTestCase):
def check_remote_video(self):
video_wrapper = self.wait_for_element_displayed(
By.CSS_SELECTOR,
".media .OT_subscriber .OT_video-container", 20)
".media .OT_subscriber .OT_widget-container", 20)
video = self.wait_for_subelement_displayed(
video_wrapper, By.TAG_NAME, "video")

View File

@ -282,6 +282,31 @@ describe("loop.store.ActiveRoomStore", function () {
});
});
describe("#videoDimensionsChanged", function() {
it("should not contain any video dimensions at the very start", function() {
expect(store.getStoreState()).eql(store.getInitialStoreState());
});
it("should update the store with new video dimensions", function() {
var actionData = {
isLocal: true,
videoType: "camera",
dimensions: { width: 640, height: 480 }
};
store.videoDimensionsChanged(new sharedActions.VideoDimensionsChanged(actionData));
expect(store.getStoreState().localVideoDimensions)
.to.have.property(actionData.videoType, actionData.dimensions);
actionData.isLocal = false;
store.videoDimensionsChanged(new sharedActions.VideoDimensionsChanged(actionData));
expect(store.getStoreState().remoteVideoDimensions)
.to.have.property(actionData.videoType, actionData.dimensions);
});
});
describe("#setupRoomInfo", function() {
var fakeRoomInfo;

View File

@ -204,8 +204,16 @@ describe("loop.shared.mixins", function() {
}
});
sandbox.useFakeTimers();
rootObject = {
events: {},
setTimeout: function(func, timeout) {
return setTimeout(func, timeout);
},
clearTimeout: function(timer) {
return clearTimeout(timer);
},
addEventListener: function(eventName, listener) {
this.events[eventName] = listener;
},
@ -244,20 +252,26 @@ describe("loop.shared.mixins", function() {
describe("resize", function() {
it("should update the width on the local stream element", function() {
localElement = {
offsetWidth: 100,
offsetHeight: 100,
style: { width: "0%" }
};
rootObject.events.resize();
sandbox.clock.tick(10);
expect(localElement.style.width).eql("100%");
});
it("should update the height on the remote stream element", function() {
remoteElement = {
offsetWidth: 100,
offsetHeight: 100,
style: { height: "0%" }
};
rootObject.events.resize();
sandbox.clock.tick(10);
expect(remoteElement.style.height).eql("100%");
});
@ -266,24 +280,81 @@ describe("loop.shared.mixins", function() {
describe("orientationchange", function() {
it("should update the width on the local stream element", function() {
localElement = {
offsetWidth: 100,
offsetHeight: 100,
style: { width: "0%" }
};
rootObject.events.orientationchange();
sandbox.clock.tick(10);
expect(localElement.style.width).eql("100%");
});
it("should update the height on the remote stream element", function() {
remoteElement = {
offsetWidth: 100,
offsetHeight: 100,
style: { height: "0%" }
};
rootObject.events.orientationchange();
sandbox.clock.tick(10);
expect(remoteElement.style.height).eql("100%");
});
});
describe("Video stream dimensions", function() {
var localVideoDimensions = {
camera: {
width: 640,
height: 480
}
};
var remoteVideoDimensions = {
camera: {
width: 420,
height: 138
}
};
beforeEach(function() {
view.updateVideoDimensions(localVideoDimensions, remoteVideoDimensions);
});
it("should register video dimension updates correctly", function() {
expect(view._videoDimensionsCache.local.camera.width)
.eql(localVideoDimensions.camera.width);
expect(view._videoDimensionsCache.local.camera.height)
.eql(localVideoDimensions.camera.height);
expect(view._videoDimensionsCache.local.camera.aspectRatio.width).eql(1);
expect(view._videoDimensionsCache.local.camera.aspectRatio.height).eql(0.75);
expect(view._videoDimensionsCache.remote.camera.width)
.eql(remoteVideoDimensions.camera.width);
expect(view._videoDimensionsCache.remote.camera.height)
.eql(remoteVideoDimensions.camera.height);
expect(view._videoDimensionsCache.remote.camera.aspectRatio.width).eql(1);
expect(view._videoDimensionsCache.remote.camera.aspectRatio.height)
.eql(0.32857142857142857);
});
it("should fetch remote video stream dimensions correctly", function() {
remoteElement = {
offsetWidth: 600,
offsetHeight: 320
};
var remoteVideoDimensions = view.getRemoteVideoDimensions();
expect(remoteVideoDimensions.width).eql(remoteElement.offsetWidth);
expect(remoteVideoDimensions.height).eql(remoteElement.offsetHeight);
expect(remoteVideoDimensions.streamWidth).eql(534.8571428571429);
expect(remoteVideoDimensions.streamHeight).eql(remoteElement.offsetHeight);
expect(remoteVideoDimensions.offsetX).eql(32.571428571428555);
expect(remoteVideoDimensions.offsetY).eql(0);
});
});
});
});

View File

@ -8,6 +8,7 @@ describe("loop.OTSdkDriver", function () {
var sharedActions = loop.shared.actions;
var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS;
var STREAM_PROPERTIES = loop.shared.utils.STREAM_PROPERTIES;
var sandbox;
var dispatcher, driver, publisher, sdk, session, sessionData;
var fakeLocalElement, fakeRemoteElement, publisherConfig, fakeEvent;
@ -310,6 +311,44 @@ describe("loop.OTSdkDriver", function () {
});
});
describe("streamPropertyChanged", function() {
var fakeStream = {
connection: { id: "fake" },
videoType: "screen",
videoDimensions: {
width: 320,
height: 160
}
};
it("should not dispatch a VideoDimensionsChanged action for other properties", function() {
session.trigger("streamPropertyChanged", {
stream: fakeStream,
changedProperty: STREAM_PROPERTIES.HAS_AUDIO
});
session.trigger("streamPropertyChanged", {
stream: fakeStream,
changedProperty: STREAM_PROPERTIES.HAS_VIDEO
});
sinon.assert.notCalled(dispatcher.dispatch);
});
it("should dispatch a VideoDimensionsChanged action", function() {
session.connection = {
id: "localUser"
};
session.trigger("streamPropertyChanged", {
stream: fakeStream,
changedProperty: STREAM_PROPERTIES.VIDEO_DIMENSIONS
});
sinon.assert.calledOnce(dispatcher.dispatch);
sinon.assert.calledWithMatch(dispatcher.dispatch,
sinon.match.hasOwn("name", "videoDimensionsChanged"))
})
});
describe("connectionCreated", function() {
beforeEach(function() {
session.connection = {

View File

@ -24,7 +24,7 @@ add_task(function smart_bookmarks_disabled() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
do_check_eq(smartBookmarkItemIds.length, 0);
do_log_info("check that pref has not been bumped up");
do_print("check that pref has not been bumped up");
do_check_eq(Services.prefs.getIntPref("browser.places.smartBookmarksVersion"), -1);
});
@ -34,7 +34,7 @@ add_task(function create_smart_bookmarks() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
do_check_neq(smartBookmarkItemIds.length, 0);
do_log_info("check that pref has been bumped up");
do_print("check that pref has been bumped up");
do_check_true(Services.prefs.getIntPref("browser.places.smartBookmarksVersion") > 0);
});
@ -42,14 +42,14 @@ add_task(function remove_smart_bookmark_and_restore() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
let smartBookmarksCount = smartBookmarkItemIds.length;
do_log_info("remove one smart bookmark and restore");
do_print("remove one smart bookmark and restore");
PlacesUtils.bookmarks.removeItem(smartBookmarkItemIds[0]);
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
gluesvc.ensurePlacesDefaultQueriesInitialized();
smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
do_log_info("check that pref has been bumped up");
do_print("check that pref has been bumped up");
do_check_true(Services.prefs.getIntPref("browser.places.smartBookmarksVersion") > 0);
});
@ -57,7 +57,7 @@ add_task(function move_smart_bookmark_rename_and_restore() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
let smartBookmarksCount = smartBookmarkItemIds.length;
do_log_info("smart bookmark should be restored in place");
do_print("smart bookmark should be restored in place");
let parent = PlacesUtils.bookmarks.getFolderIdForItem(smartBookmarkItemIds[0]);
let oldTitle = PlacesUtils.bookmarks.getItemTitle(smartBookmarkItemIds[0]);
// create a subfolder and move inside it
@ -76,6 +76,6 @@ add_task(function move_smart_bookmark_rename_and_restore() {
do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
do_check_eq(PlacesUtils.bookmarks.getFolderIdForItem(smartBookmarkItemIds[0]), newParent);
do_check_eq(PlacesUtils.bookmarks.getItemTitle(smartBookmarkItemIds[0]), oldTitle);
do_log_info("check that pref has been bumped up");
do_print("check that pref has been bumped up");
do_check_true(Services.prefs.getIntPref("browser.places.smartBookmarksVersion") > 0);
});

View File

@ -63,7 +63,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import()
{
do_log_info("Import from bookmarks.html if importBookmarksHTML is true.");
do_print("Import from bookmarks.html if importBookmarksHTML is true.");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -86,7 +86,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces().
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -94,7 +94,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import_noSmartBookmarks()
{
do_log_info("import from bookmarks.html, but don't create smart bookmarks \
do_print("import from bookmarks.html, but don't create smart bookmarks \
if they are disabled");
remove_all_bookmarks();
@ -119,7 +119,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces().
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -127,7 +127,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import_autoExport_updatedSmartBookmarks()
{
do_log_info("Import from bookmarks.html, but don't create smart bookmarks \
do_print("Import from bookmarks.html, but don't create smart bookmarks \
if autoExportHTML is true and they are at latest version");
remove_all_bookmarks();
@ -154,7 +154,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -162,7 +162,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import_autoExport_oldSmartBookmarks()
{
do_log_info("Import from bookmarks.html, and create smart bookmarks if \
do_print("Import from bookmarks.html, and create smart bookmarks if \
autoExportHTML is true and they are not at latest version.");
remove_all_bookmarks();
@ -190,7 +190,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -198,7 +198,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_restore()
{
do_log_info("restore from default bookmarks.html if \
do_print("restore from default bookmarks.html if \
restore_default_bookmarks is true.");
remove_all_bookmarks();
@ -222,7 +222,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -231,7 +231,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_restore_import()
{
do_log_info("setting both importBookmarksHTML and \
do_print("setting both importBookmarksHTML and \
restore_default_bookmarks should restore defaults.");
remove_all_bookmarks();
@ -257,7 +257,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);

View File

@ -38,7 +38,7 @@ function setupBehaviorAndMigrate(aDefaultBehavior, aAutocompleteEnabled = true)
};
add_task(function*() {
do_log_info("Migrate default.behavior = 0");
do_print("Migrate default.behavior = 0");
setupBehaviorAndMigrate(0);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -52,7 +52,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 1");
do_print("Migrate default.behavior = 1");
setupBehaviorAndMigrate(1);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -66,7 +66,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 2");
do_print("Migrate default.behavior = 2");
setupBehaviorAndMigrate(2);
Assert.equal(gGetBoolPref("browser.urlbar.suggest.history"), false,
@ -80,7 +80,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 3");
do_print("Migrate default.behavior = 3");
setupBehaviorAndMigrate(3);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -94,7 +94,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 19");
do_print("Migrate default.behavior = 19");
setupBehaviorAndMigrate(19);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -108,7 +108,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 33");
do_print("Migrate default.behavior = 33");
setupBehaviorAndMigrate(33);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -122,7 +122,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 129");
do_print("Migrate default.behavior = 129");
setupBehaviorAndMigrate(129);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -136,7 +136,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 0, autocomplete.enabled = false");
do_print("Migrate default.behavior = 0, autocomplete.enabled = false");
setupBehaviorAndMigrate(0, false);
Assert.equal(gGetBoolPref("browser.urlbar.suggest.history"), false,

View File

@ -6,6 +6,15 @@
const PAGE_1 = "data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
const PAGE_2 = "data:text/html,<html><body>Another%20regular,%20everyday,%20normal%20page.";
// Turn off tab animations for testing
Services.prefs.setBoolPref("browser.tabs.animate", false);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("browser.tabs.animate");
});
// Allow tabs to restore on demand so we can test pending states
Services.prefs.clearUserPref("browser.sessionstore.restore_on_demand");
/**
* Returns a Promise that resolves once a remote <xul:browser> has experienced
* a crash. Also does the job of cleaning up the minidump of the crash.
@ -58,6 +67,7 @@ function crashBrowser(browser) {
}
Services.obs.removeObserver(observer, 'ipc:content-shutdown');
info("Crash cleaned up");
resolve();
};
@ -67,6 +77,7 @@ function crashBrowser(browser) {
let aboutTabCrashedLoadPromise = new Promise((resolve, reject) => {
browser.addEventListener("AboutTabCrashedLoad", function onCrash() {
browser.removeEventListener("AboutTabCrashedLoad", onCrash, false);
info("about:tabcrashed loaded");
resolve();
}, false, true);
});
@ -75,7 +86,22 @@ function crashBrowser(browser) {
// evaluated.
let mm = browser.messageManager;
mm.loadFrameScript("data:,(" + frame_script.toString() + ")();", false);
return Promise.all([crashCleanupPromise, aboutTabCrashedLoadPromise]);
return Promise.all([crashCleanupPromise, aboutTabCrashedLoadPromise]).then(() => {
let tab = gBrowser.getTabForBrowser(browser);
is(tab.getAttribute("crashed"), "true", "Tab should be marked as crashed");
});
}
function clickButton(browser, id) {
info("Clicking " + id);
let frame_script = (id) => {
let button = content.document.getElementById(id);
button.click();
};
let mm = browser.messageManager;
mm.loadFrameScript("data:,(" + frame_script.toString() + ")('" + id + "');", false);
}
/**
@ -194,8 +220,6 @@ add_task(function test_crash_page_not_in_history() {
// Crash the tab
yield crashBrowser(browser);
// Flush out any notifications from the crashed browser.
TabState.flush(browser);
// Check the tab state and make sure the tab crashed page isn't
// mentioned.
@ -225,13 +249,12 @@ add_task(function test_revived_history_from_remote() {
// Crash the tab
yield crashBrowser(browser);
// Flush out any notifications from the crashed browser.
TabState.flush(browser);
// Browse to a new site that will cause the browser to
// become remote again.
browser.loadURI(PAGE_2);
yield promiseTabRestored(newTab);
ok(!newTab.hasAttribute("crashed"), "Tab shouldn't be marked as crashed anymore.");
ok(browser.isRemoteBrowser, "Should be a remote browser");
TabState.flush(browser);
@ -265,13 +288,12 @@ add_task(function test_revived_history_from_non_remote() {
// Crash the tab
yield crashBrowser(browser);
// Flush out any notifications from the crashed browser.
TabState.flush(browser);
// Browse to a new site that will not cause the browser to
// become remote again.
browser.loadURI("about:mozilla");
yield promiseBrowserLoaded(browser);
ok(!newTab.hasAttribute("crashed"), "Tab shouldn't be marked as crashed anymore.");
ok(!browser.isRemoteBrowser, "Should not be a remote browser");
TabState.flush(browser);
@ -301,6 +323,14 @@ add_task(function test_revive_tab_from_session_store() {
browser.loadURI(PAGE_1);
yield promiseBrowserLoaded(browser);
let newTab2 = gBrowser.addTab();
let browser2 = newTab2.linkedBrowser;
ok(browser2.isRemoteBrowser, "Should be a remote browser");
yield promiseBrowserLoaded(browser2);
browser.loadURI(PAGE_1);
yield promiseBrowserLoaded(browser);
browser.loadURI(PAGE_2);
yield promiseBrowserLoaded(browser);
@ -308,12 +338,13 @@ add_task(function test_revive_tab_from_session_store() {
// Crash the tab
yield crashBrowser(browser);
// Flush out any notifications from the crashed browser.
TabState.flush(browser);
is(newTab2.getAttribute("crashed"), "true", "Second tab should be crashed too.");
// Use SessionStore to revive the tab
SessionStore.reviveCrashedTab(newTab);
yield promiseBrowserLoaded(browser);
clickButton(browser, "restoreTab");
yield promiseTabRestored(newTab);
ok(!newTab.hasAttribute("crashed"), "Tab shouldn't be marked as crashed anymore.");
is(newTab2.getAttribute("crashed"), "true", "Second tab should still be crashed though.");
// We can't just check browser.currentURI.spec, because from
// the outside, a crashed tab has the same URI as the page
@ -325,4 +356,90 @@ add_task(function test_revive_tab_from_session_store() {
yield promiseHistoryLength(browser, 2);
gBrowser.removeTab(newTab);
gBrowser.removeTab(newTab2);
});
/**
* Checks that we can revive a crashed tab back to the page that
* it was on when it crashed.
*/
add_task(function test_revive_all_tabs_from_session_store() {
let newTab = gBrowser.addTab();
gBrowser.selectedTab = newTab;
let browser = newTab.linkedBrowser;
ok(browser.isRemoteBrowser, "Should be a remote browser");
yield promiseBrowserLoaded(browser);
browser.loadURI(PAGE_1);
yield promiseBrowserLoaded(browser);
let newTab2 = gBrowser.addTab(PAGE_1);
let browser2 = newTab2.linkedBrowser;
ok(browser2.isRemoteBrowser, "Should be a remote browser");
yield promiseBrowserLoaded(browser2);
browser.loadURI(PAGE_1);
yield promiseBrowserLoaded(browser);
browser.loadURI(PAGE_2);
yield promiseBrowserLoaded(browser);
TabState.flush(browser);
TabState.flush(browser2);
// Crash the tab
yield crashBrowser(browser);
is(newTab2.getAttribute("crashed"), "true", "Second tab should be crashed too.");
// Use SessionStore to revive all the tabs
clickButton(browser, "restoreAll");
yield promiseTabRestored(newTab);
ok(!newTab.hasAttribute("crashed"), "Tab shouldn't be marked as crashed anymore.");
ok(!newTab.hasAttribute("pending"), "Tab shouldn't be pending.");
ok(!newTab2.hasAttribute("crashed"), "Second tab shouldn't be marked as crashed anymore.");
ok(newTab2.hasAttribute("pending"), "Second tab should be pending.");
gBrowser.selectedTab = newTab2;
yield promiseTabRestored(newTab2);
ok(!newTab2.hasAttribute("pending"), "Second tab shouldn't be pending.");
// We can't just check browser.currentURI.spec, because from
// the outside, a crashed tab has the same URI as the page
// it crashed on (much like an about:neterror page). Instead,
// we have to use the documentURI on the content.
yield promiseContentDocumentURIEquals(browser, PAGE_2);
yield promiseContentDocumentURIEquals(browser2, PAGE_1);
// We should also have two entries in the browser history.
yield promiseHistoryLength(browser, 2);
gBrowser.removeTab(newTab);
gBrowser.removeTab(newTab2);
});
/**
* Checks that about:tabcrashed can close the current tab
*/
add_task(function test_close_tab_after_crash() {
let newTab = gBrowser.addTab();
gBrowser.selectedTab = newTab;
let browser = newTab.linkedBrowser;
ok(browser.isRemoteBrowser, "Should be a remote browser");
yield promiseBrowserLoaded(browser);
browser.loadURI(PAGE_1);
yield promiseBrowserLoaded(browser);
TabState.flush(browser);
// Crash the tab
yield crashBrowser(browser);
let promise = promiseEvent(gBrowser.tabContainer, "TabClose");
// Click the close tab button
clickButton(browser, "closeTab");
yield promise;
is(gBrowser.tabs.length, 1, "Should have closed the tab");
});

View File

@ -488,15 +488,19 @@ function promiseDelayedStartupFinished(aWindow) {
return new Promise(resolve => whenDelayedStartupFinished(aWindow, resolve));
}
function promiseTabRestored(tab) {
function promiseEvent(element, eventType, isCapturing = false) {
return new Promise(resolve => {
tab.addEventListener("SSTabRestored", function onRestored() {
tab.removeEventListener("SSTabRestored", onRestored);
resolve();
});
element.addEventListener(eventType, function listener(event) {
element.removeEventListener(eventType, listener, isCapturing);
resolve(event);
}, isCapturing);
});
}
function promiseTabRestored(tab) {
return promiseEvent(tab, "SSTabRestored");
}
function sendMessage(browser, name, data = {}) {
browser.messageManager.sendAsyncMessage(name, data);
return promiseContentMessage(browser, name);

View File

@ -16,6 +16,16 @@ function test() {
UITourTest();
}
function runOffline(fun) {
return (done) => {
Services.io.offline = true;
fun(function onComplete() {
Services.io.offline = false;
done();
});
}
}
let tests = [
taskify(function* test_menu_show_hide() {
ise(loopButton.open, false, "Menu should initially be closed");
@ -94,7 +104,7 @@ let tests = [
});
});
},
function test_notifyLoopChatWindowOpenedClosed(done) {
runOffline(function test_notifyLoopChatWindowOpenedClosed(done) {
gContentAPI.observe((event, params) => {
is(event, "Loop:ChatWindowOpened", "Check Loop:ChatWindowOpened notification");
gContentAPI.observe((event, params) => {
@ -110,8 +120,8 @@ let tests = [
document.querySelector("#pinnedchats > chatbox").close();
});
LoopRooms.open("fakeTourRoom");
},
function test_notifyLoopRoomURLCopied(done) {
}),
runOffline(function test_notifyLoopRoomURLCopied(done) {
gContentAPI.observe((event, params) => {
is(event, "Loop:ChatWindowOpened", "Loop chat window should've opened");
gContentAPI.observe((event, params) => {
@ -131,8 +141,8 @@ let tests = [
});
setupFakeRoom();
LoopRooms.open("fakeTourRoom");
},
function test_notifyLoopRoomURLEmailed(done) {
}),
runOffline(function test_notifyLoopRoomURLEmailed(done) {
gContentAPI.observe((event, params) => {
is(event, "Loop:ChatWindowOpened", "Loop chat window should've opened");
gContentAPI.observe((event, params) => {
@ -162,7 +172,7 @@ let tests = [
});
});
LoopRooms.open("fakeTourRoom");
},
}),
taskify(function* test_arrow_panel_position() {
ise(loopButton.open, false, "Menu should initially be closed");
let popup = document.getElementById("UITourTooltip");
@ -274,6 +284,7 @@ if (Services.prefs.getBoolPref("loop.enabled")) {
Services.prefs.clearUserPref("loop.gettingStarted.resumeOnFirstJoin");
Services.prefs.clearUserPref("loop.gettingStarted.seen");
Services.prefs.clearUserPref("loop.gettingStarted.url");
Services.io.offline = false;
// Copied from browser/components/loop/test/mochitest/head.js
// Remove the iframe after each test. This also avoids mochitest complaining

View File

@ -1,4 +1,4 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.0.1040
Current extension version is: 1.0.1130

View File

@ -349,7 +349,11 @@ ChromeActions.prototype = {
return (!!prefBrowser && prefGfx);
},
supportsDocumentColors: function() {
return getBoolPref('browser.display.use_document_colors', true);
if (getIntPref('browser.display.document_color_use', 0) === 2 ||
!getBoolPref('browser.display.use_document_colors', true)) {
return false;
}
return true;
},
reportTelemetry: function (data) {
var probeInfo = JSON.parse(data);

View File

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {};
}
PDFJS.version = '1.0.1040';
PDFJS.build = '997096f';
PDFJS.version = '1.0.1130';
PDFJS.build = 'e4f0ae2';
(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
@ -341,6 +341,7 @@ function isValidUrl(url, allowRelative) {
case 'https':
case 'ftp':
case 'mailto':
case 'tel':
return true;
default:
return false;
@ -470,6 +471,8 @@ var XRefParseException = (function XRefParseExceptionClosure() {
function bytesToString(bytes) {
assert(bytes !== null && typeof bytes === 'object' &&
bytes.length !== undefined, 'Invalid argument for bytesToString');
var length = bytes.length;
var MAX_ARGUMENT_COUNT = 8192;
if (length < MAX_ARGUMENT_COUNT) {
@ -485,6 +488,7 @@ function bytesToString(bytes) {
}
function stringToBytes(str) {
assert(typeof str === 'string', 'Invalid argument for stringToBytes');
var length = str.length;
var bytes = new Uint8Array(length);
for (var i = 0; i < length; ++i) {
@ -1374,6 +1378,9 @@ PDFJS.disableStream = (PDFJS.disableStream === undefined ?
* Disable pre-fetching of PDF file data. When range requests are enabled PDF.js
* will automatically keep fetching more data even if it isn't needed to display
* the current page. This default behavior can be disabled.
*
* NOTE: It is also necessary to disable streaming, see above,
* in order for disabling of pre-fetching to work correctly.
* @var {boolean}
*/
PDFJS.disableAutoFetch = (PDFJS.disableAutoFetch === undefined ?
@ -1437,7 +1444,9 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
*
* @typedef {Object} DocumentInitParameters
* @property {string} url - The URL of the PDF.
* @property {TypedArray} data - A typed array with PDF data.
* @property {TypedArray|Array|string} data - Binary PDF data. Use typed arrays
* (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded,
* use atob() to convert it to a binary string first.
* @property {Object} httpHeaders - Basic authentication headers.
* @property {boolean} withCredentials - Indicates whether or not cross-site
* Access-Control requests should be made using credentials such as cookies
@ -1446,6 +1455,9 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
* @property {TypedArray} initialData - A typed array with the first portion or
* all of the pdf data. Used by the extension since some data is already
* loaded before the switch to range requests.
* @property {number} length - The PDF file length. It's used for progress
* reports and range requests operations.
* @property {PDFDataRangeTransport} range
*/
/**
@ -1462,68 +1474,226 @@ PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ?
* is used, which means it must follow the same origin rules that any XHR does
* e.g. No cross domain requests without CORS.
*
* @param {string|TypedArray|DocumentInitParameters} source Can be a url to
* where a PDF is located, a typed array (Uint8Array) already populated with
* data or parameter object.
* @param {string|TypedArray|DocumentInitParameters|PDFDataRangeTransport} src
* Can be a url to where a PDF is located, a typed array (Uint8Array)
* already populated with data or parameter object.
*
* @param {Object} pdfDataRangeTransport is optional. It is used if you want
* to manually serve range requests for data in the PDF. See viewer.js for
* an example of pdfDataRangeTransport's interface.
* @param {PDFDataRangeTransport} pdfDataRangeTransport (deprecated) It is used
* if you want to manually serve range requests for data in the PDF.
*
* @param {function} passwordCallback is optional. It is used to request a
* @param {function} passwordCallback (deprecated) It is used to request a
* password if wrong or no password was provided. The callback receives two
* parameters: function that needs to be called with new password and reason
* (see {PasswordResponses}).
*
* @param {function} progressCallback is optional. It is used to be able to
* @param {function} progressCallback (deprecated) It is used to be able to
* monitor the loading progress of the PDF file (necessary to implement e.g.
* a loading bar). The callback receives an {Object} with the properties:
* {number} loaded and {number} total.
*
* @return {Promise} A promise that is resolved with {@link PDFDocumentProxy}
* object.
* @return {PDFDocumentLoadingTask}
*/
PDFJS.getDocument = function getDocument(source,
PDFJS.getDocument = function getDocument(src,
pdfDataRangeTransport,
passwordCallback,
progressCallback) {
var workerInitializedCapability, workerReadyCapability, transport;
var task = new PDFDocumentLoadingTask();
if (typeof source === 'string') {
source = { url: source };
} else if (isArrayBuffer(source)) {
source = { data: source };
} else if (typeof source !== 'object') {
// Support of the obsolete arguments (for compatibility with API v1.0)
if (pdfDataRangeTransport) {
if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) {
// Not a PDFDataRangeTransport instance, trying to add missing properties.
pdfDataRangeTransport = Object.create(pdfDataRangeTransport);
pdfDataRangeTransport.length = src.length;
pdfDataRangeTransport.initialData = src.initialData;
}
src = Object.create(src);
src.range = pdfDataRangeTransport;
}
task.onPassword = passwordCallback || null;
task.onProgress = progressCallback || null;
var workerInitializedCapability, transport;
var source;
if (typeof src === 'string') {
source = { url: src };
} else if (isArrayBuffer(src)) {
source = { data: src };
} else if (src instanceof PDFDataRangeTransport) {
source = { range: src };
} else {
if (typeof src !== 'object') {
error('Invalid parameter in getDocument, need either Uint8Array, ' +
'string or a parameter object');
}
if (!source.url && !source.data) {
error('Invalid parameter array, need either .data or .url');
if (!src.url && !src.data && !src.range) {
error('Invalid parameter object: need either .data, .range or .url');
}
source = src;
}
// copy/use all keys as is except 'url' -- full path is required
var params = {};
for (var key in source) {
if (key === 'url' && typeof window !== 'undefined') {
// The full path is required in the 'url' field.
params[key] = combineUrl(window.location.href, source[key]);
continue;
} else if (key === 'range') {
continue;
} else if (key === 'data' && !(source[key] instanceof Uint8Array)) {
// Converting string or array-like data to Uint8Array.
var pdfBytes = source[key];
if (typeof pdfBytes === 'string') {
params[key] = stringToBytes(pdfBytes);
} else if (typeof pdfBytes === 'object' && pdfBytes !== null &&
!isNaN(pdfBytes.length)) {
params[key] = new Uint8Array(pdfBytes);
} else {
error('Invalid PDF binary data: either typed array, string or ' +
'array-like object is expected in the data property.');
}
continue;
}
params[key] = source[key];
}
workerInitializedCapability = createPromiseCapability();
workerReadyCapability = createPromiseCapability();
transport = new WorkerTransport(workerInitializedCapability,
workerReadyCapability, pdfDataRangeTransport,
progressCallback);
transport = new WorkerTransport(workerInitializedCapability, source.range);
workerInitializedCapability.promise.then(function transportInitialized() {
transport.passwordCallback = passwordCallback;
transport.fetchDocument(params);
transport.fetchDocument(task, params);
});
return workerReadyCapability.promise;
return task;
};
/**
* PDF document loading operation.
* @class
*/
var PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() {
/** @constructs PDFDocumentLoadingTask */
function PDFDocumentLoadingTask() {
this._capability = createPromiseCapability();
/**
* Callback to request a password if wrong or no password was provided.
* The callback receives two parameters: function that needs to be called
* with new password and reason (see {PasswordResponses}).
*/
this.onPassword = null;
/**
* Callback to be able to monitor the loading progress of the PDF file
* (necessary to implement e.g. a loading bar). The callback receives
* an {Object} with the properties: {number} loaded and {number} total.
*/
this.onProgress = null;
}
PDFDocumentLoadingTask.prototype =
/** @lends PDFDocumentLoadingTask.prototype */ {
/**
* @return {Promise}
*/
get promise() {
return this._capability.promise;
},
// TODO add cancel or abort method
/**
* Registers callbacks to indicate the document loading completion.
*
* @param {function} onFulfilled The callback for the loading completion.
* @param {function} onRejected The callback for the loading failure.
* @return {Promise} A promise that is resolved after the onFulfilled or
* onRejected callback.
*/
then: function PDFDocumentLoadingTask_then(onFulfilled, onRejected) {
return this.promise.then.apply(this.promise, arguments);
}
};
return PDFDocumentLoadingTask;
})();
/**
* Abstract class to support range requests file loading.
* @class
*/
var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() {
/**
* @constructs PDFDataRangeTransport
* @param {number} length
* @param {Uint8Array} initialData
*/
function PDFDataRangeTransport(length, initialData) {
this.length = length;
this.initialData = initialData;
this._rangeListeners = [];
this._progressListeners = [];
this._progressiveReadListeners = [];
this._readyCapability = createPromiseCapability();
}
PDFDataRangeTransport.prototype =
/** @lends PDFDataRangeTransport.prototype */ {
addRangeListener:
function PDFDataRangeTransport_addRangeListener(listener) {
this._rangeListeners.push(listener);
},
addProgressListener:
function PDFDataRangeTransport_addProgressListener(listener) {
this._progressListeners.push(listener);
},
addProgressiveReadListener:
function PDFDataRangeTransport_addProgressiveReadListener(listener) {
this._progressiveReadListeners.push(listener);
},
onDataRange: function PDFDataRangeTransport_onDataRange(begin, chunk) {
var listeners = this._rangeListeners;
for (var i = 0, n = listeners.length; i < n; ++i) {
listeners[i](begin, chunk);
}
},
onDataProgress: function PDFDataRangeTransport_onDataProgress(loaded) {
this._readyCapability.promise.then(function () {
var listeners = this._progressListeners;
for (var i = 0, n = listeners.length; i < n; ++i) {
listeners[i](loaded);
}
}.bind(this));
},
onDataProgressiveRead:
function PDFDataRangeTransport_onDataProgress(chunk) {
this._readyCapability.promise.then(function () {
var listeners = this._progressiveReadListeners;
for (var i = 0, n = listeners.length; i < n; ++i) {
listeners[i](chunk);
}
}.bind(this));
},
transportReady: function PDFDataRangeTransport_transportReady() {
this._readyCapability.resolve();
},
requestDataRange:
function PDFDataRangeTransport_requestDataRange(begin, end) {
throw new Error('Abstract method PDFDataRangeTransport.requestDataRange');
}
};
return PDFDataRangeTransport;
})();
PDFJS.PDFDataRangeTransport = PDFDataRangeTransport;
/**
* Proxy to a PDFDocument in the worker thread. Also, contains commonly used
* properties that can be read synchronously.
@ -1639,7 +1809,7 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
return this.transport.downloadInfoCapability.promise;
},
/**
* @returns {Promise} A promise this is resolved with current stats about
* @return {Promise} A promise this is resolved with current stats about
* document structures (see {@link PDFDocumentStats}).
*/
getStats: function PDFDocumentProxy_getStats() {
@ -1703,7 +1873,7 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
* (default value is 'display').
* @property {Object} imageLayer - (optional) An object that has beginLayout,
* endLayout and appendImage functions.
* @property {function} continueCallback - (optional) A function that will be
* @property {function} continueCallback - (deprecated) A function that will be
* called each time the rendering is paused. To continue
* rendering call the function that is the first argument
* to the callback.
@ -1836,7 +2006,12 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
intentState.renderTasks = [];
}
intentState.renderTasks.push(internalRenderTask);
var renderTask = new RenderTask(internalRenderTask);
var renderTask = internalRenderTask.task;
// Obsolete parameter support
if (params.continueCallback) {
renderTask.onContinue = params.continueCallback;
}
var self = this;
intentState.displayReadyCapability.promise.then(
@ -2001,19 +2176,16 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
* @ignore
*/
var WorkerTransport = (function WorkerTransportClosure() {
function WorkerTransport(workerInitializedCapability, workerReadyCapability,
pdfDataRangeTransport, progressCallback) {
function WorkerTransport(workerInitializedCapability, pdfDataRangeTransport) {
this.pdfDataRangeTransport = pdfDataRangeTransport;
this.workerInitializedCapability = workerInitializedCapability;
this.workerReadyCapability = workerReadyCapability;
this.progressCallback = progressCallback;
this.commonObjs = new PDFObjects();
this.loadingTask = null;
this.pageCache = [];
this.pagePromises = [];
this.downloadInfoCapability = createPromiseCapability();
this.passwordCallback = null;
// If worker support isn't disabled explicit and the browser has worker
// support, create a new web worker and test if it/the browser fullfills
@ -2152,48 +2324,50 @@ var WorkerTransport = (function WorkerTransportClosure() {
this.numPages = data.pdfInfo.numPages;
var pdfDocument = new PDFDocumentProxy(pdfInfo, this);
this.pdfDocument = pdfDocument;
this.workerReadyCapability.resolve(pdfDocument);
this.loadingTask._capability.resolve(pdfDocument);
}, this);
messageHandler.on('NeedPassword',
function transportNeedPassword(exception) {
if (this.passwordCallback) {
return this.passwordCallback(updatePassword,
var loadingTask = this.loadingTask;
if (loadingTask.onPassword) {
return loadingTask.onPassword(updatePassword,
PasswordResponses.NEED_PASSWORD);
}
this.workerReadyCapability.reject(
loadingTask._capability.reject(
new PasswordException(exception.message, exception.code));
}, this);
messageHandler.on('IncorrectPassword',
function transportIncorrectPassword(exception) {
if (this.passwordCallback) {
return this.passwordCallback(updatePassword,
var loadingTask = this.loadingTask;
if (loadingTask.onPassword) {
return loadingTask.onPassword(updatePassword,
PasswordResponses.INCORRECT_PASSWORD);
}
this.workerReadyCapability.reject(
loadingTask._capability.reject(
new PasswordException(exception.message, exception.code));
}, this);
messageHandler.on('InvalidPDF', function transportInvalidPDF(exception) {
this.workerReadyCapability.reject(
this.loadingTask._capability.reject(
new InvalidPDFException(exception.message));
}, this);
messageHandler.on('MissingPDF', function transportMissingPDF(exception) {
this.workerReadyCapability.reject(
this.loadingTask._capability.reject(
new MissingPDFException(exception.message));
}, this);
messageHandler.on('UnexpectedResponse',
function transportUnexpectedResponse(exception) {
this.workerReadyCapability.reject(
this.loadingTask._capability.reject(
new UnexpectedResponseException(exception.message, exception.status));
}, this);
messageHandler.on('UnknownError',
function transportUnknownError(exception) {
this.workerReadyCapability.reject(
this.loadingTask._capability.reject(
new UnknownErrorException(exception.message, exception.details));
}, this);
@ -2288,8 +2462,9 @@ var WorkerTransport = (function WorkerTransportClosure() {
}, this);
messageHandler.on('DocProgress', function transportDocProgress(data) {
if (this.progressCallback) {
this.progressCallback({
var loadingTask = this.loadingTask;
if (loadingTask.onProgress) {
loadingTask.onProgress({
loaded: data.loaded,
total: data.total
});
@ -2349,10 +2524,16 @@ var WorkerTransport = (function WorkerTransportClosure() {
});
},
fetchDocument: function WorkerTransport_fetchDocument(source) {
fetchDocument: function WorkerTransport_fetchDocument(loadingTask, source) {
this.loadingTask = loadingTask;
source.disableAutoFetch = PDFJS.disableAutoFetch;
source.disableStream = PDFJS.disableStream;
source.chunkedViewerLoading = !!this.pdfDataRangeTransport;
if (this.pdfDataRangeTransport) {
source.length = this.pdfDataRangeTransport.length;
source.initialData = this.pdfDataRangeTransport.initialData;
}
this.messageHandler.send('GetDocRequest', {
source: source,
disableRange: PDFJS.disableRange,
@ -2563,26 +2744,37 @@ var PDFObjects = (function PDFObjectsClosure() {
*/
var RenderTask = (function RenderTaskClosure() {
function RenderTask(internalRenderTask) {
this.internalRenderTask = internalRenderTask;
this._internalRenderTask = internalRenderTask;
/**
* Promise for rendering task completion.
* @type {Promise}
* Callback for incremental rendering -- a function that will be called
* each time the rendering is paused. To continue rendering call the
* function that is the first argument to the callback.
* @type {function}
*/
this.promise = this.internalRenderTask.capability.promise;
this.onContinue = null;
}
RenderTask.prototype = /** @lends RenderTask.prototype */ {
/**
* Promise for rendering task completion.
* @return {Promise}
*/
get promise() {
return this._internalRenderTask.capability.promise;
},
/**
* Cancels the rendering task. If the task is currently rendering it will
* not be cancelled until graphics pauses with a timeout. The promise that
* this object extends will resolved when cancelled.
*/
cancel: function RenderTask_cancel() {
this.internalRenderTask.cancel();
this._internalRenderTask.cancel();
},
/**
* Registers callback to indicate the rendering task completion.
* Registers callbacks to indicate the rendering task completion.
*
* @param {function} onFulfilled The callback for the rendering completion.
* @param {function} onRejected The callback for the rendering failure.
@ -2590,7 +2782,7 @@ var RenderTask = (function RenderTaskClosure() {
* onRejected callback.
*/
then: function RenderTask_then(onFulfilled, onRejected) {
return this.promise.then(onFulfilled, onRejected);
return this.promise.then.apply(this.promise, arguments);
}
};
@ -2617,6 +2809,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
this.graphicsReady = false;
this.cancelled = false;
this.capability = createPromiseCapability();
this.task = new RenderTask(this);
// caching this-bound methods
this._continueBound = this._continue.bind(this);
this._scheduleNextBound = this._scheduleNext.bind(this);
@ -2679,8 +2872,8 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
if (this.cancelled) {
return;
}
if (this.params.continueCallback) {
this.params.continueCallback(this._scheduleNextBound);
if (this.task.onContinue) {
this.task.onContinue.call(this.task, this._scheduleNextBound);
} else {
this._scheduleNext();
}

View File

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {};
}
PDFJS.version = '1.0.1040';
PDFJS.build = '997096f';
PDFJS.version = '1.0.1130';
PDFJS.build = 'e4f0ae2';
(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
@ -341,6 +341,7 @@ function isValidUrl(url, allowRelative) {
case 'https':
case 'ftp':
case 'mailto':
case 'tel':
return true;
default:
return false;
@ -470,6 +471,8 @@ var XRefParseException = (function XRefParseExceptionClosure() {
function bytesToString(bytes) {
assert(bytes !== null && typeof bytes === 'object' &&
bytes.length !== undefined, 'Invalid argument for bytesToString');
var length = bytes.length;
var MAX_ARGUMENT_COUNT = 8192;
if (length < MAX_ARGUMENT_COUNT) {
@ -485,6 +488,7 @@ function bytesToString(bytes) {
}
function stringToBytes(str) {
assert(typeof str === 'string', 'Invalid argument for stringToBytes');
var length = str.length;
var bytes = new Uint8Array(length);
for (var i = 0; i < length; ++i) {
@ -1449,6 +1453,9 @@ var ChunkedStream = (function ChunkedStreamClosure() {
getUint16: function ChunkedStream_getUint16() {
var b0 = this.getByte();
var b1 = this.getByte();
if (b0 === -1 || b1 === -1) {
return -1;
}
return (b0 << 8) + b1;
},
@ -14056,7 +14063,7 @@ var SpecialPUASymbols = {
'63731': 0x23A9, // braceleftbt (0xF8F3)
'63740': 0x23AB, // bracerighttp (0xF8FC)
'63741': 0x23AC, // bracerightmid (0xF8FD)
'63742': 0x23AD, // bracerightmid (0xF8FE)
'63742': 0x23AD, // bracerightbt (0xF8FE)
'63726': 0x23A1, // bracketlefttp (0xF8EE)
'63727': 0x23A2, // bracketleftex (0xF8EF)
'63728': 0x23A3, // bracketleftbt (0xF8F0)
@ -15996,7 +16003,7 @@ var Font = (function FontClosure() {
// to be used with the canvas.font.
var fontName = name.replace(/[,_]/g, '-');
var isStandardFont = !!stdFontMap[fontName] ||
(nonStdFontMap[fontName] && !!stdFontMap[nonStdFontMap[fontName]]);
!!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]);
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
this.bold = (fontName.search(/bold/gi) !== -1);
@ -29595,6 +29602,102 @@ var Parser = (function ParserClosure() {
}
return ((stream.pos - 4) - startPos);
},
/**
* Find the EOI (end-of-image) marker 0xFFD9 of the stream.
* @returns {number} The inline stream length.
*/
findDCTDecodeInlineStreamEnd:
function Parser_findDCTDecodeInlineStreamEnd(stream) {
var startPos = stream.pos, foundEOI = false, b, markerLength, length;
while ((b = stream.getByte()) !== -1) {
if (b !== 0xFF) { // Not a valid marker.
continue;
}
switch (stream.getByte()) {
case 0x00: // Byte stuffing.
// 0xFF00 appears to be a very common byte sequence in JPEG images.
break;
case 0xFF: // Fill byte.
// Avoid skipping a valid marker, resetting the stream position.
stream.skip(-1);
break;
case 0xD9: // EOI
foundEOI = true;
break;
case 0xC0: // SOF0
case 0xC1: // SOF1
case 0xC2: // SOF2
case 0xC3: // SOF3
case 0xC5: // SOF5
case 0xC6: // SOF6
case 0xC7: // SOF7
case 0xC9: // SOF9
case 0xCA: // SOF10
case 0xCB: // SOF11
case 0xCD: // SOF13
case 0xCE: // SOF14
case 0xCF: // SOF15
case 0xC4: // DHT
case 0xCC: // DAC
case 0xDA: // SOS
case 0xDB: // DQT
case 0xDC: // DNL
case 0xDD: // DRI
case 0xDE: // DHP
case 0xDF: // EXP
case 0xE0: // APP0
case 0xE1: // APP1
case 0xE2: // APP2
case 0xE3: // APP3
case 0xE4: // APP4
case 0xE5: // APP5
case 0xE6: // APP6
case 0xE7: // APP7
case 0xE8: // APP8
case 0xE9: // APP9
case 0xEA: // APP10
case 0xEB: // APP11
case 0xEC: // APP12
case 0xED: // APP13
case 0xEE: // APP14
case 0xEF: // APP15
case 0xFE: // COM
// The marker should be followed by the length of the segment.
markerLength = stream.getUint16();
if (markerLength > 2) {
// |markerLength| contains the byte length of the marker segment,
// including its own length (2 bytes) and excluding the marker.
stream.skip(markerLength - 2); // Jump to the next marker.
} else {
// The marker length is invalid, resetting the stream position.
stream.skip(-2);
}
break;
}
if (foundEOI) {
break;
}
}
length = stream.pos - startPos;
if (b === -1) {
warn('Inline DCTDecode image stream: ' +
'EOI marker not found, searching for /EI/ instead.');
stream.skip(-length); // Reset the stream position.
return this.findDefaultInlineStreamEnd(stream);
}
this.inlineStreamSkipEI(stream);
return length;
},
/**
* Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream.
* @returns {number} The inline stream length.
@ -29686,7 +29789,9 @@ var Parser = (function ParserClosure() {
// Parse image stream.
var startPos = stream.pos, length, i, ii;
if (filterName === 'ASCII85Decide' || filterName === 'A85') {
if (filterName === 'DCTDecode' || filterName === 'DCT') {
length = this.findDCTDecodeInlineStreamEnd(stream);
} else if (filterName === 'ASCII85Decide' || filterName === 'A85') {
length = this.findASCII85DecodeInlineStreamEnd(stream);
} else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') {
length = this.findASCIIHexDecodeInlineStreamEnd(stream);
@ -30613,6 +30718,9 @@ var Stream = (function StreamClosure() {
getUint16: function Stream_getUint16() {
var b0 = this.getByte();
var b1 = this.getByte();
if (b0 === -1 || b1 === -1) {
return -1;
}
return (b0 << 8) + b1;
},
getInt32: function Stream_getInt32() {
@ -30740,6 +30848,9 @@ var DecodeStream = (function DecodeStreamClosure() {
getUint16: function DecodeStream_getUint16() {
var b0 = this.getByte();
var b1 = this.getByte();
if (b0 === -1 || b1 === -1) {
return -1;
}
return (b0 << 8) + b1;
},
getInt32: function DecodeStream_getInt32() {
@ -34839,11 +34950,6 @@ var JpxImage = (function JpxImageClosure() {
context.QCC = [];
context.COC = [];
break;
case 0xFF55: // Tile-part lengths, main header (TLM)
var Ltlm = readUint16(data, position); // Marker segment length
// Skip tile length markers
position += Ltlm;
break;
case 0xFF5C: // Quantization default (QCD)
length = readUint16(data, position);
var qcd = {};
@ -35033,6 +35139,9 @@ var JpxImage = (function JpxImageClosure() {
length = tile.dataEnd - position;
parseTilePackets(context, data, position, length);
break;
case 0xFF55: // Tile-part lengths, main header (TLM)
case 0xFF57: // Packet length, main header (PLM)
case 0xFF58: // Packet length, tile-part header (PLT)
case 0xFF64: // Comment (COM)
length = readUint16(data, position);
// skipping content
@ -37030,10 +37139,9 @@ var Jbig2Image = (function Jbig2ImageClosure() {
// At each pixel: Clear contextLabel pixels that are shifted
// out of the context, then add new ones.
// If j + n is out of range at the right image border, then
// the undefined value of bitmap[i - 2][j + n] is shifted to 0
contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) |
(row2[j + 3] << 11) | (row1[j + 4] << 4) | pixel;
(j + 3 < width ? row2[j + 3] << 11 : 0) |
(j + 4 < width ? row1[j + 4] << 4 : 0) | pixel;
}
}

View File

@ -20,6 +20,7 @@
right: 0;
bottom: 0;
overflow: hidden;
opacity: 0.2;
}
.textLayer > div {
@ -55,6 +56,9 @@
background-color: rgb(0, 100, 0);
}
.textLayer ::selection { background: rgb(0,0,255); }
.textLayer ::-moz-selection { background: rgb(0,0,255); }
.pdfViewer .canvasWrapper {
overflow: hidden;
}
@ -1153,9 +1157,13 @@ html[dir='rtl'] .verticalToolbarSeparator {
margin-bottom: 10px;
}
#thumbnailView > a:last-of-type > .thumbnail:not([data-loaded]) {
margin-bottom: 9px;
}
.thumbnail:not([data-loaded]) {
border: 1px dashed rgba(255, 255, 255, 0.5);
margin-bottom: 10px;
margin: -1px -1px 4px -1px;
}
.thumbnailImage {
@ -1164,6 +1172,8 @@ html[dir='rtl'] .verticalToolbarSeparator {
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
opacity: 0.8;
z-index: 99;
background-color: white;
background-clip: content-box;
}
.thumbnailSelectionRing {
@ -1294,19 +1304,12 @@ html[dir='rtl'] .attachmentsItem > button {
cursor: default;
}
/* TODO: file FF bug to support ::-moz-selection:window-inactive
so we can override the opaque grey background when the window is inactive;
see https://bugzilla.mozilla.org/show_bug.cgi?id=706209 */
::selection { background: rgba(0,0,255,0.3); }
::-moz-selection { background: rgba(0,0,255,0.3); }
.textLayer ::selection { background: rgb(0,0,255); }
.textLayer ::-moz-selection { background: rgb(0,0,255); }
.textLayer {
opacity: 0.2;
}
#errorWrapper {
background: none repeat scroll 0 0 #FF5555;
color: white;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
<!-- 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/. -->
<!ENTITY tabCrashed.header "Bad news first: This tab has crashed">
<!ENTITY tabCrashed.message "Now for the good news: You can just close this tab, restore it or restore all your crashed tabs.">
<!ENTITY tabCrashed.sendReport "Submit a crash report to help prevent more bad news">
<!ENTITY tabCrashed.reportSent "Crash report already submitted; thank you for helping make &brandShortName; better!">
<!ENTITY tabCrashed.closeTab "Close This Tab">
<!ENTITY tabCrashed.restoreTab "Restore This Tab">
<!ENTITY tabCrashed.restoreAll "Restore All Crashed Tabs">

View File

@ -795,11 +795,6 @@ just addresses the organization to follow, e.g. "This site is run by " -->
a CSS length value. -->
<!ENTITY pluginNotification.width "28em">
<!ENTITY tabCrashed.header "Tab crashed">
<!ENTITY tabCrashed.message "Well, this is embarrassing. We tried to display this Web page, but it's not responding.">
<!ENTITY tabCrashed.checkSendReport "Tell &vendorShortName; about this crash so they can fix it.">
<!ENTITY tabCrashed.tryAgain "Try Again">
<!ENTITY uiTour.infoPanel.close "Close">
<!ENTITY appMenuSidebars.label "Sidebars">

View File

@ -18,6 +18,7 @@
locale/browser/aboutHealthReport.dtd (%chrome/browser/aboutHealthReport.dtd)
#endif
locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd)
locale/browser/aboutTabCrashed.dtd (%chrome/browser/aboutTabCrashed.dtd)
#ifdef MOZ_SERVICES_SYNC
locale/browser/syncProgress.dtd (%chrome/browser/syncProgress.dtd)
locale/browser/syncCustomize.dtd (%chrome/browser/syncCustomize.dtd)

View File

@ -82,6 +82,7 @@ this.TabCrashReporter = {
if (this.browserMap.get(browser) == childID) {
this.browserMap.delete(browser);
browser.contentDocument.documentElement.classList.remove("crashDumpAvailable");
browser.contentDocument.documentElement.classList.add("crashDumpSubmitted");
}
}
}

View File

@ -1,108 +0,0 @@
body {
background-color: rgb(241, 244, 248);
margin-top: 2em;
font: message-box;
font-size: 100%;
}
p {
font-size: .8em;
}
#error-box {
background: url('chrome://global/skin/icons/information-24.png') no-repeat left 4px;
-moz-padding-start: 30px;
}
#error-box:-moz-locale-dir(rtl) {
background-position: right 4px;
}
#main-error-msg {
color: #4b4b4b;
font-weight: bold;
}
#report-box {
text-align: center;
width: 75%;
margin: 0 auto;
display: none;
}
.crashDumpAvailable #report-box {
display: block
}
#button-box {
text-align: center;
width: 75%;
margin: 0 auto;
}
@media all and (min-width: 300px) {
#error-box {
max-width: 50%;
margin: 0 auto;
background-image: url('chrome://global/skin/icons/information-32.png');
min-height: 36px;
-moz-padding-start: 38px;
}
button {
width: auto !important;
min-width: 150px;
}
}
@media all and (min-width: 780px) {
#error-box {
max-width: 30%;
}
}
button {
font: message-box;
font-size: 0.6875em;
-moz-appearance: none;
-moz-user-select: none;
width: 100%;
margin: 2px 0;
padding: 2px 6px;
line-height: 1.2;
background-color: hsla(210,30%,95%,.1);
background-image: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
background-clip: padding-box;
border: 1px solid hsla(210,15%,25%,.4);
border-color: hsla(210,15%,25%,.3) hsla(210,15%,25%,.35) hsla(210,15%,25%,.4);
border-radius: 3px;
box-shadow: 0 1px 0 hsla(0,0%,100%,.3) inset,
0 0 0 1px hsla(0,0%,100%,.3) inset,
0 1px 0 hsla(0,0%,100%,.1);
transition-property: background-color, border-color, box-shadow;
transition-duration: 150ms;
transition-timing-function: ease;
}
button:hover {
background-color: hsla(210,30%,95%,.8);
border-color: hsla(210,15%,25%,.45) hsla(210,15%,25%,.5) hsla(210,15%,25%,.55);
box-shadow: 0 1px 0 hsla(0,0%,100%,.3) inset,
0 0 0 1px hsla(0,0%,100%,.3) inset,
0 1px 0 hsla(0,0%,100%,.1),
0 0 3px hsla(210,15%,25%,.1);
transition-property: background-color, border-color, box-shadow;
transition-duration: 150ms;
transition-timing-function: ease;
}
button:hover:active {
background-color: hsla(210,15%,25%,.2);
box-shadow: 0 1px 1px hsla(210,15%,25%,.2) inset,
0 0 2px hsla(210,15%,25%,.4) inset;
transition-property: background-color, border-color, box-shadow;
transition-duration: 10ms;
transition-timing-function: linear;
}

View File

@ -191,6 +191,7 @@ browser.jar:
skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png)
skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png)
skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png)
skin/classic/browser/tabbrowser/crashed.svg (../shared/tabbrowser/crashed.svg)
skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)

View File

@ -3092,6 +3092,14 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
opacity: .9;
}
/*
* Force the overlay to create a new stacking context so it always appears on
* top of the icon.
*/
.tab-icon-overlay {
opacity: 0.9999;
}
.tab-label:not([selected="true"]) {
opacity: .7;
}

View File

@ -301,6 +301,7 @@ browser.jar:
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon.png)
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon-inverted.png (tabbrowser/alltabs-box-bkgnd-icon-inverted.png)
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon-inverted@2x.png (tabbrowser/alltabs-box-bkgnd-icon-inverted@2x.png)
skin/classic/browser/tabbrowser/crashed.svg (../shared/tabbrowser/crashed.svg)
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png)
skin/classic/browser/tabbrowser/newtab@2x.png (tabbrowser/newtab@2x.png)
skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png)

View File

@ -1,11 +1,11 @@
/* 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/. */
.title {
background-image: url("chrome://browser/skin/tab-crashed.svg");
}
#report-box {
display: none;
}
.crashDumpAvailable #report-box {
display: block
#reportSent {
font-weight: bold;
}

View File

@ -157,7 +157,8 @@
/* End override @tabCurveHalfWidth@ and @tabCurveWidth@ */
#urlbar ::-moz-selection,
#navigator-toolbox .searchbar-textbox ::-moz-selection {
#navigator-toolbox .searchbar-textbox ::-moz-selection,
.browserContainer > findbar ::-moz-selection {
background-color: var(--chrome-selection-background-color);
color: var(--chrome-selection-color);
}
@ -182,6 +183,16 @@
color: var(--chrome-color);
}
.browserContainer > findbar {
background-image: none;
}
/* Default findbar text color doesn't look good - Bug 1125677 */
.browserContainer > findbar .findbar-find-status,
.browserContainer > findbar .found-matches {
color: inherit;
}
#navigator-toolbox .toolbarbutton-1,
.browserContainer > findbar .findbar-button,
#PlacesToolbar toolbarbutton.bookmark-item {

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="22 22 16 16" enable-background="new 22 22 16 16" xml:space="preserve">
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="30" y1="23" x2="30" y2="37">
<stop offset="0" style="stop-color:#E63B2E"/>
<stop offset="1" style="stop-color:#C33931"/>
</linearGradient>
<circle fill="url(#SVGID_1_)" cx="30" cy="30" r="7"/>
<g>
<path fill="#FFFFFF" d="M31.03,33.304c0,0.6-0.479,1.092-1.091,1.092c-0.6,0-1.079-0.492-1.079-1.092
c0-0.588,0.479-1.079,1.079-1.079C30.551,32.225,31.03,32.716,31.03,33.304z M29.171,31.133l-0.24-5.253h2.015l-0.24,5.253H29.171z
"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 970 B

View File

@ -65,6 +65,10 @@
-moz-padding-start: 9px;
}
.tab-content[pinned] {
-moz-padding-end: 3px;
}
.tab-throbber,
.tab-icon-image,
.tab-close-button {
@ -75,12 +79,26 @@
.tab-icon-image {
height: 16px;
width: 16px;
-moz-margin-end: 6px;
}
.tab-icon-image {
list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
}
.tab-icon-overlay {
width: 16px;
height: 16px;
margin-top: 10px;
-moz-margin-start: -16px;
display: none;
}
.tab-icon-overlay[crashed] {
display: -moz-box;
list-style-image: url("chrome://browser/skin/tabbrowser/crashed.svg");
}
.tab-throbber[busy] {
list-style-image: url("chrome://browser/skin/tabbrowser/connecting.png");
}
@ -89,11 +107,6 @@
list-style-image: url("chrome://browser/skin/tabbrowser/loading.png");
}
.tab-throbber:not([pinned]),
.tab-icon-image:not([pinned]) {
-moz-margin-end: 6px;
}
.tab-label {
-moz-margin-end: 0;
-moz-margin-start: 0;

View File

@ -219,6 +219,7 @@ browser.jar:
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab-XPVista7.png)
skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png)
skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png)
skin/classic/browser/tabbrowser/crashed.svg (../shared/tabbrowser/crashed.svg)
skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/browser/tabbrowser/tab-active-middle@2x.png (tabbrowser/tab-active-middle@2x.png)
@ -689,6 +690,7 @@ browser.jar:
skin/classic/aero/browser/tabbrowser/newtab-XPVista7.png (tabbrowser/newtab-XPVista7.png)
skin/classic/aero/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png)
skin/classic/aero/browser/tabbrowser/connecting.png (tabbrowser/connecting.png)
skin/classic/aero/browser/tabbrowser/crashed.svg (../shared/tabbrowser/crashed.svg)
skin/classic/aero/browser/tabbrowser/loading.png (tabbrowser/loading.png)
skin/classic/aero/browser/tabbrowser/tab-active-middle.png (tabbrowser/tab-active-middle.png)
skin/classic/aero/browser/tabbrowser/tab-active-middle@2x.png (tabbrowser/tab-active-middle@2x.png)

View File

@ -546,8 +546,12 @@ public abstract class BrowserToolbar extends ThemedRelativeLayout
private void updateProgressVisibility() {
final Tab selectedTab = Tabs.getInstance().getSelectedTab();
// The selected tab may be null if GeckoApp (and thus the
// selected tab) are not yet initialized (bug 1090287).
if (selectedTab != null) {
updateProgressVisibility(selectedTab, selectedTab.getLoadProgress());
}
}
private void updateProgressVisibility(Tab selectedTab, int progress) {
if (!isEditing() && selectedTab.getState() == Tab.STATE_LOADING) {

View File

@ -121,7 +121,9 @@ class DebianBootstrapper(BaseBootstrapper):
def suggest_mobile_android_mozconfig(self):
import android
android.suggest_mozconfig(sdk_path=self.sdk_path,
# The SDK path that mozconfig wants includes platforms/android-21.
sdk_path = os.path.join(self.sdk_path, 'platforms', android.ANDROID_PLATFORM)
android.suggest_mozconfig(sdk_path=sdk_path,
ndk_path=self.ndk_path)
def _update_package_manager(self):

View File

@ -287,7 +287,7 @@ AboutProtocolChannel.prototype = {
function AboutProtocolInstance(contractID)
{
this._contractID = contractID;
this._uriFlags = null;
this._uriFlags = undefined;
}
AboutProtocolInstance.prototype = {

View File

@ -36,7 +36,7 @@ add_task(function* test_same_date_same_hash() {
converter.charset = "UTF-8";
let result = yield OS.File.read(mostRecentBackupFile);
let jsonString = converter.convertFromByteArray(result, result.length);
do_log_info("Check is valid JSON");
do_print("Check is valid JSON");
JSON.parse(jsonString);
// Cleanup
@ -66,7 +66,7 @@ add_task(function* test_same_date_diff_hash() {
converter.charset = "UTF-8";
let result = yield OS.File.read(mostRecentBackupFile, { compression: "lz4" });
let jsonString = converter.convertFromByteArray(result, result.length);
do_log_info("Check is valid JSON");
do_print("Check is valid JSON");
JSON.parse(jsonString);
// Cleanup

View File

@ -30,15 +30,15 @@ add_task(function() {
PlacesUtils.bookmarks.removeItem(f1);
yield BookmarkJSONUtils.importFromFile((yield PlacesBackups.getMostRecentBackup()), true);
do_log_info("Checking first level");
do_print("Checking first level");
let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
let level1 = root.getChild(0);
do_check_eq(level1.title, "f1");
do_log_info("Checking second level");
do_print("Checking second level");
PlacesUtils.asContainer(level1).containerOpen = true
let level2 = level1.getChild(0);
do_check_eq(level2.title, "f2");
do_log_info("Checking bookmark");
do_print("Checking bookmark");
PlacesUtils.asContainer(level2).containerOpen = true
let bookmark = level2.getChild(0);
do_check_eq(bookmark.title, "bookmark");

View File

@ -27,7 +27,7 @@ add_task(function() {
PlacesUtils.bookmarks.removeItem(bm);
yield BookmarkHTMLUtils.importFromFile(file, true);
do_log_info("Checking first level");
do_print("Checking first level");
let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
let node = root.getChild(0);
do_check_eq(node.uri, uri.spec);

View File

@ -33,7 +33,7 @@ let observer = {
onItemChanged: function(aItemId, aProperty, aIsAnnotation, aNewValue,
aLastModified, aItemType)
{
do_log_info("Check that we got the correct change information.");
do_print("Check that we got the correct change information.");
do_check_neq(this.bookmarks.indexOf(aItemId), -1);
if (aProperty == "favicon") {
do_check_false(aIsAnnotation);
@ -57,7 +57,7 @@ let observer = {
},
onItemVisited: function(aItemId, aVisitId, aTime)
{
do_log_info("Check that we got the correct visit information.");
do_print("Check that we got the correct visit information.");
do_check_neq(this.bookmarks.indexOf(aItemId), -1);
this.observedVisitId = aVisitId;
do_check_eq(aTime, NOW);

View File

@ -11,7 +11,7 @@ let gBookmarksObserver = {
let args = this.expected.shift().args;
do_check_eq(aArguments.length, args.length);
for (let i = 0; i < aArguments.length; i++) {
do_log_info(aMethodName + "(args[" + i + "]: " + args[i].name + ")");
do_print(aMethodName + "(args[" + i + "]: " + args[i].name + ")");
do_check_true(args[i].check(aArguments[i]));
}

View File

@ -59,7 +59,7 @@ function run_test() {
};
add_task(function test_replaceFaviconData_validHistoryURI() {
do_log_info("test replaceFaviconData for valid history uri");
do_print("test replaceFaviconData for valid history uri");
let pageURI = uri("http://test1.bar/");
yield promiseAddVisits(pageURI);
@ -87,7 +87,7 @@ add_task(function test_replaceFaviconData_validHistoryURI() {
});
add_task(function test_replaceFaviconData_overrideDefaultFavicon() {
do_log_info("test replaceFaviconData to override a later setAndFetchFaviconForPage");
do_print("test replaceFaviconData to override a later setAndFetchFaviconForPage");
let pageURI = uri("http://test2.bar/");
yield promiseAddVisits(pageURI);
@ -119,7 +119,7 @@ add_task(function test_replaceFaviconData_overrideDefaultFavicon() {
});
add_task(function test_replaceFaviconData_replaceExisting() {
do_log_info("test replaceFaviconData to override a previous setAndFetchFaviconForPage");
do_print("test replaceFaviconData to override a previous setAndFetchFaviconForPage");
let pageURI = uri("http://test3.bar");
yield promiseAddVisits(pageURI);
@ -156,7 +156,7 @@ add_task(function test_replaceFaviconData_replaceExisting() {
});
add_task(function test_replaceFaviconData_unrelatedReplace() {
do_log_info("test replaceFaviconData to not make unrelated changes");
do_print("test replaceFaviconData to not make unrelated changes");
let pageURI = uri("http://test4.bar/");
yield promiseAddVisits(pageURI);
@ -188,7 +188,7 @@ add_task(function test_replaceFaviconData_unrelatedReplace() {
});
add_task(function test_replaceFaviconData_badInputs() {
do_log_info("test replaceFaviconData to throw on bad inputs");
do_print("test replaceFaviconData to throw on bad inputs");
let favicon = createFavicon("favicon8.png");
@ -228,7 +228,7 @@ add_task(function test_replaceFaviconData_badInputs() {
});
add_task(function test_replaceFaviconData_twiceReplace() {
do_log_info("test replaceFaviconData on multiple replacements");
do_print("test replaceFaviconData on multiple replacements");
let pageURI = uri("http://test5.bar/");
yield promiseAddVisits(pageURI);

View File

@ -63,7 +63,7 @@ function run_test() {
};
add_task(function test_replaceFaviconDataFromDataURL_validHistoryURI() {
do_log_info("test replaceFaviconDataFromDataURL for valid history uri");
do_print("test replaceFaviconDataFromDataURL for valid history uri");
let pageURI = uri("http://test1.bar/");
yield promiseAddVisits(pageURI);
@ -89,7 +89,7 @@ add_task(function test_replaceFaviconDataFromDataURL_validHistoryURI() {
});
add_task(function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon() {
do_log_info("test replaceFaviconDataFromDataURL to override a later setAndFetchFaviconForPage");
do_print("test replaceFaviconDataFromDataURL to override a later setAndFetchFaviconForPage");
let pageURI = uri("http://test2.bar/");
yield promiseAddVisits(pageURI);
@ -119,7 +119,7 @@ add_task(function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon() {
});
add_task(function test_replaceFaviconDataFromDataURL_replaceExisting() {
do_log_info("test replaceFaviconDataFromDataURL to override a previous setAndFetchFaviconForPage");
do_print("test replaceFaviconDataFromDataURL to override a previous setAndFetchFaviconForPage");
let pageURI = uri("http://test3.bar");
yield promiseAddVisits(pageURI);
@ -152,7 +152,7 @@ add_task(function test_replaceFaviconDataFromDataURL_replaceExisting() {
});
add_task(function test_replaceFaviconDataFromDataURL_unrelatedReplace() {
do_log_info("test replaceFaviconDataFromDataURL to not make unrelated changes");
do_print("test replaceFaviconDataFromDataURL to not make unrelated changes");
let pageURI = uri("http://test4.bar/");
yield promiseAddVisits(pageURI);
@ -182,7 +182,7 @@ add_task(function test_replaceFaviconDataFromDataURL_unrelatedReplace() {
});
add_task(function test_replaceFaviconDataFromDataURL_badInputs() {
do_log_info("test replaceFaviconDataFromDataURL to throw on bad inputs");
do_print("test replaceFaviconDataFromDataURL to throw on bad inputs");
let favicon = createFavicon("favicon8.png");
@ -210,7 +210,7 @@ add_task(function test_replaceFaviconDataFromDataURL_badInputs() {
});
add_task(function test_replaceFaviconDataFromDataURL_twiceReplace() {
do_log_info("test replaceFaviconDataFromDataURL on multiple replacements");
do_print("test replaceFaviconDataFromDataURL on multiple replacements");
let pageURI = uri("http://test5.bar/");
yield promiseAddVisits(pageURI);
@ -241,7 +241,7 @@ add_task(function test_replaceFaviconDataFromDataURL_twiceReplace() {
});
add_task(function test_replaceFaviconDataFromDataURL_afterRegularAssign() {
do_log_info("test replaceFaviconDataFromDataURL after replaceFaviconData");
do_print("test replaceFaviconDataFromDataURL after replaceFaviconData");
let pageURI = uri("http://test6.bar/");
yield promiseAddVisits(pageURI);
@ -274,7 +274,7 @@ add_task(function test_replaceFaviconDataFromDataURL_afterRegularAssign() {
});
add_task(function test_replaceFaviconDataFromDataURL_beforeRegularAssign() {
do_log_info("test replaceFaviconDataFromDataURL before replaceFaviconData");
do_print("test replaceFaviconDataFromDataURL before replaceFaviconData");
let pageURI = uri("http://test7.bar/");
yield promiseAddVisits(pageURI);

View File

@ -760,17 +760,6 @@ function do_check_guid_for_bookmark(aId,
}
}
/**
* Logs info to the console in the standard way (includes the filename).
*
* @param aMessage
* The message to log to the console.
*/
function do_log_info(aMessage)
{
print("TEST-INFO | " + _TEST_FILE + " | " + aMessage);
}
/**
* Compares 2 arrays returning whether they contains the same elements.
*

View File

@ -139,7 +139,7 @@ function ensure_results(aSearchString, aExpectedValue) {
waitForCleanup(run_next_test);
};
do_log_info("Searching for: '" + aSearchString + "'");
do_print("Searching for: '" + aSearchString + "'");
controller.startSearch(aSearchString);
}
@ -153,7 +153,7 @@ function run_test() {
gAutoCompleteTests.forEach(function (testData) {
let [description, searchString, expectedValue, setupFunc] = testData;
add_test(function () {
do_log_info(description);
do_print(description);
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);

View File

@ -92,7 +92,7 @@ function continue_test() {
try {
while(stmt.executeStep()) {
let comparator = EXPECTED.shift();
do_log_info("Checking that '" + comparator.url +
do_print("Checking that '" + comparator.url +
"' was entered into the DB correctly");
do_check_eq(stmt.row.id, comparator.id);
do_check_eq(stmt.row.url, comparator.url);
@ -155,7 +155,7 @@ ChannelListener.prototype = {
},
onStartRequest: function(request, context) {
do_log_info("onStartRequest");
do_print("onStartRequest");
this._got_onstartrequest = true;
},
@ -164,7 +164,7 @@ ChannelListener.prototype = {
},
onStopRequest: function(request, context, status) {
do_log_info("onStopRequest");
do_print("onStopRequest");
this._got_onstoprequest++;
let success = Components.isSuccessCode(status);
do_check_true(success);
@ -177,7 +177,7 @@ ChannelListener.prototype = {
// nsIChannelEventSink
asyncOnChannelRedirect: function (aOldChannel, aNewChannel, aFlags, callback) {
do_log_info("onChannelRedirect");
do_print("onChannelRedirect");
this._got_onchannelredirect = true;
callback.onRedirectVerifyCallback(Components.results.NS_OK);
},

View File

@ -13,29 +13,29 @@
function tags_getter_setter()
{
do_log_info("Tags getter/setter should work correctly");
do_log_info("Without setting tags, tags getter should return empty array");
do_print("Tags getter/setter should work correctly");
do_print("Without setting tags, tags getter should return empty array");
var [query, dummy] = makeQuery();
do_check_eq(query.tags.length, 0);
do_log_info("Setting tags to an empty array, tags getter should return "+
do_print("Setting tags to an empty array, tags getter should return "+
"empty array");
[query, dummy] = makeQuery([]);
do_check_eq(query.tags.length, 0);
do_log_info("Setting a few tags, tags getter should return correct array");
do_print("Setting a few tags, tags getter should return correct array");
var tags = ["bar", "baz", "foo"];
[query, dummy] = makeQuery(tags);
setsAreEqual(query.tags, tags, true);
do_log_info("Setting some dupe tags, tags getter return unique tags");
do_print("Setting some dupe tags, tags getter return unique tags");
[query, dummy] = makeQuery(["foo", "foo", "bar", "foo", "baz", "bar"]);
setsAreEqual(query.tags, ["bar", "baz", "foo"], true);
},
function invalid_setter_calls()
{
do_log_info("Invalid calls to tags setter should fail");
do_print("Invalid calls to tags setter should fail");
try {
var query = PlacesUtils.history.getNewQuery();
query.tags = null;
@ -105,19 +105,19 @@
function not_setting_tags()
{
do_log_info("Not setting tags at all should not affect query URI");
do_print("Not setting tags at all should not affect query URI");
checkQueryURI();
},
function empty_array_tags()
{
do_log_info("Setting tags with an empty array should not affect query URI");
do_print("Setting tags with an empty array should not affect query URI");
checkQueryURI([]);
},
function set_tags()
{
do_log_info("Setting some tags should result in correct query URI");
do_print("Setting some tags should result in correct query URI");
checkQueryURI([
"foo",
"七難",
@ -133,21 +133,21 @@
function no_tags_tagsAreNot()
{
do_log_info("Not setting tags at all but setting tagsAreNot should " +
do_print("Not setting tags at all but setting tagsAreNot should " +
"affect query URI");
checkQueryURI(null, true);
},
function empty_array_tags_tagsAreNot()
{
do_log_info("Setting tags with an empty array and setting tagsAreNot " +
do_print("Setting tags with an empty array and setting tagsAreNot " +
"should affect query URI");
checkQueryURI([], true);
},
function ()
{
do_log_info("Setting some tags and setting tagsAreNot should result in " +
do_print("Setting some tags and setting tagsAreNot should result in " +
"correct query URI");
checkQueryURI([
"foo",
@ -164,7 +164,7 @@
function tag_to_uri()
{
do_log_info("Querying history on tag associated with a URI should return " +
do_print("Querying history on tag associated with a URI should return " +
"that URI");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo"]);
@ -178,7 +178,7 @@
function tags_to_uri()
{
do_log_info("Querying history on many tags associated with a URI should " +
do_print("Querying history on many tags associated with a URI should " +
"return that URI");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bar"]);
@ -194,7 +194,7 @@
function repeated_tag()
{
do_log_info("Specifying the same tag multiple times in a history query " +
do_print("Specifying the same tag multiple times in a history query " +
"should not matter");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "foo"]);
@ -206,7 +206,7 @@
function many_tags_no_uri()
{
do_log_info("Querying history on many tags associated with a URI and " +
do_print("Querying history on many tags associated with a URI and " +
"tags not associated with that URI should not return that URI");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bogus"]);
@ -220,7 +220,7 @@
function nonexistent_tags()
{
do_log_info("Querying history on nonexistent tags should return no results");
do_print("Querying history on nonexistent tags should return no results");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["bogus"]);
executeAndCheckQueryResults(query, opts, []);
@ -231,7 +231,7 @@
function tag_to_bookmark()
{
do_log_info("Querying bookmarks on tag associated with a URI should " +
do_print("Querying bookmarks on tag associated with a URI should " +
"return that URI");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo"]);
@ -248,7 +248,7 @@
function many_tags_to_bookmark()
{
do_log_info("Querying bookmarks on many tags associated with a URI " +
do_print("Querying bookmarks on many tags associated with a URI " +
"should return that URI");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bar"]);
@ -268,7 +268,7 @@
function repeated_tag_to_bookmarks()
{
do_log_info("Specifying the same tag multiple times in a bookmark query " +
do_print("Specifying the same tag multiple times in a bookmark query " +
"should not matter");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "foo"]);
@ -282,7 +282,7 @@
function many_tags_no_bookmark()
{
do_log_info("Querying bookmarks on many tags associated with a URI and " +
do_print("Querying bookmarks on many tags associated with a URI and " +
"tags not associated with that URI should not return that URI");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bogus"]);
@ -299,7 +299,7 @@
function nonexistent_tags_bookmark()
{
do_log_info("Querying bookmarks on nonexistent tag should return no results");
do_print("Querying bookmarks on nonexistent tag should return no results");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["bogus"]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
@ -312,14 +312,14 @@
function tagsAreNot_history()
{
do_log_info("Querying history using tagsAreNot should work correctly");
do_print("Querying history using tagsAreNot should work correctly");
var urisAndTags = {
"http://example.com/1": ["foo", "bar"],
"http://example.com/2": ["baz", "qux"],
"http://example.com/3": null
};
do_log_info("Add visits and tag the URIs");
do_print("Add visits and tag the URIs");
for (let [pURI, tags] in Iterator(urisAndTags)) {
let nsiuri = uri(pURI);
yield promiseAddVisits(nsiuri);
@ -327,27 +327,27 @@
PlacesUtils.tagging.tagURI(nsiuri, tags);
}
do_log_info(' Querying for "foo" should match only /2 and /3');
do_print(' Querying for "foo" should match only /2 and /3');
var [query, opts] = makeQuery(["foo"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bar" should match only /2 and /3');
do_print(' Querying for "foo" and "bar" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bar"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bogus" should match only /2 and /3');
do_print(' Querying for "foo" and "bogus" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bogus"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "baz" should match only /3');
do_print(' Querying for "foo" and "baz" should match only /3');
[query, opts] = makeQuery(["foo", "baz"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/3"]);
do_log_info(' Querying for "bogus" should match all');
do_print(' Querying for "bogus" should match all');
[query, opts] = makeQuery(["bogus"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/1",
@ -365,14 +365,14 @@
function tagsAreNot_bookmarks()
{
do_log_info("Querying bookmarks using tagsAreNot should work correctly");
do_print("Querying bookmarks using tagsAreNot should work correctly");
var urisAndTags = {
"http://example.com/1": ["foo", "bar"],
"http://example.com/2": ["baz", "qux"],
"http://example.com/3": null
};
do_log_info("Add bookmarks and tag the URIs");
do_print("Add bookmarks and tag the URIs");
for (let [pURI, tags] in Iterator(urisAndTags)) {
let nsiuri = uri(pURI);
addBookmark(nsiuri);
@ -380,31 +380,31 @@
PlacesUtils.tagging.tagURI(nsiuri, tags);
}
do_log_info(' Querying for "foo" should match only /2 and /3');
do_print(' Querying for "foo" should match only /2 and /3');
var [query, opts] = makeQuery(["foo"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bar" should match only /2 and /3');
do_print(' Querying for "foo" and "bar" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bar"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bogus" should match only /2 and /3');
do_print(' Querying for "foo" and "bogus" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bogus"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "baz" should match only /3');
do_print(' Querying for "foo" and "baz" should match only /3');
[query, opts] = makeQuery(["foo", "baz"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/3"]);
do_log_info(' Querying for "bogus" should match all');
do_print(' Querying for "bogus" should match all');
[query, opts] = makeQuery(["bogus"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
@ -422,15 +422,15 @@
},
function duplicate_tags() {
do_log_info("Duplicate existing tags (i.e., multiple tag folders with " +
do_print("Duplicate existing tags (i.e., multiple tag folders with " +
"same name) should not throw off query results");
var tagName = "foo";
do_log_info("Add bookmark and tag it normally");
do_print("Add bookmark and tag it normally");
addBookmark(TEST_URI);
PlacesUtils.tagging.tagURI(TEST_URI, [tagName]);
do_log_info("Manually create tag folder with same name as tag and insert " +
do_print("Manually create tag folder with same name as tag and insert " +
"bookmark");
var dupTagId = PlacesUtils.bookmarks.createFolder(PlacesUtils.tagsFolderId,
tagName,
@ -442,7 +442,7 @@
"title");
do_check_true(bmId > 0);
do_log_info("Querying for tag should match URI");
do_print("Querying for tag should match URI");
var [query, opts] = makeQuery([tagName]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root, [TEST_URI.spec]);
@ -453,21 +453,21 @@
function folder_named_as_tag()
{
do_log_info("Regular folders with the same name as tag should not throw " +
do_print("Regular folders with the same name as tag should not throw " +
"off query results");
var tagName = "foo";
do_log_info("Add bookmark and tag it");
do_print("Add bookmark and tag it");
addBookmark(TEST_URI);
PlacesUtils.tagging.tagURI(TEST_URI, [tagName]);
do_log_info("Create folder with same name as tag");
do_print("Create folder with same name as tag");
var folderId = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId,
tagName,
Ci.nsINavBookmarksService.DEFAULT_INDEX);
do_check_true(folderId > 0);
do_log_info("Querying for tag should match URI");
do_print("Querying for tag should match URI");
var [query, opts] = makeQuery([tagName]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root, [TEST_URI.spec]);
@ -477,7 +477,7 @@
},
function ORed_queries() {
do_log_info("Multiple queries ORed together should work");
do_print("Multiple queries ORed together should work");
var urisAndTags = {
"http://example.com/1": [],
"http://example.com/2": []
@ -490,7 +490,7 @@
urisAndTags["http://example.com/2"].push("/2 tag " + i);
}
do_log_info("Add visits and tag the URIs");
do_print("Add visits and tag the URIs");
for (let [pURI, tags] in Iterator(urisAndTags)) {
let nsiuri = uri(pURI);
yield promiseAddVisits(nsiuri);
@ -498,39 +498,39 @@
PlacesUtils.tagging.tagURI(nsiuri, tags);
}
do_log_info("Query for /1 OR query for /2 should match both /1 and /2");
do_print("Query for /1 OR query for /2 should match both /1 and /2");
var [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
var [query2, dummy] = makeQuery(urisAndTags["http://example.com/2"]);
var root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
do_log_info("Query for /1 OR query on bogus tag should match only /1");
do_print("Query for /1 OR query on bogus tag should match only /1");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(["bogus"]);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1"]);
do_log_info("Query for /1 OR query for /1 should match only /1");
do_print("Query for /1 OR query for /1 should match only /1");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/1"]);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1"]);
do_log_info("Query for /1 with tagsAreNot OR query for /2 with tagsAreNot " +
do_print("Query for /1 with tagsAreNot OR query for /2 with tagsAreNot " +
"should match both /1 and /2");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"], true);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/2"], true);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
do_log_info("Query for /1 OR query for /2 with tagsAreNot should match " +
do_print("Query for /1 OR query for /2 with tagsAreNot should match " +
"only /1");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/2"], true);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1"]);
do_log_info("Query for /1 OR query for /1 with tagsAreNot should match " +
do_print("Query for /1 OR query for /1 with tagsAreNot should match " +
"both URIs");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/1"], true);
@ -568,7 +568,7 @@ function addBookmark(aURI) {
aURI,
Ci.nsINavBookmarksService.DEFAULT_INDEX,
aURI.spec);
do_log_info("Sanity check: insertBookmark should not fail");
do_print("Sanity check: insertBookmark should not fail");
do_check_true(bmId > 0);
}
@ -596,7 +596,7 @@ function checkQueryURI(aTags, aTagsAreNot) {
var expURI = "place:" + pairs.join("&");
var [query, opts] = makeQuery(aTags, aTagsAreNot);
var actualURI = queryURI(query, opts);
do_log_info("Query URI should be what we expect for the given tags");
do_print("Query URI should be what we expect for the given tags");
do_check_eq(actualURI, expURI);
}
@ -683,7 +683,7 @@ function executeAndCheckQueryResults(aQuery, aQueryOpts, aExpectedURIs) {
*/
function makeQuery(aTags, aTagsAreNot) {
aTagsAreNot = !!aTagsAreNot;
do_log_info("Making a query " +
do_print("Making a query " +
(aTags ?
"with tags " + aTags.toSource() :
"without calling setTags() at all") +
@ -701,7 +701,7 @@ function makeQuery(aTags, aTagsAreNot) {
uniqueTags.sort();
}
do_log_info("Made query should be correct for tags and tagsAreNot");
do_print("Made query should be correct for tags and tagsAreNot");
if (uniqueTags)
setsAreEqual(query.tags, uniqueTags, true);
var expCount = uniqueTags ? uniqueTags.length : 0;

View File

@ -122,12 +122,12 @@ function* check_autocomplete(test) {
let numSearchesStarted = 0;
input.onSearchBegin = () => {
do_log_info("onSearchBegin received");
do_print("onSearchBegin received");
numSearchesStarted++;
};
let deferred = Promise.defer();
input.onSearchComplete = () => {
do_log_info("onSearchComplete received");
do_print("onSearchComplete received");
deferred.resolve();
}
@ -136,7 +136,7 @@ function* check_autocomplete(test) {
controller.startSearch(test.incompleteSearch);
expectedSearches++;
}
do_log_info("Searching for: '" + test.search + "'");
do_print("Searching for: '" + test.search + "'");
controller.startSearch(test.search);
yield deferred.promise;
@ -150,7 +150,7 @@ function* check_autocomplete(test) {
for (let i = 0; i < controller.matchCount; i++) {
let value = controller.getValueAt(i);
let comment = controller.getCommentAt(i);
do_log_info("Looking for '" + value + "', '" + comment + "' in expected results...");
do_print("Looking for '" + value + "', '" + comment + "' in expected results...");
let j;
for (j = 0; j < matches.length; j++) {
// Skip processed expected results
@ -167,10 +167,10 @@ function* check_autocomplete(test) {
else
style = ["favicon"];
do_log_info("Checking against expected '" + uri.spec + "', '" + title + "'...");
do_print("Checking against expected '" + uri.spec + "', '" + title + "'...");
// Got a match on both uri and title?
if (stripPrefix(uri.spec) == stripPrefix(value) && title == comment) {
do_log_info("Got a match at index " + j + "!");
do_print("Got a match at index " + j + "!");
let actualStyle = controller.getStyleAt(i).split(/\s+/).sort();
if (style)
Assert.equal(actualStyle.toString(), style.toString(), "Match should have expected style");
@ -254,7 +254,7 @@ function changeRestrict(aType, aChar) {
else
branch += "restrict.";
do_log_info("changing restrict for " + aType + " to '" + aChar + "'");
do_print("changing restrict for " + aType + " to '" + aChar + "'");
Services.prefs.setCharPref(branch + aType, aChar);
}

View File

@ -8,7 +8,7 @@
*/
add_task(function* test_tag_match_has_bookmark_title() {
do_log_info("Make sure the tag match gives the bookmark title");
do_print("Make sure the tag match gives the bookmark title");
let uri = NetUtil.newURI("http://theuri/");
yield promiseAddVisits({ uri: uri, title: "Page title" });
addBookmark({ uri: uri,

View File

@ -15,7 +15,7 @@
*/
add_task(function* test_tag_match_url() {
do_log_info("Make sure tag matches return the right url as well as '+' remain escaped");
do_print("Make sure tag matches return the right url as well as '+' remain escaped");
let uri1 = NetUtil.newURI("http://escaped/ユニコード");
let uri2 = NetUtil.newURI("http://asciiescaped/blocking-firefox3%2B");
yield promiseAddVisits([ { uri: uri1, title: "title" },

View File

@ -16,32 +16,32 @@ add_task(function* test_javascript_match() {
addBookmark({ uri: uri2,
title: "Title with javascript:" });
do_log_info("Match non-javascript: with plain search");
do_print("Match non-javascript: with plain search");
yield check_autocomplete({
search: "a",
matches: [ { uri: uri1, title: "Title with javascript:" } ]
});
do_log_info("Match non-javascript: with almost javascript:");
do_print("Match non-javascript: with almost javascript:");
yield check_autocomplete({
search: "javascript",
matches: [ { uri: uri1, title: "Title with javascript:" } ]
});
do_log_info("Match javascript:");
do_print("Match javascript:");
yield check_autocomplete({
search: "javascript:",
matches: [ { uri: uri1, title: "Title with javascript:" },
{ uri: uri2, title: "Title with javascript:", style: [ "bookmark" ]} ]
});
do_log_info("Match nothing with non-first javascript:");
do_print("Match nothing with non-first javascript:");
yield check_autocomplete({
search: "5 javascript:",
matches: [ ]
});
do_log_info("Match javascript: with multi-word search");
do_print("Match javascript: with multi-word search");
yield check_autocomplete({
search: "javascript: 5",
matches: [ { uri: uri2, title: "Title with javascript:", style: [ "bookmark" ]} ]

View File

@ -30,31 +30,31 @@ add_task(function* test_javascript_match() {
title: "tagged",
tags: [ "tag1", "tag2", "tag3" ] });
do_log_info("Make sure tags come back in the title when matching tags");
do_print("Make sure tags come back in the title when matching tags");
yield check_autocomplete({
search: "page1 tag",
matches: [ { uri: uri1, title: "tagged", tags: [ "tag1" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Check tags in title for page2");
do_print("Check tags in title for page2");
yield check_autocomplete({
search: "page2 tag",
matches: [ { uri: uri2, title: "tagged", tags: [ "tag1", "tag2" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Make sure tags appear even when not matching the tag");
do_print("Make sure tags appear even when not matching the tag");
yield check_autocomplete({
search: "page3",
matches: [ { uri: uri3, title: "tagged", tags: [ "tag1", "tag3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Multiple tags come in commas for page4");
do_print("Multiple tags come in commas for page4");
yield check_autocomplete({
search: "page4",
matches: [ { uri: uri4, title: "tagged", tags: [ "tag1", "tag2", "tag3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Extra test just to make sure we match the title");
do_print("Extra test just to make sure we match the title");
yield check_autocomplete({
search: "tag2",
matches: [ { uri: uri2, title: "tagged", tags: [ "tag1", "tag2" ], style: [ "bookmark-tag" ] },

View File

@ -8,7 +8,7 @@
*/
add_task(function* test_javascript_match() {
do_log_info("Bad escaped uri stays escaped");
do_print("Bad escaped uri stays escaped");
let uri1 = NetUtil.newURI("http://site/%EAid");
yield promiseAddVisits([ { uri: uri1, title: "title" } ]);
yield check_autocomplete({

View File

@ -27,7 +27,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
do_log_info("Restrict history, common visit, should not autoFill");
do_print("Restrict history, common visit, should not autoFill");
yield check_autocomplete({
search: "vi",
matches: [ { uri: uri2, title: "visited" } ],
@ -35,7 +35,7 @@ add_task(function* test_default_behavior_host() {
completed: "vi"
});
do_log_info("Restrict history, typed visit, should autoFill");
do_print("Restrict history, typed visit, should autoFill");
yield check_autocomplete({
search: "ty",
matches: [ { uri: uri1, title: "typed", style: [ "autofill" ] } ],
@ -44,7 +44,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("Restrict history, bookmark, should not autoFill");
do_print("Restrict history, bookmark, should not autoFill");
yield check_autocomplete({
search: "bo",
matches: [ ],
@ -53,7 +53,7 @@ add_task(function* test_default_behavior_host() {
});
// Note we don't show this one cause it's not typed.
do_log_info("Restrict history, typed bookmark, should autoFill");
do_print("Restrict history, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tp",
matches: [ { uri: uri4, title: "tpbk", style: [ "autofill" ] } ],
@ -66,7 +66,7 @@ add_task(function* test_default_behavior_host() {
// We are not restricting on typed, so we autoFill the bookmark even if we
// are restricted to history. We accept that cause not doing that
// would be a perf hit and the privacy implications are very weak.
do_log_info("Restrict history, bookmark, autoFill.typed = false, should autoFill");
do_print("Restrict history, bookmark, autoFill.typed = false, should autoFill");
yield check_autocomplete({
search: "bo",
matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ], style: [ "autofill" ] } ],
@ -74,7 +74,7 @@ add_task(function* test_default_behavior_host() {
completed: "bookmarked/"
});
do_log_info("Restrict history, common visit, autoFill.typed = false, should autoFill");
do_print("Restrict history, common visit, autoFill.typed = false, should autoFill");
yield check_autocomplete({
search: "vi",
matches: [ { uri: uri2, title: "visited", style: [ "autofill" ] } ],
@ -87,7 +87,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
// Typed behavior basically acts like history, but filters on typed.
do_log_info("Restrict typed, common visit, autoFill.typed = false, should not autoFill");
do_print("Restrict typed, common visit, autoFill.typed = false, should not autoFill");
yield check_autocomplete({
search: "vi",
matches: [ ],
@ -95,7 +95,7 @@ add_task(function* test_default_behavior_host() {
completed: "vi"
});
do_log_info("Restrict typed, typed visit, autofill.typed = false, should autoFill");
do_print("Restrict typed, typed visit, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "ty",
matches: [ { uri: uri1, title: "typed", style: [ "autofill" ] } ],
@ -103,7 +103,7 @@ add_task(function* test_default_behavior_host() {
completed: "typed/"
});
do_log_info("Restrict typed, bookmark, autofill.typed = false, should not autoFill");
do_print("Restrict typed, bookmark, autofill.typed = false, should not autoFill");
yield check_autocomplete({
search: "bo",
matches: [ ],
@ -111,7 +111,7 @@ add_task(function* test_default_behavior_host() {
completed: "bo"
});
do_log_info("Restrict typed, typed bookmark, autofill.typed = false, should autoFill");
do_print("Restrict typed, typed bookmark, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "tp",
matches: [ { uri: uri4, title: "tpbk", style: [ "autofill" ] } ],
@ -124,7 +124,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", true);
do_log_info("Restrict bookmarks, common visit, should not autoFill");
do_print("Restrict bookmarks, common visit, should not autoFill");
yield check_autocomplete({
search: "vi",
matches: [ ],
@ -132,7 +132,7 @@ add_task(function* test_default_behavior_host() {
completed: "vi"
});
do_log_info("Restrict bookmarks, typed visit, should not autoFill");
do_print("Restrict bookmarks, typed visit, should not autoFill");
yield check_autocomplete({
search: "ty",
matches: [ ],
@ -141,7 +141,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("Restrict bookmarks, bookmark, should not autoFill");
do_print("Restrict bookmarks, bookmark, should not autoFill");
yield check_autocomplete({
search: "bo",
matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ] } ],
@ -150,7 +150,7 @@ add_task(function* test_default_behavior_host() {
});
// Note we don't show this one cause it's not typed.
do_log_info("Restrict bookmarks, typed bookmark, should autoFill");
do_print("Restrict bookmarks, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tp",
matches: [ { uri: uri4, title: "tpbk", style: [ "autofill" ] } ],
@ -160,7 +160,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
do_log_info("Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
do_print("Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "bo",
matches: [ { uri: uri3, title: "bookmarked", style: [ "autofill" ] } ],
@ -169,7 +169,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autofill because it's a title.
do_log_info("Restrict bookmarks, title, autofill.typed = false, should not autoFill");
do_print("Restrict bookmarks, title, autofill.typed = false, should not autoFill");
yield check_autocomplete({
search: "# ta",
matches: [ ],
@ -178,7 +178,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autofill because it's a tag.
do_log_info("Restrict bookmarks, tag, autofill.typed = false, should not autoFill");
do_print("Restrict bookmarks, tag, autofill.typed = false, should not autoFill");
yield check_autocomplete({
search: "+ ta",
matches: [ { uri: uri5, title: "title", tags: [ "foo" ], style: [ "tag" ] } ],
@ -210,7 +210,7 @@ add_task(function* test_default_behavior_url() {
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
do_log_info("URL: Restrict history, common visit, should not autoFill");
do_print("URL: Restrict history, common visit, should not autoFill");
yield check_autocomplete({
search: "visited/v",
matches: [ { uri: uri2, title: "visited" } ],
@ -218,7 +218,7 @@ add_task(function* test_default_behavior_url() {
completed: "visited/v"
});
do_log_info("URL: Restrict history, typed visit, should autoFill");
do_print("URL: Restrict history, typed visit, should autoFill");
yield check_autocomplete({
search: "typed/t",
matches: [ { uri: uri1, title: "typed/ty/", style: [ "autofill" ] } ],
@ -227,7 +227,7 @@ add_task(function* test_default_behavior_url() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("URL: Restrict history, bookmark, should not autoFill");
do_print("URL: Restrict history, bookmark, should not autoFill");
yield check_autocomplete({
search: "bookmarked/b",
matches: [ ],
@ -236,7 +236,7 @@ add_task(function* test_default_behavior_url() {
});
// Note we don't show this one cause it's not typed.
do_log_info("URL: Restrict history, typed bookmark, should autoFill");
do_print("URL: Restrict history, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tpbk/t",
matches: [ { uri: uri4, title: "tpbk/tp/", style: [ "autofill" ] } ],
@ -248,7 +248,7 @@ add_task(function* test_default_behavior_url() {
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
do_log_info("URL: Restrict bookmarks, common visit, should not autoFill");
do_print("URL: Restrict bookmarks, common visit, should not autoFill");
yield check_autocomplete({
search: "visited/v",
matches: [ ],
@ -256,7 +256,7 @@ add_task(function* test_default_behavior_url() {
completed: "visited/v"
});
do_log_info("URL: Restrict bookmarks, typed visit, should not autoFill");
do_print("URL: Restrict bookmarks, typed visit, should not autoFill");
yield check_autocomplete({
search: "typed/t",
matches: [ ],
@ -265,7 +265,7 @@ add_task(function* test_default_behavior_url() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("URL: Restrict bookmarks, bookmark, should not autoFill");
do_print("URL: Restrict bookmarks, bookmark, should not autoFill");
yield check_autocomplete({
search: "bookmarked/b",
matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ] } ],
@ -274,7 +274,7 @@ add_task(function* test_default_behavior_url() {
});
// Note we don't show this one cause it's not typed.
do_log_info("URL: Restrict bookmarks, typed bookmark, should autoFill");
do_print("URL: Restrict bookmarks, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tpbk/t",
matches: [ { uri: uri4, title: "tpbk/tp/", style: [ "autofill" ] } ],
@ -284,7 +284,7 @@ add_task(function* test_default_behavior_url() {
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
do_log_info("URL: Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
do_print("URL: Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "bookmarked/b",
matches: [ { uri: uri3, title: "bookmarked/bo/", style: [ "autofill" ] } ],

View File

@ -7,7 +7,7 @@
const PREF_AUTOCOMPLETE_ENABLED = "browser.urlbar.autocomplete.enabled";
add_task(function* test_disabling_autocomplete() {
do_log_info("Check disabling autocomplete disables autofill");
do_print("Check disabling autocomplete disables autofill");
Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://visit.mozilla.org"),
transition: TRANSITION_TYPED });
@ -20,7 +20,7 @@ add_task(function* test_disabling_autocomplete() {
});
add_task(function* test_urls_order() {
do_log_info("Add urls, check for correct order");
do_print("Add urls, check for correct order");
let places = [{ uri: NetUtil.newURI("http://visit1.mozilla.org") },
{ uri: NetUtil.newURI("http://visit2.mozilla.org"),
transition: TRANSITION_TYPED }];
@ -34,7 +34,7 @@ add_task(function* test_urls_order() {
});
add_task(function* test_ignore_prefix() {
do_log_info("Add urls, make sure www and http are ignored");
do_print("Add urls, make sure www and http are ignored");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://www.visit1.mozilla.org"));
yield check_autocomplete({
@ -46,7 +46,7 @@ add_task(function* test_ignore_prefix() {
});
add_task(function* test_after_host() {
do_log_info("Autocompleting after an existing host completes to the url");
do_print("Autocompleting after an existing host completes to the url");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://www.visit3.mozilla.org"));
yield check_autocomplete({
@ -58,7 +58,7 @@ add_task(function* test_after_host() {
});
add_task(function* test_respect_www() {
do_log_info("Searching for www.me should yield www.me.mozilla.org/");
do_print("Searching for www.me should yield www.me.mozilla.org/");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://www.me.mozilla.org"));
yield check_autocomplete({
@ -70,7 +70,7 @@ add_task(function* test_respect_www() {
});
add_task(function* test_bookmark_first() {
do_log_info("With a bookmark and history, the query result should be the bookmark");
do_print("With a bookmark and history, the query result should be the bookmark");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
addBookmark({ uri: NetUtil.newURI("http://bookmark1.mozilla.org/") });
yield promiseAddVisits(NetUtil.newURI("http://bookmark1.mozilla.org/foo"));
@ -83,7 +83,7 @@ add_task(function* test_bookmark_first() {
});
add_task(function* test_full_path() {
do_log_info("Check to make sure we get the proper results with full paths");
do_print("Check to make sure we get the proper results with full paths");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
let places = [{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
@ -97,7 +97,7 @@ add_task(function* test_full_path() {
});
add_task(function* test_complete_to_slash() {
do_log_info("Check to make sure we autocomplete to the following '/'");
do_print("Check to make sure we autocomplete to the following '/'");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
let places = [{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
@ -111,7 +111,7 @@ add_task(function* test_complete_to_slash() {
});
add_task(function* test_complete_to_slash_with_www() {
do_log_info("Check to make sure we autocomplete to the following '/'");
do_print("Check to make sure we autocomplete to the following '/'");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
let places = [{ uri: NetUtil.newURI("http://www.smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
{ uri: NetUtil.newURI("http://www.smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
@ -125,7 +125,7 @@ add_task(function* test_complete_to_slash_with_www() {
});
add_task(function* test_complete_querystring() {
do_log_info("Check to make sure we autocomplete after ?");
do_print("Check to make sure we autocomplete after ?");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://smokey.mozilla.org/foo?bacon=delicious"));
yield check_autocomplete({
@ -137,7 +137,7 @@ add_task(function* test_complete_querystring() {
});
add_task(function* test_complete_fragment() {
do_log_info("Check to make sure we autocomplete after #");
do_print("Check to make sure we autocomplete after #");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://smokey.mozilla.org/foo?bacon=delicious#bar"));
yield check_autocomplete({

View File

@ -6,7 +6,7 @@ add_task(function* test_prefix_space_noautofill() {
yield promiseAddVisits({ uri: NetUtil.newURI("http://moz.org/test/"),
transition: TRANSITION_TYPED });
do_log_info("Should not try to autoFill if search string contains a space");
do_print("Should not try to autoFill if search string contains a space");
yield check_autocomplete({
search: " mo",
autofilled: " mo",
@ -20,7 +20,7 @@ add_task(function* test_trailing_space_noautofill() {
yield promiseAddVisits({ uri: NetUtil.newURI("http://moz.org/test/"),
transition: TRANSITION_TYPED });
do_log_info("Should not try to autoFill if search string contains a space");
do_print("Should not try to autoFill if search string contains a space");
yield check_autocomplete({
search: "mo ",
autofilled: "mo ",
@ -38,7 +38,7 @@ add_task(function* test_searchEngine_autofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should autoFill search engine if search string does not contains a space");
do_print("Should autoFill search engine if search string does not contains a space");
yield check_autocomplete({
search: "ca",
autofilled: "cake.search",
@ -56,7 +56,7 @@ add_task(function* test_searchEngine_prefix_space_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not try to autoFill search engine if search string contains a space");
do_print("Should not try to autoFill search engine if search string contains a space");
yield check_autocomplete({
search: " cu",
autofilled: " cu",
@ -74,7 +74,7 @@ add_task(function* test_searchEngine_trailing_space_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not try to autoFill search engine if search string contains a space");
do_print("Should not try to autoFill search engine if search string contains a space");
yield check_autocomplete({
search: "ba ",
autofilled: "ba ",
@ -92,7 +92,7 @@ add_task(function* test_searchEngine_www_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not autoFill search engine if search string contains www. but engine doesn't");
do_print("Should not autoFill search engine if search string contains www. but engine doesn't");
yield check_autocomplete({
search: "www.ham",
autofilled: "www.ham",
@ -110,7 +110,7 @@ add_task(function* test_searchEngine_different_scheme_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not autoFill search engine if search string has a different scheme.");
do_print("Should not autoFill search engine if search string has a different scheme.");
yield check_autocomplete({
search: "http://pie",
autofilled: "http://pie",
@ -129,21 +129,21 @@ add_task(function* test_searchEngine_matching_prefix_autofill() {
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should autoFill search engine if search string has matching prefix.");
do_print("Should autoFill search engine if search string has matching prefix.");
yield check_autocomplete({
search: "http://www.be",
autofilled: "http://www.bean.search",
completed: "http://www.bean.search"
})
do_log_info("Should autoFill search engine if search string has www prefix.");
do_print("Should autoFill search engine if search string has www prefix.");
yield check_autocomplete({
search: "www.be",
autofilled: "www.bean.search",
completed: "http://www.bean.search"
});
do_log_info("Should autoFill search engine if search string has matching scheme.");
do_print("Should autoFill search engine if search string has matching scheme.");
yield check_autocomplete({
search: "http://be",
autofilled: "http://bean.search",
@ -159,7 +159,7 @@ add_task(function* test_prefix_autofill() {
yield promiseAddVisits({ uri: NetUtil.newURI("http://moz.org/test/"),
transition: TRANSITION_TYPED });
do_log_info("Should not try to autoFill in-the-middle if a search is canceled immediately");
do_print("Should not try to autoFill in-the-middle if a search is canceled immediately");
yield check_autocomplete({
incompleteSearch: "moz",
search: "mozi",

View File

@ -28,7 +28,7 @@ add_task(function* test_protocol_trimming() {
"www.mo te"
];
for (let input of inputs) {
do_log_info("Searching for: " + input);
do_print("Searching for: " + input);
yield check_autocomplete({
search: input,
matches: matches

View File

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_casing_1() {
do_log_info("Searching for cased entry 1");
do_print("Searching for cased entry 1");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -15,7 +15,7 @@ add_task(function* test_casing_1() {
});
add_task(function* test_casing_2() {
do_log_info("Searching for cased entry 2");
do_print("Searching for cased entry 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -27,7 +27,7 @@ add_task(function* test_casing_2() {
});
add_task(function* test_casing_3() {
do_log_info("Searching for cased entry 3");
do_print("Searching for cased entry 3");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -39,7 +39,7 @@ add_task(function* test_casing_3() {
});
add_task(function* test_casing_4() {
do_log_info("Searching for cased entry 4");
do_print("Searching for cased entry 4");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -51,7 +51,7 @@ add_task(function* test_casing_4() {
});
add_task(function* test_casing_5() {
do_log_info("Searching for cased entry 5");
do_print("Searching for cased entry 5");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -63,7 +63,7 @@ add_task(function* test_casing_5() {
});
add_task(function* test_untrimmed_casing() {
do_log_info("Searching for untrimmed cased entry");
do_print("Searching for untrimmed cased entry");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -75,7 +75,7 @@ add_task(function* test_untrimmed_casing() {
});
add_task(function* test_untrimmed_www_casing() {
do_log_info("Searching for untrimmed cased entry with www");
do_print("Searching for untrimmed cased entry with www");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -87,7 +87,7 @@ add_task(function* test_untrimmed_www_casing() {
});
add_task(function* test_untrimmed_path_casing() {
do_log_info("Searching for untrimmed cased entry with path");
do_print("Searching for untrimmed cased entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -99,7 +99,7 @@ add_task(function* test_untrimmed_path_casing() {
});
add_task(function* test_untrimmed_path_casing_2() {
do_log_info("Searching for untrimmed cased entry with path 2");
do_print("Searching for untrimmed cased entry with path 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -111,7 +111,7 @@ add_task(function* test_untrimmed_path_casing_2() {
});
add_task(function* test_untrimmed_path_www_casing() {
do_log_info("Searching for untrimmed cased entry with www and path");
do_print("Searching for untrimmed cased entry with www and path");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -123,7 +123,7 @@ add_task(function* test_untrimmed_path_www_casing() {
});
add_task(function* test_untrimmed_path_www_casing_2() {
do_log_info("Searching for untrimmed cased entry with www and path 2");
do_print("Searching for untrimmed cased entry with www and path 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

View File

@ -6,7 +6,7 @@
// that largely confuses completeDefaultIndex
add_task(function* test_not_autofill_ws_1() {
do_log_info("Do not autofill whitespaced entry 1");
do_print("Do not autofill whitespaced entry 1");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -18,7 +18,7 @@ add_task(function* test_not_autofill_ws_1() {
});
add_task(function* test_not_autofill_ws_2() {
do_log_info("Do not autofill whitespaced entry 2");
do_print("Do not autofill whitespaced entry 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -30,7 +30,7 @@ add_task(function* test_not_autofill_ws_2() {
});
add_task(function* test_not_autofill_ws_3() {
do_log_info("Do not autofill whitespaced entry 3");
do_print("Do not autofill whitespaced entry 3");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -42,7 +42,7 @@ add_task(function* test_not_autofill_ws_3() {
});
add_task(function* test_not_autofill_ws_4() {
do_log_info("Do not autofill whitespaced entry 4");
do_print("Do not autofill whitespaced entry 4");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -55,7 +55,7 @@ add_task(function* test_not_autofill_ws_4() {
add_task(function* test_not_autofill_ws_5() {
do_log_info("Do not autofill whitespaced entry 5");
do_print("Do not autofill whitespaced entry 5");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -67,7 +67,7 @@ add_task(function* test_not_autofill_ws_5() {
});
add_task(function* test_not_autofill_ws_6() {
do_log_info("Do not autofill whitespaced entry 6");
do_print("Do not autofill whitespaced entry 6");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

View File

@ -35,37 +35,37 @@ add_task(function* test_download_embed_bookmarks() {
addBookmark({ uri: uri3,
title: "framed-bookmark" });
do_log_info("Searching for bookmarked download uri matches");
do_print("Searching for bookmarked download uri matches");
yield check_autocomplete({
search: "download-bookmark",
matches: [ { uri: uri1, title: "download-bookmark", style: [ "bookmark" ] } ]
});
do_log_info("Searching for bookmarked embed uri matches");
do_print("Searching for bookmarked embed uri matches");
yield check_autocomplete({
search: "embed-bookmark",
matches: [ { uri: uri2, title: "embed-bookmark", style: [ "bookmark" ] } ]
});
do_log_info("Searching for bookmarked framed uri matches");
do_print("Searching for bookmarked framed uri matches");
yield check_autocomplete({
search: "framed-bookmark",
matches: [ { uri: uri3, title: "framed-bookmark", style: [ "bookmark" ] } ]
});
do_log_info("Searching for download uri does not match");
do_print("Searching for download uri does not match");
yield check_autocomplete({
search: "download2",
matches: [ ]
});
do_log_info("Searching for embed uri does not match");
do_print("Searching for embed uri does not match");
yield check_autocomplete({
search: "embed2",
matches: [ ]
});
do_log_info("Searching for framed uri does not match");
do_print("Searching for framed uri does not match");
yield check_autocomplete({
search: "framed2",
matches: [ ]

View File

@ -4,7 +4,7 @@
// Ensure inline autocomplete doesn't return zero frecency pages.
add_task(function* test_dupe_urls() {
do_log_info("Searching for urls with dupes should only show one");
do_print("Searching for urls with dupes should only show one");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://mozilla.org/?") });

View File

@ -40,7 +40,7 @@ add_task(function* test_javascript_match() {
// Now remove page 6 from history, so it is an unvisited bookmark.
PlacesUtils.history.removePage(uri6);
do_log_info("Match everything");
do_print("Match everything");
yield check_autocomplete({
search: "foo",
searchParam: "enable-actions",
@ -53,21 +53,21 @@ add_task(function* test_javascript_match() {
{ uri: makeActionURI("switchtab", {url: "http://t.foo/6"}), title: "title", style: [ "action,switchtab" ] }, ]
});
do_log_info("Match only typed history");
do_print("Match only typed history");
yield check_autocomplete({
search: "foo ^ ~",
matches: [ { uri: uri3, title: "title" },
{ uri: uri4, title: "title" } ]
});
do_log_info("Drop-down empty search matches only typed history");
do_print("Drop-down empty search matches only typed history");
yield check_autocomplete({
search: "",
matches: [ { uri: uri3, title: "title" },
{ uri: uri4, title: "title" } ]
});
do_log_info("Drop-down empty search matches only bookmarks");
do_print("Drop-down empty search matches only bookmarks");
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
yield check_autocomplete({
@ -78,7 +78,7 @@ add_task(function* test_javascript_match() {
{ uri: uri6, title: "title", style: ["bookmark"] } ]
});
do_log_info("Drop-down empty search matches only open tabs");
do_print("Drop-down empty search matches only open tabs");
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
yield check_autocomplete({
search: "",

View File

@ -11,20 +11,20 @@ add_task(function* test_enabled() {
let uri = NetUtil.newURI("http://url/0");
yield promiseAddVisits([ { uri: uri, title: "title" } ]);
do_log_info("plain search");
do_print("plain search");
yield check_autocomplete({
search: "url",
matches: [ { uri: uri, title: "title" } ]
});
do_log_info("search disabled");
do_print("search disabled");
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false);
yield check_autocomplete({
search: "url",
matches: [ ]
});
do_log_info("resume normal search");
do_print("resume normal search");
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true);
yield check_autocomplete({
search: "url",

View File

@ -13,13 +13,13 @@ add_task(function* test_escape() {
yield promiseAddVisits([ { uri: uri1, title: "title" },
{ uri: uri2, title: "title" } ]);
do_log_info("Unescaped location matches itself");
do_print("Unescaped location matches itself");
yield check_autocomplete({
search: "http://unescapeduri/",
matches: [ { uri: uri1, title: "title" } ]
});
do_log_info("Escaped location matches itself");
do_print("Escaped location matches itself");
yield check_autocomplete({
search: "http://escapeduri/%40/",
matches: [ { uri: uri2, title: "title" } ]

View File

@ -12,7 +12,7 @@ add_task(function* test_escape() {
yield promiseAddVisits([ { uri: uri1, title: "title" },
{ uri: uri2, title: "title" } ]);
do_log_info("Searching for h matches site and not http://");
do_print("Searching for h matches site and not http://");
yield check_autocomplete({
search: "h",
matches: [ { uri: uri2, title: "title" } ]

View File

@ -19,43 +19,43 @@ add_task(function* test_keyword_searc() {
{ uri: uri2, title: "Generic page title" } ]);
addBookmark({ uri: uri1, title: "Keyword title", keyword: "key"});
do_log_info("Plain keyword query");
do_print("Plain keyword query");
yield check_autocomplete({
search: "key term",
matches: [ { uri: NetUtil.newURI("http://abc/?search=term"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Multi-word keyword query");
do_print("Multi-word keyword query");
yield check_autocomplete({
search: "key multi word",
matches: [ { uri: NetUtil.newURI("http://abc/?search=multi+word"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Keyword query with +");
do_print("Keyword query with +");
yield check_autocomplete({
search: "key blocking+",
matches: [ { uri: NetUtil.newURI("http://abc/?search=blocking%2B"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Unescaped term in query");
do_print("Unescaped term in query");
yield check_autocomplete({
search: "key ユニコード",
matches: [ { uri: NetUtil.newURI("http://abc/?search=ユニコード"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Keyword that happens to match a page");
do_print("Keyword that happens to match a page");
yield check_autocomplete({
search: "key ThisPageIsInHistory",
matches: [ { uri: NetUtil.newURI("http://abc/?search=ThisPageIsInHistory"), title: "Generic page title", style: ["bookmark"] } ]
});
do_log_info("Keyword without query (without space)");
do_print("Keyword without query (without space)");
yield check_autocomplete({
search: "key",
matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Keyword without query (with space)");
do_print("Keyword without query (with space)");
yield check_autocomplete({
search: "key ",
matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "Keyword title", style: ["keyword"] } ]
@ -66,7 +66,7 @@ add_task(function* test_keyword_searc() {
yield promiseAddVisits([ { uri: uri3, title: "Generic page title" } ]);
addBookmark({ uri: uri3, title: "Keyword title", keyword: "key", style: ["keyword"] });
do_log_info("Two keywords matched");
do_print("Two keywords matched");
yield check_autocomplete({
search: "key twoKey",
matches: [ { uri: NetUtil.newURI("http://abc/?search=twoKey"), title: "Keyword title", style: ["keyword"] },

View File

@ -19,49 +19,49 @@ add_task(function* test_keyword_search() {
{ uri: uri2, title: "Generic page title" } ]);
addBookmark({ uri: uri1, title: "Keyword title", keyword: "key"});
do_log_info("Plain keyword query");
do_print("Plain keyword query");
yield check_autocomplete({
search: "key term",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=term", input: "key term"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Multi-word keyword query");
do_print("Multi-word keyword query");
yield check_autocomplete({
search: "key multi word",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=multi+word", input: "key multi word"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword query with +");
do_print("Keyword query with +");
yield check_autocomplete({
search: "key blocking+",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=blocking%2B", input: "key blocking+"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Unescaped term in query");
do_print("Unescaped term in query");
yield check_autocomplete({
search: "key ユニコード",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=ユニコード", input: "key ユニコード"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword that happens to match a page");
do_print("Keyword that happens to match a page");
yield check_autocomplete({
search: "key ThisPageIsInHistory",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=ThisPageIsInHistory", input: "key ThisPageIsInHistory"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword without query (without space)");
do_print("Keyword without query (without space)");
yield check_autocomplete({
search: "key",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=", input: "key"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword without query (with space)");
do_print("Keyword without query (with space)");
yield check_autocomplete({
search: "key ",
searchParam: "enable-actions",
@ -73,7 +73,7 @@ add_task(function* test_keyword_search() {
yield promiseAddVisits([ { uri: uri3, title: "Generic page title" } ]);
addBookmark({ uri: uri3, title: "Keyword title", keyword: "key"});
do_log_info("Two keywords matched");
do_print("Two keywords matched");
yield check_autocomplete({
search: "key twoKey",
searchParam: "enable-actions",

View File

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_non_keyword() {
do_log_info("Searching for non-keyworded entry should autoFill it");
do_print("Searching for non-keyworded entry should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/") });
@ -16,7 +16,7 @@ add_task(function* test_non_keyword() {
});
add_task(function* test_keyword() {
do_log_info("Searching for keyworded entry should not autoFill it");
do_print("Searching for keyworded entry should not autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
@ -29,7 +29,7 @@ add_task(function* test_keyword() {
});
add_task(function* test_more_than_keyword() {
do_log_info("Searching for more than keyworded entry should autoFill it");
do_print("Searching for more than keyworded entry should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
@ -42,7 +42,7 @@ add_task(function* test_more_than_keyword() {
});
add_task(function* test_less_than_keyword() {
do_log_info("Searching for less than keyworded entry should autoFill it");
do_print("Searching for less than keyworded entry should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
@ -55,7 +55,7 @@ add_task(function* test_less_than_keyword() {
});
add_task(function* test_keyword_casing() {
do_log_info("Searching for keyworded entry is case-insensitive");
do_print("Searching for keyworded entry is case-insensitive");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });

View File

@ -15,32 +15,32 @@ add_task(function* test_match_beginning() {
yield promiseAddVisits([ { uri: uri1, title: "a b" },
{ uri: uri2, title: "b a" } ]);
do_log_info("Match at the beginning of titles");
do_print("Match at the beginning of titles");
Services.prefs.setIntPref("browser.urlbar.matchBehavior", 3);
yield check_autocomplete({
search: "a",
matches: [ { uri: uri1, title: "a b" } ]
});
do_log_info("Match at the beginning of titles");
do_print("Match at the beginning of titles");
yield check_autocomplete({
search: "b",
matches: [ { uri: uri2, title: "b a" } ]
});
do_log_info("Match at the beginning of urls");
do_print("Match at the beginning of urls");
yield check_autocomplete({
search: "x",
matches: [ { uri: uri1, title: "a b" } ]
});
do_log_info("Match at the beginning of urls");
do_print("Match at the beginning of urls");
yield check_autocomplete({
search: "y",
matches: [ { uri: uri2, title: "b a" } ]
});
do_log_info("Sanity check that matching anywhere finds more");
do_print("Sanity check that matching anywhere finds more");
Services.prefs.setIntPref("browser.urlbar.matchBehavior", 1);
yield check_autocomplete({
search: "a",

View File

@ -24,39 +24,39 @@ add_task(function* test_match_beginning() {
addBookmark({ uri: uri3, title: "f(o)o b<a>r" });
addBookmark({ uri: uri4, title: "b(a)r b<a>z" });
do_log_info("Match 2 terms all in url");
do_print("Match 2 terms all in url");
yield check_autocomplete({
search: "c d",
matches: [ { uri: uri1, title: "f(o)o b<a>r" } ]
});
do_log_info("Match 1 term in url and 1 term in title");
do_print("Match 1 term in url and 1 term in title");
yield check_autocomplete({
search: "b e",
matches: [ { uri: uri1, title: "f(o)o b<a>r" },
{ uri: uri2, title: "b(a)r b<a>z" } ]
});
do_log_info("Match 3 terms all in title; display bookmark title if matched");
do_print("Match 3 terms all in title; display bookmark title if matched");
yield check_autocomplete({
search: "b a z",
matches: [ { uri: uri2, title: "b(a)r b<a>z" },
{ uri: uri4, title: "b(a)r b<a>z", style: [ "bookmark" ] } ]
});
do_log_info("Match 2 terms in url and 1 in title; make sure bookmark title is used for search");
do_print("Match 2 terms in url and 1 in title; make sure bookmark title is used for search");
yield check_autocomplete({
search: "k f t",
matches: [ { uri: uri3, title: "f(o)o b<a>r", style: [ "bookmark" ] } ]
});
do_log_info("Match 3 terms in url and 1 in title");
do_print("Match 3 terms in url and 1 in title");
yield check_autocomplete({
search: "d i g z",
matches: [ { uri: uri2, title: "b(a)r b<a>z" } ]
});
do_log_info("Match nothing");
do_print("Match nothing");
yield check_autocomplete({
search: "m o z i",
matches: [ ]

View File

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_no_slash() {
do_log_info("Searching for host match without slash should match host");
do_print("Searching for host match without slash should match host");
yield promiseAddVisits({ uri: NetUtil.newURI("http://file.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("file:///c:/test.html"),
@ -17,7 +17,7 @@ add_task(function* test_no_slash() {
});
add_task(function* test_w_slash() {
do_log_info("Searching match with slash at the end should do nothing");
do_print("Searching match with slash at the end should do nothing");
yield promiseAddVisits({ uri: NetUtil.newURI("http://file.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("file:///c:/test.html"),
@ -31,7 +31,7 @@ add_task(function* test_w_slash() {
});
add_task(function* test_middle() {
do_log_info("Searching match with slash in the middle should match url");
do_print("Searching match with slash in the middle should match url");
yield promiseAddVisits({ uri: NetUtil.newURI("http://file.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("file:///c:/test.html"),
@ -45,7 +45,7 @@ add_task(function* test_middle() {
});
add_task(function* test_nonhost() {
do_log_info("Searching for non-host match without slash should not match url");
do_print("Searching for non-host match without slash should not match url");
yield promiseAddVisits({ uri: NetUtil.newURI("file:///c:/test.html"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

View File

@ -10,28 +10,28 @@ add_task(function*() {
Services.search.addEngineWithDetails("AliasedMozSearch", "", "doit", "",
"GET", "http://s.example.com/search");
do_log_info("search engine");
do_print("search engine");
yield check_autocomplete({
search: "mozilla",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "mozilla", searchQuery: "mozilla"}), title: "MozSearch", style: [ "action", "searchengine" ] }, ]
});
do_log_info("search engine, uri-like input");
do_print("search engine, uri-like input");
yield check_autocomplete({
search: "http:///",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "http:///", searchQuery: "http:///"}), title: "MozSearch", style: [ "action", "searchengine" ] }, ]
});
do_log_info("search engine, multiple words");
do_print("search engine, multiple words");
yield check_autocomplete({
search: "mozzarella cheese",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "mozzarella cheese", searchQuery: "mozzarella cheese"}), title: "MozSearch", style: [ "action", "searchengine" ] }, ]
});
do_log_info("search engine, after current engine has changed");
do_print("search engine, after current engine has changed");
Services.search.addEngineWithDetails("MozSearch2", "", "", "", "GET",
"http://s.example.com/search2");
engine = Services.search.getEngineByName("MozSearch2");

View File

@ -55,7 +55,7 @@ add_task(function* test_searchEngine_autoFill() {
yield promiseAsyncUpdates();
ok(frecencyForUrl(uri) > 10000, "Added URI should have expected high frecency");
do_log_info("Check search domain is autoFilled even if there's an higher frecency match");
do_print("Check search domain is autoFilled even if there's an higher frecency match");
yield check_autocomplete({
search: "my",
autofilled: "my.search.com",

View File

@ -14,7 +14,7 @@ add_task(function* test_searchEngine() {
yield promiseAddVisits({ uri: uri1, title: "Terms - SearchEngine Search" });
addBookmark({ uri: uri2, title: "Terms - SearchEngine Search" });
do_log_info("Past search terms should be styled, unless bookmarked");
do_print("Past search terms should be styled, unless bookmarked");
Services.prefs.setBoolPref("browser.urlbar.restyleSearches", true);
yield check_autocomplete({
search: "term",
@ -22,7 +22,7 @@ add_task(function* test_searchEngine() {
{ uri: uri2, title: "Terms - SearchEngine Search", style: ["bookmark"] } ]
});
do_log_info("Past search terms should not be styled if restyling is disabled");
do_print("Past search terms should not be styled if restyling is disabled");
Services.prefs.setBoolPref("browser.urlbar.restyleSearches", false);
yield check_autocomplete({
search: "term",

View File

@ -45,7 +45,7 @@ add_task(function* test_special_searches() {
addBookmark( { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ] } );
// Test restricting searches
do_log_info("History restrict");
do_print("History restrict");
yield check_autocomplete({
search: "^",
matches: [ { uri: uri1, title: "title" },
@ -56,7 +56,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("Star restrict");
do_print("Star restrict");
yield check_autocomplete({
search: "*",
matches: [ { uri: uri5, title: "title", style: [ "bookmark" ] },
@ -69,7 +69,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Tag restrict");
do_print("Tag restrict");
yield check_autocomplete({
search: "+",
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
@ -79,7 +79,7 @@ add_task(function* test_special_searches() {
});
// Test specials as any word position
do_log_info("Special as first word");
do_print("Special as first word");
yield check_autocomplete({
search: "^ foo bar",
matches: [ { uri: uri2, title: "foo.bar" },
@ -89,7 +89,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("Special as middle word");
do_print("Special as middle word");
yield check_autocomplete({
search: "foo ^ bar",
matches: [ { uri: uri2, title: "foo.bar" },
@ -99,7 +99,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("Special as last word");
do_print("Special as last word");
yield check_autocomplete({
search: "foo bar ^",
matches: [ { uri: uri2, title: "foo.bar" },
@ -110,7 +110,7 @@ add_task(function* test_special_searches() {
});
// Test restricting and matching searches with a term
do_log_info("foo ^ -> history");
do_print("foo ^ -> history");
yield check_autocomplete({
search: "foo ^",
matches: [ { uri: uri2, title: "foo.bar" },
@ -120,7 +120,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> history (change pref)");
do_print("foo | -> history (change pref)");
changeRestrict("history", "|");
yield check_autocomplete({
search: "foo |",
@ -131,7 +131,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo * -> is star");
do_print("foo * -> is star");
resetRestrict("history");
yield check_autocomplete({
search: "foo *",
@ -144,7 +144,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo | -> is star (change pref)");
do_print("foo | -> is star (change pref)");
changeRestrict("bookmark", "|");
yield check_autocomplete({
search: "foo |",
@ -157,7 +157,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo # -> in title");
do_print("foo # -> in title");
resetRestrict("bookmark");
yield check_autocomplete({
search: "foo #",
@ -171,7 +171,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> in title (change pref)");
do_print("foo | -> in title (change pref)");
changeRestrict("title", "|");
yield check_autocomplete({
search: "foo |",
@ -185,7 +185,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo @ -> in url");
do_print("foo @ -> in url");
resetRestrict("title");
yield check_autocomplete({
search: "foo @",
@ -197,7 +197,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> in url (change pref)");
do_print("foo | -> in url (change pref)");
changeRestrict("url", "|");
yield check_autocomplete({
search: "foo |",
@ -209,7 +209,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo + -> is tag");
do_print("foo + -> is tag");
resetRestrict("url");
yield check_autocomplete({
search: "foo +",
@ -219,7 +219,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> is tag (change pref)");
do_print("foo | -> is tag (change pref)");
changeRestrict("tag", "|");
yield check_autocomplete({
search: "foo |",
@ -229,7 +229,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ~ -> is typed");
do_print("foo ~ -> is typed");
resetRestrict("tag");
yield check_autocomplete({
search: "foo ~",
@ -237,7 +237,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> is typed (change pref)");
do_print("foo | -> is typed (change pref)");
changeRestrict("typed", "|");
yield check_autocomplete({
search: "foo |",
@ -246,7 +246,7 @@ add_task(function* test_special_searches() {
});
// Test various pairs of special searches
do_log_info("foo ^ * -> history, is star");
do_print("foo ^ * -> history, is star");
resetRestrict("typed");
yield check_autocomplete({
search: "foo ^ *",
@ -254,7 +254,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo ^ # -> history, in title");
do_print("foo ^ # -> history, in title");
yield check_autocomplete({
search: "foo ^ #",
matches: [ { uri: uri2, title: "foo.bar" },
@ -263,7 +263,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ^ @ -> history, in url");
do_print("foo ^ @ -> history, in url");
yield check_autocomplete({
search: "foo ^ @",
matches: [ { uri: uri3, title: "title" },
@ -271,20 +271,20 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ^ + -> history, is tag");
do_print("foo ^ + -> history, is tag");
yield check_autocomplete({
search: "foo ^ +",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ^ ~ -> history, is typed");
do_print("foo ^ ~ -> history, is typed");
yield check_autocomplete({
search: "foo ^ ~",
matches: [ { uri: uri4, title: "foo.bar" },
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo * # -> is star, in title");
do_print("foo * # -> is star, in title");
yield check_autocomplete({
search: "foo * #",
matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
@ -295,7 +295,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo * @ -> is star, in url");
do_print("foo * @ -> is star, in url");
yield check_autocomplete({
search: "foo * @",
matches: [ { uri: uri7, title: "title", style: [ "bookmark" ] },
@ -304,7 +304,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo * + -> same as +");
do_print("foo * + -> same as +");
yield check_autocomplete({
search: "foo * +",
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
@ -313,13 +313,13 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo * ~ -> is star, is typed");
do_print("foo * ~ -> is star, is typed");
yield check_autocomplete({
search: "foo * ~",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo # @ -> in title, in url");
do_print("foo # @ -> in title, in url");
yield check_autocomplete({
search: "foo # @",
matches: [ { uri: uri4, title: "foo.bar" },
@ -328,7 +328,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo # + -> in title, is tag");
do_print("foo # + -> in title, is tag");
yield check_autocomplete({
search: "foo # +",
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
@ -337,28 +337,28 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo # ~ -> in title, is typed");
do_print("foo # ~ -> in title, is typed");
yield check_autocomplete({
search: "foo # ~",
matches: [ { uri: uri4, title: "foo.bar" },
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo @ + -> in url, is tag");
do_print("foo @ + -> in url, is tag");
yield check_autocomplete({
search: "foo @ +",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo @ ~ -> in url, is typed");
do_print("foo @ ~ -> in url, is typed");
yield check_autocomplete({
search: "foo @ ~",
matches: [ { uri: uri4, title: "foo.bar" },
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo + ~ -> is tag, is typed");
do_print("foo + ~ -> is tag, is typed");
yield check_autocomplete({
search: "foo + ~",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
@ -369,7 +369,7 @@ add_task(function* test_special_searches() {
Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
// Test default usage by setting certain browser.urlbar.suggest.* prefs
do_log_info("foo -> default history");
do_print("foo -> default history");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
yield check_autocomplete({
@ -381,7 +381,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: ["foo.bar"], style: [ "tag" ] } ]
});
do_log_info("foo -> default history, is star");
do_print("foo -> default history, is star");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
@ -399,7 +399,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo -> default history, is star, is typed");
do_print("foo -> default history, is star, is typed");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
@ -410,7 +410,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo -> is star");
do_print("foo -> is star");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
@ -425,7 +425,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo -> is star, is typed");
do_print("foo -> is star, is typed");
setSuggestPrefsToFalse();
// only typed should be ignored
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);

View File

@ -42,106 +42,106 @@ add_task(function* test_swap_protocol() {
Services.prefs.setBoolPref("browser.urlbar.autoFill", "false");
Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
do_log_info("http://www.site matches all site");
do_print("http://www.site matches all site");
yield check_autocomplete({
search: "http://www.site",
matches: allMatches
});
do_log_info("http://site matches all site");
do_print("http://site matches all site");
yield check_autocomplete({
search: "http://site",
matches: allMatches
});
do_log_info("ftp://ftp.site matches itself");
do_print("ftp://ftp.site matches itself");
yield check_autocomplete({
search: "ftp://ftp.site",
matches: [ { uri: uri3, title: "title" } ]
});
do_log_info("ftp://site matches all site");
do_print("ftp://site matches all site");
yield check_autocomplete({
search: "ftp://site",
matches: allMatches
});
do_log_info("https://www.site matches all site");
do_print("https://www.site matches all site");
yield check_autocomplete({
search: "https://www.site",
matches: allMatches
});
do_log_info("https://site matches all site");
do_print("https://site matches all site");
yield check_autocomplete({
search: "https://site",
matches: allMatches
});
do_log_info("www.site matches all site");
do_print("www.site matches all site");
yield check_autocomplete({
search: "www.site",
matches: allMatches
});
do_log_info("w matches none of www.");
do_print("w matches none of www.");
yield check_autocomplete({
search: "w",
matches: [ { uri: uri7, title: "title" },
{ uri: uri8, title: "title" } ]
});
do_log_info("http://w matches none of www.");
do_print("http://w matches none of www.");
yield check_autocomplete({
search: "http://w",
matches: [ { uri: uri7, title: "title" },
{ uri: uri8, title: "title" } ]
});
do_log_info("http://w matches none of www.");
do_print("http://w matches none of www.");
yield check_autocomplete({
search: "http://www.w",
matches: [ { uri: uri7, title: "title" },
{ uri: uri8, title: "title" } ]
});
do_log_info("ww matches none of www.");
do_print("ww matches none of www.");
yield check_autocomplete({
search: "ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("ww matches none of www.");
do_print("ww matches none of www.");
yield check_autocomplete({
search: "ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://ww matches none of www.");
do_print("http://ww matches none of www.");
yield check_autocomplete({
search: "http://ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://www.ww matches none of www.");
do_print("http://www.ww matches none of www.");
yield check_autocomplete({
search: "http://www.ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("www matches none of www.");
do_print("www matches none of www.");
yield check_autocomplete({
search: "www",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://www matches none of www.");
do_print("http://www matches none of www.");
yield check_autocomplete({
search: "http://www",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://www.www matches none of www.");
do_print("http://www.www matches none of www.");
yield check_autocomplete({
search: "http://www.www",
matches: [ { uri: uri8, title: "title" } ]

View File

@ -23,7 +23,7 @@ add_task(function* test_tab_matches() {
addOpenPages(uri3, 1);
addOpenPages(uri4, 1);
do_log_info("two results, normal result is a tab match");
do_print("two results, normal result is a tab match");
yield check_autocomplete({
search: "abc.com",
searchParam: "enable-actions",
@ -31,7 +31,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://abc.com/"}), title: "ABC rocks", style: [ "action", "switchtab" ] } ]
});
do_log_info("three results, one tab match");
do_print("three results, one tab match");
yield check_autocomplete({
search: "abc",
searchParam: "enable-actions",
@ -40,7 +40,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("three results, both normal results are tab matches");
do_print("three results, both normal results are tab matches");
addOpenPages(uri2, 1);
yield check_autocomplete({
search: "abc",
@ -50,7 +50,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://xyz.net/"}), title: "xyz.net - we're better than ABC", style: [ "action", "switchtab" ] } ]
});
do_log_info("three results, both normal results are tab matches, one has multiple tabs");
do_print("three results, both normal results are tab matches, one has multiple tabs");
addOpenPages(uri2, 5);
yield check_autocomplete({
search: "abc",
@ -60,7 +60,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://xyz.net/"}), title: "xyz.net - we're better than ABC", style: [ "action", "switchtab" ] } ]
});
do_log_info("three results, no tab matches (disable-private-actions)");
do_print("three results, no tab matches (disable-private-actions)");
yield check_autocomplete({
search: "abc",
searchParam: "enable-actions disable-private-actions",
@ -69,7 +69,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("two results (actions disabled)");
do_print("two results (actions disabled)");
yield check_autocomplete({
search: "abc",
searchParam: "",
@ -77,7 +77,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("three results, no tab matches");
do_print("three results, no tab matches");
removeOpenPages(uri1, 1);
removeOpenPages(uri2, 6);
yield check_autocomplete({
@ -88,7 +88,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("tab match search with restriction character");
do_print("tab match search with restriction character");
addOpenPages(uri1, 1);
yield check_autocomplete({
search: gTabRestrictChar + " abc",
@ -97,7 +97,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://abc.com/"}), title: "ABC rocks", style: [ "action", "switchtab" ] } ]
});
do_log_info("tab match with not-addable pages");
do_print("tab match with not-addable pages");
yield check_autocomplete({
search: "mozilla",
searchParam: "enable-actions",
@ -105,7 +105,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "about:mozilla"}), title: "about:mozilla", style: [ "action", "switchtab" ] } ]
});
do_log_info("tab match with not-addable pages and restriction character");
do_print("tab match with not-addable pages and restriction character");
yield check_autocomplete({
search: gTabRestrictChar + " mozilla",
searchParam: "enable-actions",
@ -113,7 +113,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "about:mozilla"}), title: "about:mozilla", style: [ "action", "switchtab" ] } ]
});
do_log_info("tab match with not-addable pages and only restriction character");
do_print("tab match with not-addable pages and only restriction character");
yield check_autocomplete({
search: gTabRestrictChar,
searchParam: "enable-actions",

View File

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_untrimmed_secure_www() {
do_log_info("Searching for untrimmed https://www entry");
do_print("Searching for untrimmed https://www entry");
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -15,7 +15,7 @@ add_task(function* test_untrimmed_secure_www() {
});
add_task(function* test_untrimmed_secure_www_path() {
do_log_info("Searching for untrimmed https://www entry with path");
do_print("Searching for untrimmed https://www entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -27,7 +27,7 @@ add_task(function* test_untrimmed_secure_www_path() {
});
add_task(function* test_untrimmed_secure() {
do_log_info("Searching for untrimmed https:// entry");
do_print("Searching for untrimmed https:// entry");
yield promiseAddVisits({ uri: NetUtil.newURI("https://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -39,7 +39,7 @@ add_task(function* test_untrimmed_secure() {
});
add_task(function* test_untrimmed_secure_path() {
do_log_info("Searching for untrimmed https:// entry with path");
do_print("Searching for untrimmed https:// entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("https://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -51,7 +51,7 @@ add_task(function* test_untrimmed_secure_path() {
});
add_task(function* test_untrimmed_www() {
do_log_info("Searching for untrimmed http://www entry");
do_print("Searching for untrimmed http://www entry");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -63,7 +63,7 @@ add_task(function* test_untrimmed_www() {
});
add_task(function* test_untrimmed_www_path() {
do_log_info("Searching for untrimmed http://www entry with path");
do_print("Searching for untrimmed http://www entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -75,7 +75,7 @@ add_task(function* test_untrimmed_www_path() {
});
add_task(function* test_untrimmed_ftp() {
do_log_info("Searching for untrimmed ftp:// entry");
do_print("Searching for untrimmed ftp:// entry");
yield promiseAddVisits({ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -87,7 +87,7 @@ add_task(function* test_untrimmed_ftp() {
});
add_task(function* test_untrimmed_ftp_path() {
do_log_info("Searching for untrimmed ftp:// entry with path");
do_print("Searching for untrimmed ftp:// entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -99,7 +99,7 @@ add_task(function* test_untrimmed_ftp_path() {
});
add_task(function* test_priority_1() {
do_log_info("Ensuring correct priority 1");
do_print("Ensuring correct priority 1");
yield promiseAddVisits([{ uri: NetUtil.newURI("https://www.mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("https://mozilla.org/test/"),
@ -119,7 +119,7 @@ add_task(function* test_priority_1() {
});
add_task(function* test_periority_2() {
do_log_info( "Ensuring correct priority 2");
do_print( "Ensuring correct priority 2");
yield promiseAddVisits([{ uri: NetUtil.newURI("https://mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
@ -137,7 +137,7 @@ add_task(function* test_periority_2() {
});
add_task(function* test_periority_3() {
do_log_info("Ensuring correct priority 3");
do_print("Ensuring correct priority 3");
yield promiseAddVisits([{ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
@ -153,7 +153,7 @@ add_task(function* test_periority_3() {
});
add_task(function* test_periority_4() {
do_log_info("Ensuring correct priority 4");
do_print("Ensuring correct priority 4");
yield promiseAddVisits([{ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://mozilla.org/test/"),
@ -167,7 +167,7 @@ add_task(function* test_periority_4() {
});
add_task(function* test_priority_5() {
do_log_info("Ensuring correct priority 5");
do_print("Ensuring correct priority 5");
yield promiseAddVisits([{ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("ftp://www.mozilla.org/test/"),
@ -181,7 +181,7 @@ add_task(function* test_priority_5() {
});
add_task(function* test_priority_6() {
do_log_info("Ensuring correct priority 6");
do_print("Ensuring correct priority 6");
yield promiseAddVisits([{ uri: NetUtil.newURI("http://www.mozilla.org/test1/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://www.mozilla.org/test2/"),
@ -195,7 +195,7 @@ add_task(function* test_priority_6() {
});
add_task(function* test_longer_domain() {
do_log_info("Ensuring longer domain can't match");
do_print("Ensuring longer domain can't match");
// The .co should be preferred, but should not get the https from the .com.
// The .co domain must be added later to activate the trigger bug.
yield promiseAddVisits([{ uri: NetUtil.newURI("https://mozilla.com/"),
@ -214,7 +214,7 @@ add_task(function* test_longer_domain() {
});
add_task(function* test_escaped_chars() {
do_log_info("Searching for URL with characters that are normally escaped");
do_print("Searching for URL with characters that are normally escaped");
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.mozilla.org/啊-test"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -226,7 +226,7 @@ add_task(function* test_escaped_chars() {
});
add_task(function* test_unsecure_secure() {
do_log_info("Don't return unsecure URL when searching for secure ones");
do_print("Don't return unsecure URL when searching for secure ones");
yield promiseAddVisits({ uri: NetUtil.newURI("http://test.moz.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -238,7 +238,7 @@ add_task(function* test_unsecure_secure() {
});
add_task(function* test_unsecure_secure_domain() {
do_log_info("Don't return unsecure domain when searching for secure ones");
do_print("Don't return unsecure domain when searching for secure ones");
yield promiseAddVisits({ uri: NetUtil.newURI("http://test.moz.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -250,7 +250,7 @@ add_task(function* test_unsecure_secure_domain() {
});
add_task(function* test_untyped_www() {
do_log_info("Untyped is not accounted for www");
do_print("Untyped is not accounted for www");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.moz.org/test/") });
yield check_autocomplete({
@ -262,7 +262,7 @@ add_task(function* test_untyped_www() {
});
add_task(function* test_untyped_ftp() {
do_log_info("Untyped is not accounted for ftp");
do_print("Untyped is not accounted for ftp");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("ftp://moz.org/test/") });
yield check_autocomplete({
@ -274,7 +274,7 @@ add_task(function* test_untyped_ftp() {
});
add_task(function* test_untyped_secure() {
do_log_info("Untyped is not accounted for https");
do_print("Untyped is not accounted for https");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("https://moz.org/test/") });
yield check_autocomplete({
@ -286,7 +286,7 @@ add_task(function* test_untyped_secure() {
});
add_task(function* test_untyped_secure_www() {
do_log_info("Untyped is not accounted for https://www");
do_print("Untyped is not accounted for https://www");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.moz.org/test/") });
yield check_autocomplete({

View File

@ -6,7 +6,7 @@
// ensure autocomplete is able to dinamically switch behavior.
add_task(function* test_domain() {
do_log_info("Searching for domain should autoFill it");
do_print("Searching for domain should autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
@ -18,7 +18,7 @@ add_task(function* test_domain() {
});
add_task(function* test_url() {
do_log_info("Searching for url should autoFill it");
do_print("Searching for url should autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
@ -32,7 +32,7 @@ add_task(function* test_url() {
// Now do searches with typed behavior forced to true.
add_task(function* test_untyped_domain() {
do_log_info("Searching for non-typed domain should not autoFill it");
do_print("Searching for non-typed domain should not autoFill it");
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
search: "moz",
@ -43,7 +43,7 @@ add_task(function* test_untyped_domain() {
});
add_task(function* test_typed_domain() {
do_log_info("Searching for typed domain should autoFill it");
do_print("Searching for typed domain should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/typed/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -55,7 +55,7 @@ add_task(function* test_typed_domain() {
});
add_task(function* test_untyped_url() {
do_log_info("Searching for non-typed url should not autoFill it");
do_print("Searching for non-typed url should not autoFill it");
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
search: "mozilla.org/li",
@ -66,7 +66,7 @@ add_task(function* test_untyped_url() {
});
add_task(function* test_typed_url() {
do_log_info("Searching for typed url should autoFill it");
do_print("Searching for typed url should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

View File

@ -3,21 +3,21 @@
add_task(function*() {
do_log_info("visit url, no protocol");
do_print("visit url, no protocol");
yield check_autocomplete({
search: "mozilla.org",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("visiturl", {url: "http://mozilla.org/", input: "mozilla.org"}), title: "http://mozilla.org/", style: [ "action", "visiturl" ] } ]
});
do_log_info("visit url, with protocol");
do_print("visit url, with protocol");
yield check_autocomplete({
search: "https://mozilla.org",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("visiturl", {url: "https://mozilla.org/", input: "https://mozilla.org"}), title: "https://mozilla.org/", style: [ "action", "visiturl" ] } ]
});
do_log_info("visit url, about: protocol (no host)");
do_print("visit url, about: protocol (no host)");
yield check_autocomplete({
search: "about:config",
searchParam: "enable-actions",
@ -26,7 +26,7 @@ add_task(function*() {
// This is distinct because of how we predict being able to url autofill via
// host lookups.
do_log_info("visit url, host matching visited host but not visited url");
do_print("visit url, host matching visited host but not visited url");
yield promiseAddVisits([
{ uri: NetUtil.newURI("http://mozilla.org/wine/"), title: "Mozilla Wine", transition: TRANSITION_TYPED },
]);
@ -37,7 +37,7 @@ add_task(function*() {
});
// And hosts with no dot in them are special, due to requiring whitelisting.
do_log_info("visit url, host matching visited host but not visited url, non-whitelisted host");
do_print("visit url, host matching visited host but not visited url, non-whitelisted host");
Services.search.addEngineWithDetails("MozSearch", "", "", "", "GET",
"http://s.example.com/search");
let engine = Services.search.getEngineByName("MozSearch");

View File

@ -47,7 +47,7 @@ add_task(function* test_escape() {
// match only on word boundaries
Services.prefs.setIntPref("browser.urlbar.matchBehavior", 2);
do_log_info("Match 'match' at the beginning or after / or on a CamelCase");
do_print("Match 'match' at the beginning or after / or on a CamelCase");
yield check_autocomplete({
search: "match",
matches: [ { uri: uri1, title: "title1" },
@ -56,7 +56,7 @@ add_task(function* test_escape() {
{ uri: uri10, title: "title1" } ]
});
do_log_info("Match 'dont' at the beginning or after /");
do_print("Match 'dont' at the beginning or after /");
yield check_autocomplete({
search: "dont",
matches: [ { uri: uri2, title: "title1" },
@ -64,7 +64,7 @@ add_task(function* test_escape() {
{ uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Match 'match' at the beginning or after / or on a CamelCase");
do_print("Match 'match' at the beginning or after / or on a CamelCase");
yield check_autocomplete({
search: "2",
matches: [ { uri: uri3, title: "matchme2" },
@ -73,7 +73,7 @@ add_task(function* test_escape() {
{ uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Match 't' at the beginning or after /");
do_print("Match 't' at the beginning or after /");
yield check_autocomplete({
search: "t",
matches: [ { uri: uri1, title: "title1" },
@ -85,13 +85,13 @@ add_task(function* test_escape() {
{ uri: uri10, title: "title1" } ]
});
do_log_info("Match 'word' after many consecutive word boundaries");
do_print("Match 'word' after many consecutive word boundaries");
yield check_autocomplete({
search: "word",
matches: [ { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" } ]
});
do_log_info("Match a word boundary '/' for everything");
do_print("Match a word boundary '/' for everything");
yield check_autocomplete({
search: "/",
matches: [ { uri: uri1, title: "title1" },
@ -106,50 +106,50 @@ add_task(function* test_escape() {
{ uri: uri10, title: "title1" } ]
});
do_log_info("Match word boundaries '()_+' that are among word boundaries");
do_print("Match word boundaries '()_+' that are among word boundaries");
yield check_autocomplete({
search: "()_+",
matches: [ { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" } ]
});
do_log_info("Katakana characters form a string, so match the beginning");
do_print("Katakana characters form a string, so match the beginning");
yield check_autocomplete({
search: katakana[0],
matches: [ { uri: uri8, title: katakana.join("") } ]
});
/*
do_log_info("Middle of a katakana word shouldn't be matched");
do_print("Middle of a katakana word shouldn't be matched");
yield check_autocomplete({
search: katakana[1],
matches: [ ]
});
*/
do_log_info("Ideographs are treated as words so 'nin' is one word");
do_print("Ideographs are treated as words so 'nin' is one word");
yield check_autocomplete({
search: ideograph[0],
matches: [ { uri: uri9, title: ideograph.join("") } ]
});
do_log_info("Ideographs are treated as words so 'ten' is another word");
do_print("Ideographs are treated as words so 'ten' is another word");
yield check_autocomplete({
search: ideograph[1],
matches: [ { uri: uri9, title: ideograph.join("") } ]
});
do_log_info("Ideographs are treated as words so 'do' is yet another word");
do_print("Ideographs are treated as words so 'do' is yet another word");
yield check_autocomplete({
search: ideograph[2],
matches: [ { uri: uri9, title: ideograph.join("") } ]
});
do_log_info("Extra negative assert that we don't match in the middle");
do_print("Extra negative assert that we don't match in the middle");
yield check_autocomplete({
search: "ch",
matches: [ ]
});
do_log_info("Don't match one character after a camel-case word boundary (bug 429498)");
do_print("Don't match one character after a camel-case word boundary (bug 429498)");
yield check_autocomplete({
search: "atch",
matches: [ ]

View File

@ -5,7 +5,7 @@
// Ensure inline autocomplete doesn't return zero frecency pages.
add_task(function* test_zzero_frec_domain() {
do_log_info("Searching for zero frecency domain should not autoFill it");
do_print("Searching for zero frecency domain should not autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
transition: TRANSITION_FRAMED_LINK });
@ -18,7 +18,7 @@ add_task(function* test_zzero_frec_domain() {
});
add_task(function* test_zzero_frec_url() {
do_log_info("Searching for zero frecency url should not autoFill it");
do_print("Searching for zero frecency url should not autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
transition: TRANSITION_FRAMED_LINK });

View File

@ -13,7 +13,7 @@
add_task(function changeuri_unvisited_bookmark()
{
do_log_info("After changing URI of bookmark, frecency of bookmark's " +
do_print("After changing URI of bookmark, frecency of bookmark's " +
"original URI should be zero if original URI is unvisited and " +
"no longer bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
@ -23,14 +23,14 @@ add_task(function changeuri_unvisited_bookmark()
"bookmark title");
yield promiseAsyncUpdates();
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.changeBookmarkURI(id, uri("http://example.com/2"));
yield promiseAsyncUpdates();
do_log_info("Unvisited URI no longer bookmarked => frecency should = 0");
do_print("Unvisited URI no longer bookmarked => frecency should = 0");
do_check_eq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -39,7 +39,7 @@ add_task(function changeuri_unvisited_bookmark()
add_task(function changeuri_visited_bookmark()
{
do_log_info("After changing URI of bookmark, frecency of bookmark's " +
do_print("After changing URI of bookmark, frecency of bookmark's " +
"original URI should not be zero if original URI is visited.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
@ -49,7 +49,7 @@ add_task(function changeuri_visited_bookmark()
yield promiseAsyncUpdates();
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
yield promiseAddVisits(TEST_URI);
@ -60,7 +60,7 @@ add_task(function changeuri_visited_bookmark()
yield promiseAsyncUpdates();
do_log_info("*Visited* URI no longer bookmarked => frecency should != 0");
do_print("*Visited* URI no longer bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -69,7 +69,7 @@ add_task(function changeuri_visited_bookmark()
add_task(function changeuri_bookmark_still_bookmarked()
{
do_log_info("After changing URI of bookmark, frecency of bookmark's " +
do_print("After changing URI of bookmark, frecency of bookmark's " +
"original URI should not be zero if original URI is still " +
"bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
@ -84,14 +84,14 @@ add_task(function changeuri_bookmark_still_bookmarked()
yield promiseAsyncUpdates();
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.changeBookmarkURI(id1, uri("http://example.com/2"));
yield promiseAsyncUpdates();
do_log_info("URI still bookmarked => frecency should != 0");
do_print("URI still bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -100,7 +100,7 @@ add_task(function changeuri_bookmark_still_bookmarked()
add_task(function changeuri_nonexistent_bookmark()
{
do_log_info("Changing the URI of a nonexistent bookmark should fail.");
do_print("Changing the URI of a nonexistent bookmark should fail.");
function tryChange(itemId)
{
try {

View File

@ -89,7 +89,7 @@ function promiseDefaultSearchEngine() {
function promiseSearchTopic(expectedVerb) {
let deferred = Promise.defer();
Services.obs.addObserver( function observe(subject, topic, verb) {
do_log_info("browser-search-engine-modified: " + verb);
do_print("browser-search-engine-modified: " + verb);
if (verb == expectedVerb) {
Services.obs.removeObserver(observe, "browser-search-engine-modified");
deferred.resolve();

View File

@ -69,7 +69,7 @@ function TitleChangedObserver(aURI,
TitleChangedObserver.prototype = {
__proto__: NavHistoryObserver.prototype,
onTitleChanged(aURI, aTitle, aGUID) {
do_log_info("onTitleChanged(" + aURI.spec + ", " + aTitle + ", " + aGUID + ")");
do_print("onTitleChanged(" + aURI.spec + ", " + aTitle + ", " + aGUID + ")");
if (!this.uri.equals(aURI)) {
return;
}
@ -106,7 +106,7 @@ VisitObserver.prototype = {
aTransitionType,
aGUID)
{
do_log_info("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime +
do_print("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime +
", " + aSessionId + ", " + aReferringId + ", " +
aTransitionType + ", " + aGUID + ")");
if (!this.uri.equals(aURI) || this.guid != aGUID) {
@ -252,7 +252,7 @@ add_task(function* test_no_visits_throws() {
(aPlace.uri ? "uri" : "no uri") + ", " +
(aPlace.guid ? "guid" : "no guid") + ", " +
(aPlace.visits ? "visits array" : "no visits array");
do_log_info(str);
do_print(str);
};
// Loop through every possible case. Note that we don't actually care about
@ -375,7 +375,7 @@ add_task(function* test_non_addable_uri_errors() {
// NetUtil.newURI() can throw if e.g. our app knows about imap://
// but the account is not set up and so the URL is invalid for us.
// Note this in the log but ignore as it's not the subject of this test.
do_log_info("Could not construct URI for '" + url + "'; ignoring");
do_print("Could not construct URI for '" + url + "'; ignoring");
}
});
@ -384,7 +384,7 @@ add_task(function* test_non_addable_uri_errors() {
do_throw("Unexpected success.");
}
for (let place of placesResult.errors) {
do_log_info("Checking '" + place.info.uri.spec + "'");
do_print("Checking '" + place.info.uri.spec + "'");
do_check_eq(place.resultCode, Cr.NS_ERROR_INVALID_ARG);
do_check_false(yield promiseIsURIVisited(place.info.uri));
}
@ -1046,7 +1046,7 @@ add_task(function* test_visit_notifies() {
});
PlacesUtils.history.addObserver(visitObserver, false);
let observer = function(aSubject, aTopic, aData) {
do_log_info("observe(" + aSubject + ", " + aTopic + ", " + aData + ")");
do_print("observe(" + aSubject + ", " + aTopic + ", " + aData + ")");
do_check_true(aSubject instanceof Ci.nsIURI);
do_check_true(aSubject.equals(place.uri));
@ -1084,7 +1084,7 @@ add_task(function* test_callbacks_not_supplied() {
// NetUtil.newURI() can throw if e.g. our app knows about imap://
// but the account is not set up and so the URL is invalid for us.
// Note this in the log but ignore as it's not the subject of this test.
do_log_info("Could not construct URI for '" + url + "'; ignoring");
do_print("Could not construct URI for '" + url + "'; ignoring");
}
});

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