From e1ca908429f92b2638006efd53983fd6cc1d2f24 Mon Sep 17 00:00:00 2001 From: Ian Melven Date: Mon, 18 Mar 2013 12:43:21 -0700 Subject: [PATCH] Bug 846458 - intermittent TEST-UNEXPECTED-PASS | /tests/content/base/test/test_bug548193.html | Assertion count 0 is less than expected range 1-1 assertions. (r=sstamm) --- content/base/src/CSPUtils.jsm | 9 ++++++- content/base/test/test_bug548193.html | 36 +++++++++++---------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/content/base/src/CSPUtils.jsm b/content/base/src/CSPUtils.jsm index 540c68637405..fad70fd0fdaf 100644 --- a/content/base/src/CSPUtils.jsm +++ b/content/base/src/CSPUtils.jsm @@ -1909,7 +1909,14 @@ CSPViolationReportListener.prototype = { function(request, context) { }, onDataAvailable: - function(request, context, inputStream, offset, count) { }, + function(request, context, inputStream, offset, count) { + // We MUST read equal to count from the inputStream to avoid an assertion. + var input = Components.classes['@mozilla.org/scriptableinputstream;1'] + .createInstance(Ci.nsIScriptableInputStream); + + input.init(inputStream); + input.read(count); + }, }; diff --git a/content/base/test/test_bug548193.html b/content/base/test/test_bug548193.html index 702989da8dd8..94d621d569fd 100644 --- a/content/base/test/test_bug548193.html +++ b/content/base/test/test_bug548193.html @@ -12,48 +12,45 @@