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

Unified Diff: chrome/browser/metrics/extensions_metrics_provider_unittest.cc

Issue 372473004: Retrieve client_id from GoogleUpdateSettings when its missing from Local State. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: put dependency back for installer_util_nacl_win64 fixes compile?! 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/browser/metrics/extensions_metrics_provider_unittest.cc
diff --git a/chrome/browser/metrics/extensions_metrics_provider_unittest.cc b/chrome/browser/metrics/extensions_metrics_provider_unittest.cc
index f0fc87e2d68fc2cab17ff7a4eb5721758a430a3a..157ab5255ef27d2db71ff7a44aa17d1e5fac645b 100644
--- a/chrome/browser/metrics/extensions_metrics_provider_unittest.cc
+++ b/chrome/browser/metrics/extensions_metrics_provider_unittest.cc
@@ -6,7 +6,9 @@
#include <string>
+#include "base/memory/scoped_ptr.h"
#include "base/prefs/testing_pref_service.h"
+#include "components/metrics/client_info.h"
#include "components/metrics/metrics_state_manager.h"
#include "components/metrics/proto/system_profile.pb.h"
#include "extensions/common/extension.h"
@@ -20,6 +22,13 @@ bool IsMetricsReportingEnabled() {
return true;
}
+void StoreNoClientInfoBackup(const metrics::ClientInfo& /* client_info */) {
+}
+
+scoped_ptr<metrics::ClientInfo> ReturnNoBackup() {
+ return scoped_ptr<metrics::ClientInfo>();
+}
+
class TestExtensionsMetricsProvider : public ExtensionsMetricsProvider {
public:
explicit TestExtensionsMetricsProvider(
@@ -95,8 +104,11 @@ TEST(ExtensionsMetricsProvider, SystemProtoEncoding) {
TestingPrefServiceSimple local_state;
metrics::MetricsStateManager::RegisterPrefs(local_state.registry());
scoped_ptr<metrics::MetricsStateManager> metrics_state_manager(
- metrics::MetricsStateManager::Create(&local_state,
- base::Bind(&IsMetricsReportingEnabled)));
+ metrics::MetricsStateManager::Create(
+ &local_state,
+ base::Bind(&IsMetricsReportingEnabled),
+ base::Bind(&StoreNoClientInfoBackup),
+ base::Bind(&ReturnNoBackup)));
TestExtensionsMetricsProvider extension_metrics(metrics_state_manager.get());
extension_metrics.ProvideSystemProfileMetrics(&system_profile);
ASSERT_EQ(2, system_profile.occupied_extension_bucket_size());

Powered by Google App Engine
This is Rietveld 408576698