Backed out 2 changesets (bug 1322396) for unexpected-pass failures in browser_use_counters.js

Backed out changeset 211d8715c965 (bug 1322396)
Backed out changeset aae1f858f6de (bug 1322396)

MozReview-Commit-ID: EYvhigQ0NSO
This commit is contained in:
Phil Ringnalda 2017-01-09 18:45:08 -08:00
Родитель 176fe53134
Коммит d55961eb9d
4 изменённых файлов: 9 добавлений и 35 удалений

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

@ -4026,10 +4026,7 @@ nsDOMWindowUtils::ForceUseCounterFlush(nsIDOMNode *aNode)
mozilla::css::ImageLoader* loader = doc->StyleImageLoader();
loader->FlushUseCounters();
// Flush the document and any external documents that it depends on.
const auto reportKind
= nsDocument::UseCounterReportKind::eIncludeExternalResources;
static_cast<nsDocument*>(doc.get())->ReportUseCounters(reportKind);
static_cast<nsDocument*>(doc.get())->ReportUseCounters();
return NS_OK;
}

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

@ -12304,17 +12304,8 @@ MightBeAboutOrChromeScheme(nsIURI* aURI)
return isAbout || isChrome;
}
static bool
ReportExternalResourceUseCounters(nsIDocument* aDocument, void* aData)
{
const auto reportKind
= nsDocument::UseCounterReportKind::eIncludeExternalResources;
static_cast<nsDocument*>(aDocument)->ReportUseCounters(reportKind);
return true;
}
void
nsDocument::ReportUseCounters(UseCounterReportKind aKind)
nsDocument::ReportUseCounters()
{
static const bool sDebugUseCounters = false;
if (mReportedUseCounters) {
@ -12323,10 +12314,6 @@ nsDocument::ReportUseCounters(UseCounterReportKind aKind)
mReportedUseCounters = true;
if (aKind == UseCounterReportKind::eIncludeExternalResources) {
EnumerateExternalResources(ReportExternalResourceUseCounters, nullptr);
}
if (Telemetry::HistogramUseCounterCount > 0 &&
(IsContentDocument() || IsResourceDoc())) {
nsCOMPtr<nsIURI> uri;

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

@ -774,19 +774,7 @@ public:
virtual nsViewportInfo GetViewportInfo(const mozilla::ScreenIntSize& aDisplaySize) override;
enum class UseCounterReportKind {
// Flush the document's use counters only; the use counters for any
// external resource documents will be flushed when the external
// resource documents themselves are destroyed.
eDefault,
// Flush use counters for the document and for its external resource
// documents. (Should only be necessary for tests, where we need
// flushing to happen synchronously and deterministically.)
eIncludeExternalResources,
};
void ReportUseCounters(UseCounterReportKind aKind = UseCounterReportKind::eDefault);
void ReportUseCounters();
virtual void AddIntersectionObserver(
mozilla::dom::DOMIntersectionObserver* aObserver) override;

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

@ -298,10 +298,12 @@ var check_use_counter_direct = async function(file, use_counter_middlefix, xfail
let [histogram_page_after, histogram_document_after,
histogram_docs_after, histogram_toplevel_docs_after] =
await grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
(xfail ? todo_is : is)(histogram_page_after, histogram_page_before + 1,
"page counts for " + use_counter_middlefix + " after are correct");
(xfail ? todo_is : is)(histogram_document_after, histogram_document_before + 1,
"document counts for " + use_counter_middlefix + " after are correct");
if (!xfail) {
is(histogram_page_after, histogram_page_before + 1,
"page counts for " + use_counter_middlefix + " after are correct");
is(histogram_document_after, histogram_document_before + 1,
"document counts for " + use_counter_middlefix + " after are correct");
}
ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
"top level document counts are correct");
ok(histogram_docs_after >= histogram_docs_before + 1,