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

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

Issue 318203004: Make MetricsService save compressed logs to local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | components/components_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service_unittest.cc
===================================================================
--- chrome/browser/metrics/metrics_service_unittest.cc (revision 276253)
+++ chrome/browser/metrics/metrics_service_unittest.cc (working copy)
@@ -13,6 +13,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
+#include "components/metrics/compression_utils.h"
#include "components/metrics/metrics_log.h"
#include "components/metrics/metrics_service_observer.h"
#include "components/metrics/metrics_state_manager.h"
@@ -209,8 +210,12 @@
log_manager->StageNextLogForUpload();
EXPECT_TRUE(log_manager->has_staged_log());
+ std::string uncompressed_log;
+ EXPECT_TRUE(metrics::GzipUncompress(log_manager->staged_log(),
+ &uncompressed_log));
+
metrics::ChromeUserMetricsExtension uma_log;
- EXPECT_TRUE(uma_log.ParseFromString(log_manager->staged_log()));
+ EXPECT_TRUE(uma_log.ParseFromString(uncompressed_log));
EXPECT_TRUE(uma_log.has_client_id());
EXPECT_TRUE(uma_log.has_session_id());
« no previous file with comments | « no previous file | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698