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

Unified Diff: chrome/test/nacl/nacl_browsertest_uma.cc

Issue 379283002: Rework UMAHistogramHelper and StatisticsDeltaReader into [Chrome]HistogramTester. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mmenke nits Created 6 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: chrome/test/nacl/nacl_browsertest_uma.cc
diff --git a/chrome/test/nacl/nacl_browsertest_uma.cc b/chrome/test/nacl/nacl_browsertest_uma.cc
index fb7a463f7dd8417966533eb8ffae7596fad7706e..f31434d552450b2cb682580ec54225561759c054 100644
--- a/chrome/test/nacl/nacl_browsertest_uma.cc
+++ b/chrome/test/nacl/nacl_browsertest_uma.cc
@@ -2,22 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/test/base/uma_histogram_helper.h"
+#include "base/test/histogram_tester.h"
#include "chrome/test/nacl/nacl_browsertest_util.h"
#include "components/nacl/browser/nacl_browser.h"
+#include "content/public/test/browser_test_utils.h"
#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
#include "ppapi/c/private/ppb_nacl_private.h"
namespace {
NACL_BROWSER_TEST_F(NaClBrowserTest, SuccessfulLoadUMA, {
+ base::HistogramTester histograms;
// Load a NaCl module to generate UMA data.
RunLoadTest(FILE_PATH_LITERAL("nacl_load_test.html"));
// Make sure histograms from child processes have been accumulated in the
// browser brocess.
- UMAHistogramHelper histograms;
- histograms.Fetch();
+ content::FetchHistogramsFromChildProcesses();
// Did the plugin report success?
histograms.ExpectUniqueSample("NaCl.LoadStatus.Plugin",
@@ -88,6 +89,7 @@ class NaClBrowserTestVcacheExtension:
IN_PROC_BROWSER_TEST_F(NaClBrowserTestVcacheExtension,
ValidationCacheOfMainNexe) {
+ base::HistogramTester histograms;
// Hardcoded extension AppID that corresponds to the hardcoded
// public key in the manifest.json file. We need to load the extension
// nexe from the same origin, so we can't just try to load the extension
@@ -99,8 +101,7 @@ IN_PROC_BROWSER_TEST_F(NaClBrowserTestVcacheExtension,
// Make sure histograms from child processes have been accumulated in the
// browser brocess.
- UMAHistogramHelper histograms;
- histograms.Fetch();
+ content::FetchHistogramsFromChildProcesses();
// Should have received 2 validation queries (one for IRT and one for NEXE),
// and responded with a miss.
histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
@@ -113,7 +114,7 @@ IN_PROC_BROWSER_TEST_F(NaClBrowserTestVcacheExtension,
// Load it again to hit the cache.
RunNaClIntegrationTest(full_url, true);
- histograms.Fetch();
+ content::FetchHistogramsFromChildProcesses();
// Should have received 2 more validation queries later (IRT and NEXE),
// and responded with a hit.
histograms.ExpectBucketCount("NaCl.ValidationCache.Query",
@@ -127,11 +128,11 @@ IN_PROC_BROWSER_TEST_F(NaClBrowserTestVcacheExtension,
// Test that validation for the 2 PNaCl translator nexes can be cached.
IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnacl,
ValidationCacheOfTranslatorNexes) {
+ base::HistogramTester histograms;
// Run a load test w/ one pexe cache identity.
RunLoadTest(FILE_PATH_LITERAL("pnacl_options.html?use_nmf=o_0"));
- UMAHistogramHelper histograms;
- histograms.Fetch();
+ content::FetchHistogramsFromChildProcesses();
// Should have received 3 validation queries:
// - One for IRT for actual application
// - Two for two translator nexes

Powered by Google App Engine
This is Rietveld 408576698