Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2137483003: Add UMA metrics for root scroller intervention to track forcing passive breakage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ability to test histograms from layout tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 33b5df0e89dd0152b0f46cfba0eb594ae0df6aa9..0c252c2947baf31e0a641d918ee9bad6ef69cb69 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -128,6 +128,7 @@
#include "core/workers/WorkerThread.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "platform/Cursor.h"
+#include "platform/Histogram.h"
#include "platform/Language.h"
#include "platform/PlatformKeyboardEvent.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -386,6 +387,16 @@ void Internals::clearHitTestCache(Document* doc, ExceptionState& exceptionState)
doc->layoutViewItem().clearHitTestCache();
}
+int Internals::histogramCount(const String& name, int bucket, ExceptionState& exceptionState) const
+{
+ int32_t count;
+ if (!EnumerationHistogram::GetHistogramCount(name.utf8().data(), bucket, &count)) {
+ exceptionState.throwDOMException(InvalidAccessError, "Could not find histogram");
+ return 0;
+ }
+ return count;
+}
+
bool Internals::isPreloaded(const String& url)
{
return isPreloadedBy(url, contextDocument());

Powered by Google App Engine
This is Rietveld 408576698