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

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

Issue 239093004: Move part of metrics from chrome/common to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding TBR section for owners of minor changes. Created 6 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/base64.h" 5 #include "base/base64.h"
6 #include "base/md5.h" 6 #include "base/md5.h"
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/metrics/metrics_log_serializer.h" 8 #include "chrome/browser/metrics/metrics_log_serializer.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using metrics::MetricsLogManager;
12
11 namespace { 13 namespace {
12 14
13 const size_t kListLengthLimit = 3; 15 const size_t kListLengthLimit = 3;
14 const size_t kLogByteLimit = 1000; 16 const size_t kLogByteLimit = 1000;
15 17
16 void SetLogText(const std::string& log_text, 18 void SetLogText(const std::string& log_text,
17 MetricsLogManager::SerializedLog* log) { 19 MetricsLogManager::SerializedLog* log) {
18 std::string log_text_copy = log_text; 20 std::string log_text_copy = log_text;
19 log->SwapLogText(&log_text_copy); 21 log->SwapLogText(&log_text_copy);
20 } 22 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 EXPECT_TRUE((*(list.end() - 1))->GetAsString(&checksum)); 265 EXPECT_TRUE((*(list.end() - 1))->GetAsString(&checksum));
264 checksum[0] = (checksum[0] == 'a') ? 'b' : 'a'; 266 checksum[0] = (checksum[0] == 'a') ? 'b' : 'a';
265 EXPECT_TRUE(list.Set(2, base::Value::CreateStringValue(checksum))); 267 EXPECT_TRUE(list.Set(2, base::Value::CreateStringValue(checksum)));
266 EXPECT_EQ(3U, list.GetSize()); 268 EXPECT_EQ(3U, list.GetSize());
267 269
268 local_list.clear(); 270 local_list.clear();
269 EXPECT_EQ( 271 EXPECT_EQ(
270 MetricsLogSerializer::CHECKSUM_CORRUPTION, 272 MetricsLogSerializer::CHECKSUM_CORRUPTION,
271 MetricsLogSerializer::ReadLogsFromPrefList(list, &local_list)); 273 MetricsLogSerializer::ReadLogsFromPrefList(list, &local_list));
272 } 274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698