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

Side by Side Diff: chrome/browser/metrics/extensions_metrics_provider_unittest.cc

Issue 502173002: Move more metrics classes to metrics namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test compile. Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/metrics/extensions_metrics_provider.h" 5 #include "chrome/browser/metrics/extensions_metrics_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 EXPECT_EQ(10, 96 EXPECT_EQ(10,
97 TestExtensionsMetricsProvider::HashExtension( 97 TestExtensionsMetricsProvider::HashExtension(
98 "mdhofdjgenpkhlmddfaegdjddcecipmo", 3817)); 98 "mdhofdjgenpkhlmddfaegdjddcecipmo", 3817));
99 } 99 }
100 100
101 // Checks that the fake set of extensions provided by 101 // Checks that the fake set of extensions provided by
102 // TestExtensionsMetricsProvider is encoded properly. 102 // TestExtensionsMetricsProvider is encoded properly.
103 TEST(ExtensionsMetricsProvider, SystemProtoEncoding) { 103 TEST(ExtensionsMetricsProvider, SystemProtoEncoding) {
104 metrics::SystemProfileProto system_profile; 104 metrics::SystemProfileProto system_profile;
105 TestingPrefServiceSimple local_state; 105 TestingPrefServiceSimple local_state;
106 MetricsService::RegisterPrefs(local_state.registry()); 106 metrics::MetricsService::RegisterPrefs(local_state.registry());
107 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager( 107 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager(
108 metrics::MetricsStateManager::Create( 108 metrics::MetricsStateManager::Create(
109 &local_state, 109 &local_state,
110 base::Bind(&IsMetricsReportingEnabled), 110 base::Bind(&IsMetricsReportingEnabled),
111 base::Bind(&StoreNoClientInfoBackup), 111 base::Bind(&StoreNoClientInfoBackup),
112 base::Bind(&ReturnNoBackup))); 112 base::Bind(&ReturnNoBackup)));
113 TestExtensionsMetricsProvider extension_metrics(metrics_state_manager.get()); 113 TestExtensionsMetricsProvider extension_metrics(metrics_state_manager.get());
114 extension_metrics.ProvideSystemProfileMetrics(&system_profile); 114 extension_metrics.ProvideSystemProfileMetrics(&system_profile);
115 ASSERT_EQ(2, system_profile.occupied_extension_bucket_size()); 115 ASSERT_EQ(2, system_profile.occupied_extension_bucket_size());
116 EXPECT_EQ(10, system_profile.occupied_extension_bucket(0)); 116 EXPECT_EQ(10, system_profile.occupied_extension_bucket(0));
117 EXPECT_EQ(1007, system_profile.occupied_extension_bucket(1)); 117 EXPECT_EQ(1007, system_profile.occupied_extension_bucket(1));
118 } 118 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/extensions_metrics_provider.cc ('k') | chrome/browser/metrics/metrics_reporting_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698