This commit is contained in:
Ryan VanderMeulen 2012-12-23 14:58:26 -05:00
Родитель df40dc3f4d 09f40e4856
Коммит ffee0a86cf
25 изменённых файлов: 280 добавлений и 54 удалений

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

@ -338,7 +338,7 @@ pref("urlclassifier.gethashtables", "goog-phish-shavar,goog-malware-shavar");
// If an urlclassifier table has not been updated in this number of seconds,
// a gethash request will be forced to check that the result is still in
// the database.
pref("urlclassifier.confirm-age", 2700);
pref("urlclassifier.max-complete-age", 2700);
// URL for checking the reason for a malware warning.
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");

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

@ -43,6 +43,7 @@ MOZ_APP_ID={3c2e2abc-06d4-11e1-ac3b-374f68613e61}
MOZ_EXTENSION_MANAGER=1
MOZ_SYS_MSG=1
MOZ_TIME_MANAGER=1
MOZ_B2G_CERTDATA=1
MOZ_PAY=1

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

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1354916891000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1356125617000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -46,7 +46,7 @@
</versionRange>
</emItem>
<emItem blockID="i236" id="{EEE6C361-6118-11DC-9C72-001320C79847}">
<versionRange minVersion="0" maxVersion="*" severity="1">
<versionRange minVersion="0" maxVersion="1.7.999" severity="1">
</versionRange>
</emItem>
<emItem blockID="i64" id="royal@facebook.com">
@ -68,7 +68,7 @@
<emItem blockID="i238" id="/^pink@.*\.info$/">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="19.0a1" maxVersion="*" />
<versionRange minVersion="18.0" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
@ -555,32 +555,16 @@
</versionRange>
</pluginItem>
<pluginItem blockID="p152">
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="0" maxVersion="4.1.10328.0" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="0" maxVersion="4.1.10328.0" severity="0" vulnerabilitystatus="1"></versionRange>
</pluginItem>
<pluginItem blockID="p154">
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="5.0" maxVersion="5.1.10410.0" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="5.0" maxVersion="5.1.10410.0" severity="0" vulnerabilitystatus="1"></versionRange>
</pluginItem>
<pluginItem blockID="p156">
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="0" maxVersion="9.5.1" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="0" maxVersion="9.5.1" severity="0" vulnerabilitystatus="1"></versionRange>
</pluginItem>
<pluginItem blockID="p158">
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="10.0" maxVersion="10.1.3" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="10.0" maxVersion="10.1.3" severity="0" vulnerabilitystatus="1"></versionRange>
</pluginItem>
<pluginItem blockID="p160">
<match name="filename" exp="NPSWF32\.dll" /> <versionRange minVersion="0" maxVersion="10.2.9999" severity="0" vulnerabilitystatus="1">
@ -606,42 +590,42 @@
<pluginItem blockID="p180">
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 7 Update 07" maxVersion="Java 7 Update 08" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
<versionRange minVersion="17.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p182">
<match name="name" exp="Java\(TM\) Platform SE 7 U[7-8](\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
<versionRange minVersion="17.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p184">
<match name="name" exp="Java\(TM\) Plug-in 1\.7\.0(_0?([7-8]))?([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
<versionRange minVersion="17.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p186">
<match name="name" exp="Java\(TM\) Platform SE 6 U3[3-6](\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
<versionRange minVersion="17.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p188">
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 6 Update 0" maxVersion="Java 6 Update 36" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
<versionRange minVersion="17.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p190">
<match name="name" exp="Java\(TM\) Plug-in 1\.6\.0_3[3-6]([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
<versionRange minVersion="17.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
@ -666,6 +650,16 @@
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p240">
<match name="filename" exp="DivXBrowserPlugin\.plugin" /> <versionRange minVersion="0" maxVersion="1.4" severity="1"></versionRange>
</pluginItem>
<pluginItem os="Darwin" blockID="p242">
<match name="description" exp="Flip4Mac" /> <versionRange minVersion="0" maxVersion="2.4.3.999" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
</pluginItems>
<gfxItems>

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

@ -734,7 +734,7 @@ pref("urlclassifier.gethashtables", "goog-phish-shavar,goog-malware-shavar");
// If an urlclassifier table has not been updated in this number of seconds,
// a gethash request will be forced to check that the result is still in
// the database.
pref("urlclassifier.confirm-age", 2700);
pref("urlclassifier.max-complete-age", 2700);
#endif
pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/");

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

@ -4308,6 +4308,7 @@ MOZ_WEBSMS_BACKEND=
MOZ_GRAPHITE=1
ACCESSIBILITY=1
MOZ_SYS_MSG=
MOZ_TIME_MANAGER=
MOZ_PAY=
MOZ_AUDIO_CHANNEL_MANAGER=
@ -7573,6 +7574,14 @@ if test -n "$MOZ_SYS_MSG"; then
fi
AC_SUBST(MOZ_SYS_MSG)
dnl ========================================================
dnl = Enable Support for Time Manager API
dnl ========================================================
if test -n "$MOZ_TIME_MANAGER"; then
AC_DEFINE(MOZ_TIME_MANAGER)
fi
AC_SUBST(MOZ_TIME_MANAGER)
dnl ========================================================
dnl = Enable Camera Interface for B2G (Gonk usually)
dnl ========================================================

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

@ -582,7 +582,8 @@ static const TrackRate RATE_VIDEO = USECS_PER_S;
void nsBuiltinDecoderStateMachine::SendStreamData()
{
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
NS_ASSERTION(OnDecodeThread() ||
OnStateMachineThread(), "Should be on decode thread or state machine thread");
mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
DecodedStreamData* stream = mDecoder->GetDecodedStream();
@ -592,6 +593,13 @@ void nsBuiltinDecoderStateMachine::SendStreamData()
if (mState == DECODER_STATE_DECODING_METADATA)
return;
// If there's still an audio thread alive, then we can't send any stream
// data yet since both SendStreamData and the audio thread want to be in
// charge of popping the audio queue. We're waiting for the audio thread
// to die before sending anything to our stream.
if (mAudioThread)
return;
int64_t minLastAudioPacketTime = INT64_MAX;
SourceMediaStream* mediaStream = stream->mStream;
StreamTime endPosition = 0;
@ -1338,8 +1346,12 @@ void nsBuiltinDecoderStateMachine::SetAudioCaptured(bool aCaptured)
{
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (!mAudioCaptured && aCaptured) {
StopAudioThread();
if (!mAudioCaptured && aCaptured && !mStopAudioThread) {
// Make sure the state machine runs as soon as possible. That will
// stop the audio thread.
// If mStopAudioThread is true then we're already stopping the audio thread
// and since we set mAudioCaptured to true, nothing can start it again.
ScheduleStateMachine();
}
mAudioCaptured = aCaptured;
}
@ -1547,7 +1559,15 @@ void nsBuiltinDecoderStateMachine::StopDecodeThread()
void nsBuiltinDecoderStateMachine::StopAudioThread()
{
NS_ASSERTION(OnDecodeThread() ||
OnStateMachineThread(), "Should be on decode thread or state machine thread");
mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
if (mStopAudioThread) {
// Nothing to do, since the thread is already stopping
return;
}
mStopAudioThread = true;
mDecoder->GetReentrantMonitor().NotifyAll();
if (mAudioThread) {
@ -1557,6 +1577,9 @@ void nsBuiltinDecoderStateMachine::StopAudioThread()
mAudioThread->Shutdown();
}
mAudioThread = nullptr;
// Now that the audio thread is dead, try sending data to our MediaStream(s).
// That may have been waiting for the audio thread to stop.
SendStreamData();
}
}
@ -1633,8 +1656,13 @@ nsBuiltinDecoderStateMachine::StartAudioThread()
NS_ASSERTION(OnStateMachineThread() || OnDecodeThread(),
"Should be on state machine or decode thread.");
mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
if (mAudioCaptured) {
NS_ASSERTION(mStopAudioThread, "mStopAudioThread must always be true if audio is captured");
return NS_OK;
}
mStopAudioThread = false;
if (HasAudio() && !mAudioThread && !mAudioCaptured) {
if (HasAudio() && !mAudioThread) {
nsresult rv = NS_NewNamedThread("Media Audio",
getter_AddRefs(mAudioThread),
nullptr,
@ -2499,6 +2527,11 @@ nsresult nsBuiltinDecoderStateMachine::CallRunStateMachine()
// This flag prevents us from dispatching
mDispatchedRunEvent = false;
// If audio is being captured, stop the audio thread if it's running
if (mAudioCaptured) {
StopAudioThread();
}
mTimeout = TimeStamp();
mIsRunning = true;

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

@ -610,7 +610,8 @@ protected:
// been consumed by the play state machine thread.
uint32_t mAmpleVideoFrames;
// True if we shouldn't play our audio (but still write it to any capturing
// streams).
// streams). When this is true, mStopAudioThread is always true and
// the audio thread will never start again after it has stopped.
bool mAudioCaptured;
// True if the media resource can be seeked. Accessed from the state

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

@ -135,7 +135,9 @@ NS_INTERFACE_MAP_BEGIN(Navigator)
#endif
NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorCamera)
NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorSystemMessages)
#ifdef MOZ_TIME_MANAGER
NS_INTERFACE_MAP_ENTRY(nsIDOMMozNavigatorTime)
#endif
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
NS_INTERFACE_MAP_ENTRY(nsIMozNavigatorAudioChannelManager)
#endif
@ -1378,6 +1380,7 @@ Navigator::MozSetMessageHandler(const nsAString& aType,
//*****************************************************************************
// Navigator::nsIDOMNavigatorTime
//*****************************************************************************
#ifdef MOZ_TIME_MANAGER
NS_IMETHODIMP
Navigator::GetMozTime(nsIDOMMozTimeManager** aTime)
{
@ -1394,6 +1397,7 @@ Navigator::GetMozTime(nsIDOMMozTimeManager** aTime)
NS_ADDREF(*aTime = mTimeManager);
return NS_OK;
}
#endif
//*****************************************************************************
// nsNavigator::nsIDOMNavigatorCamera

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

@ -113,7 +113,9 @@ class Navigator : public nsIDOMNavigator
#endif
, public nsIDOMNavigatorCamera
, public nsIDOMNavigatorSystemMessages
#ifdef MOZ_TIME_MANAGER
, public nsIDOMMozNavigatorTime
#endif
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
, public nsIMozNavigatorAudioChannelManager
#endif
@ -147,7 +149,9 @@ public:
NS_DECL_NSIDOMNAVIGATORBLUETOOTH
#endif
NS_DECL_NSIDOMNAVIGATORSYSTEMMESSAGES
#ifdef MOZ_TIME_MANAGER
NS_DECL_NSIDOMMOZNAVIGATORTIME
#endif
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
NS_DECL_NSIMOZNAVIGATORAUDIOCHANNELMANAGER

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

@ -535,7 +535,9 @@ using mozilla::dom::indexedDB::IDBWrapperCache;
#include "nsIDOMNavigatorSystemMessages.h"
#include "mozilla/dom/Activity.h"
#ifdef MOZ_TIME_MANAGER
#include "TimeManager.h"
#endif
#include "DOMCameraManager.h"
#include "DOMCameraControl.h"
@ -1726,8 +1728,10 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(MozActivity, nsEventTargetSH,
EVENTTARGET_SCRIPTABLE_FLAGS)
#ifdef MOZ_TIME_MANAGER
NS_DEFINE_CLASSINFO_DATA(MozTimeManager, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif
#ifdef MOZ_WEBRTC
NS_DEFINE_CLASSINFO_DATA(DataChannel, nsEventTargetSH,
@ -2526,7 +2530,9 @@ nsDOMClassInfo::Init()
#ifdef MOZ_SYS_MSG
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNavigatorSystemMessages)
#endif
#ifdef MOZ_TIME_MANAGER
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozNavigatorTime)
#endif
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
DOM_CLASSINFO_MAP_ENTRY(nsIMozNavigatorAudioChannelManager)
#endif
@ -4542,9 +4548,11 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_END
#ifdef MOZ_TIME_MANAGER
DOM_CLASSINFO_MAP_BEGIN(MozTimeManager, nsIDOMMozTimeManager)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozTimeManager)
DOM_CLASSINFO_MAP_END
#endif
#ifdef MOZ_WEBRTC
DOM_CLASSINFO_MAP_BEGIN(DataChannel, nsIDOMDataChannel)

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

@ -531,7 +531,9 @@ DOMCI_CLASS(LockedFile)
DOMCI_CLASS(MozActivity)
#ifdef MOZ_TIME_MANAGER
DOMCI_CLASS(MozTimeManager)
#endif
#ifdef MOZ_WEBRTC
DOMCI_CLASS(DataChannel)

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

@ -129,6 +129,7 @@ MOCHITEST_FILES = \
test_bug750051.html \
test_bug755320.html \
test_bug777628.html \
test_bug823173.html \
$(NULL)
ifneq (Linux,$(OS_ARCH))

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

@ -0,0 +1,30 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=823173
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 823173</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=823173">Mozilla Bug 823173</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 823173 **/
try {
ok(!(navigator instanceof Window), "navigator is not an instance of Window");
} catch (e) {
ok(false, "instanceof tests should not throw");
}
</script>
</pre>
</body>
</html>

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

@ -7,7 +7,9 @@
#include "nsITimeService.h"
#include "TimeManager.h"
#ifdef MOZ_TIME_MANAGER
DOMCI_DATA(MozTimeManager, mozilla::dom::time::TimeManager)
#endif
namespace mozilla {
namespace dom {
@ -16,7 +18,9 @@ namespace time {
NS_INTERFACE_MAP_BEGIN(TimeManager)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozTimeManager)
NS_INTERFACE_MAP_ENTRY(nsISupports)
#ifdef MOZ_TIME_MANAGER
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozTimeManager)
#endif
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(TimeManager)

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

@ -20,6 +20,9 @@
#endif
#if defined(OS_MACOSX) || defined(OS_BSD)
#if defined(OS_OPENBSD)
#include <sys/proc.h>
#endif
#include <sys/sysctl.h>
#endif

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

@ -576,7 +576,7 @@ pref("urlclassifier.gethashtables", "goog-phish-shavar,goog-malware-shavar");
// If an urlclassifier table has not been updated in this number of seconds,
// a gethash request will be forced to check that the result is still in
// the database.
pref("urlclassifier.confirm-age", 2700);
pref("urlclassifier.max-complete-age", 2700);
#endif
// True if this is the first time we are showing about:firstrun

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

@ -628,7 +628,7 @@ pref("urlclassifier.gethashtables", "goog-phish-shavar,goog-malware-shavar");
// If an urlclassifier table has not been updated in this number of seconds,
// a gethash request will be forced to check that the result is still in
// the database.
pref("urlclassifier.confirm-age", 2700);
pref("urlclassifier.max-complete-age", 2700);
// URL for checking the reason for a malware warning.
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");

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

@ -987,10 +987,13 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr,
// pass the bytes-unit and the SP
char *range = (char *) strchr(colon + 2, ' ');
if (!range)
return NS_ERROR_FAILURE;
do {
range++;
} while (*range == ' ');
if (range[0] == '*'){
mByteRangeStart = mByteRangeEnd = 0;
}

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

@ -0,0 +1,122 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
Cu.import("resource://testing-common/httpd.js");
var httpserver = null;
var uri = "http://localhost:4444/multipart";
function make_channel(url) {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return ios.newChannel(url, "", null);
}
var multipartBody = "--boundary\r\n"+
"Content-type: text/plain\r\n"+
"Content-range: bytes 0-2/10\r\n"+
"\r\n"+
"aaa\r\n"+
"--boundary\r\n"+
"Content-type: text/plain\r\n"+
"Content-range: bytes 3-7/10\r\n"+
"\r\n"+
"bbbbb"+
"\r\n"+
"--boundary\r\n"+
"Content-type: text/plain\r\n"+
"Content-range: bytes 8-9/10\r\n"+
"\r\n"+
"cc"+
"\r\n"+
"--boundary--";
function make_channel(url) {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return ios.newChannel(url, "", null);
}
function contentHandler(metadata, response)
{
response.setHeader("Content-Type", 'multipart/byteranges; boundary="boundary"');
response.bodyOutputStream.write(multipartBody, multipartBody.length);
}
var numTests = 2;
var testNum = 0;
var testData =
[
{ data: "aaa", type: "text/plain", isByteRangeRequest: true, startRange: 0, endRange: 2 },
{ data: "bbbbb", type: "text/plain", isByteRangeRequest: true, startRange: 3, endRange: 7 },
{ data: "cc", type: "text/plain", isByteRangeRequest: true, startRange: 8, endRange: 9 }
];
function responseHandler(request, buffer)
{
do_check_eq(buffer, testData[testNum].data);
do_check_eq(request.QueryInterface(Ci.nsIChannel).contentType,
testData[testNum].type);
do_check_eq(request.QueryInterface(Ci.nsIByteRangeRequest).isByteRangeRequest,
testData[testNum].isByteRangeRequest);
do_check_eq(request.QueryInterface(Ci.nsIByteRangeRequest).startRange,
testData[testNum].startRange);
do_check_eq(request.QueryInterface(Ci.nsIByteRangeRequest).endRange,
testData[testNum].endRange);
if (++testNum == numTests)
httpserver.stop(do_test_finished);
}
var multipartListener = {
_buffer: "",
QueryInterface: function(iid) {
if (iid.equals(Components.interfaces.nsIStreamListener) ||
iid.equals(Components.interfaces.nsIRequestObserver) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
onStartRequest: function(request, context) {
this._buffer = "";
},
onDataAvailable: function(request, context, stream, offset, count) {
try {
this._buffer = this._buffer.concat(read_stream(stream, count));
dump("BUFFEEE: " + this._buffer + "\n\n");
} catch (ex) {
do_throw("Error in onDataAvailable: " + ex);
}
},
onStopRequest: function(request, context, status) {
try {
responseHandler(request, this._buffer);
} catch (ex) {
do_throw("Error in closure function: " + ex);
}
}
};
function run_test()
{
httpserver = new HttpServer();
httpserver.registerPathHandler("/multipart", contentHandler);
httpserver.start(4444);
var streamConv = Cc["@mozilla.org/streamConverters;1"]
.getService(Ci.nsIStreamConverterService);
var conv = streamConv.asyncConvertData("multipart/byteranges",
"*/*",
multipartListener,
null);
var chan = make_channel(uri);
chan.asyncOpen(conv, null);
do_test_pending();
}

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

@ -145,6 +145,7 @@ skip-if = os == "android"
[test_mismatch_last-modified.js]
[test_MIME_params.js]
[test_mozTXTToHTMLConv.js]
[test_multipart_byteranges.js]
[test_multipart_streamconv.js]
[test_multipart_streamconv_missing_lead_boundary.js]
[test_nestedabout_serialize.js]

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

@ -177,6 +177,7 @@
"dom/tests/mochitest/bugs/test_bug597809.html": "",
"dom/tests/mochitest/bugs/test_bug61098.html": "",
"dom/tests/mochitest/bugs/test_bug641552.html": "",
"dom/tests/mochitest/bugs/test_bug823173.html": "disabled on Android for Firefox 18 because their xpts are all broken. See bug 807222 part 5",
"dom/tests/mochitest/bugs/test_devicemotion_multiple_listeners.html": "bug 775227",
"dom/tests/mochitest/bugs/test_resize_move_windows.html": "TIMED_OUT",
"dom/tests/mochitest/bugs/test_window_bar.html": "",

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

@ -54,7 +54,11 @@ LookupCache::LookupCache(const nsACString& aTableName, nsIFile* aStoreDir,
, mPerClientRandomize(aPerClientRandomize)
, mTableName(aTableName)
, mStoreDirectory(aStoreDir)
, mTestTable(false)
{
if (mTableName.RFind(NS_LITERAL_CSTRING("-simple")) != kNotFound) {
mTestTable = true;
}
}
nsresult
@ -199,14 +203,6 @@ LookupCache::Has(const Completion& aCompletion,
{
*aHas = *aComplete = false;
// check completion store first
if (mCompletions.BinaryIndexOf(aCompletion) != nsTArray<Completion>::NoIndex) {
LOG(("Complete in %s", mTableName.get()));
*aComplete = true;
*aHas = true;
return NS_OK;
}
uint32_t prefix = aCompletion.ToUint32();
uint32_t hostkey = aHostkey.ToUint32();
uint32_t codedkey;
@ -223,8 +219,14 @@ LookupCache::Has(const Completion& aCompletion,
LOG(("Probe in %s: %X, found %d", mTableName.get(), prefix, found));
if (found) {
*aHas = true;
if (found || mTestTable) {
*aHas = found;
// check completion store
if (mCompletions.BinaryIndexOf(aCompletion) != nsTArray<Completion>::NoIndex) {
LOG(("Complete in %s", mTableName.get()));
*aHas = true;
*aComplete = true;
}
}
return NS_OK;

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

@ -152,6 +152,9 @@ private:
CompletionArray mCompletions;
// Set of prefixes known to be in the database
nsRefPtr<nsUrlClassifierPrefixSet> mPrefixSet;
// Fx18 temporary; true if this is a -simple test table.
bool mTestTable;
};
}

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

@ -70,7 +70,7 @@ PRLogModuleInfo *gUrlClassifierDbServiceLog = nullptr;
#define GETHASH_TABLES_PREF "urlclassifier.gethashtables"
#define CONFIRM_AGE_PREF "urlclassifier.confirm-age"
#define CONFIRM_AGE_PREF "urlclassifier.max-complete-age"
#define CONFIRM_AGE_DEFAULT_SEC (45 * 60)
class nsUrlClassifierDBServiceWorker;

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

@ -661,7 +661,7 @@ function testStaleList()
};
// Consider a match stale after one second.
prefBranch.setIntPref("urlclassifier.confirm-age", 1);
prefBranch.setIntPref("urlclassifier.max-complete-age", 1);
// Apply the update.
doStreamUpdate(update, function() {
@ -670,7 +670,7 @@ function testStaleList()
new Timer(3000, function() {
// Now the lists should be marked stale. Check assertions.
checkAssertions(assertions, function() {
prefBranch.setIntPref("urlclassifier.confirm-age", 2700);
prefBranch.setIntPref("urlclassifier.max-complete-age", 2700);
runNextTest();
});
}, updateError);
@ -701,7 +701,7 @@ function testStaleListEmpty()
};
// Consider a match stale after one second.
prefBranch.setIntPref("urlclassifier.confirm-age", 1);
prefBranch.setIntPref("urlclassifier.max-complete-age", 1);
// Apply the update.
doStreamUpdate(update, function() {
@ -710,7 +710,7 @@ function testStaleListEmpty()
new Timer(3000, function() {
// Now the lists should be marked stale. Check assertions.
checkAssertions(assertions, function() {
prefBranch.setIntPref("urlclassifier.confirm-age", 2700);
prefBranch.setIntPref("urlclassifier.max-complete-age", 2700);
runNextTest();
});
}, updateError);