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

Unified Diff: base/metrics/histogram_delta_serialization_unittest.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/metrics/histogram_delta_serialization.cc ('k') | base/metrics/histogram_flattener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_delta_serialization_unittest.cc
diff --git a/base/metrics/histogram_delta_serialization_unittest.cc b/base/metrics/histogram_delta_serialization_unittest.cc
deleted file mode 100644
index b53520c5098787539d7d14691597cf125fde7be3..0000000000000000000000000000000000000000
--- a/base/metrics/histogram_delta_serialization_unittest.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/metrics/histogram_delta_serialization.h"
-
-#include <vector>
-
-#include "base/metrics/histogram.h"
-#include "base/metrics/histogram_base.h"
-#include "base/metrics/statistics_recorder.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace base {
-
-TEST(HistogramDeltaSerializationTest, DeserializeHistogramAndAddSamples) {
- StatisticsRecorder statistic_recorder;
- HistogramDeltaSerialization serializer("HistogramDeltaSerializationTest");
- std::vector<std::string> deltas;
- // Nothing was changed yet.
- serializer.PrepareAndSerializeDeltas(&deltas);
- EXPECT_TRUE(deltas.empty());
-
- HistogramBase* histogram = Histogram::FactoryGet(
- "TestHistogram", 1, 1000, 10, HistogramBase::kIPCSerializationSourceFlag);
- histogram->Add(1);
- histogram->Add(10);
- histogram->Add(100);
- histogram->Add(1000);
-
- serializer.PrepareAndSerializeDeltas(&deltas);
- EXPECT_FALSE(deltas.empty());
-
- HistogramDeltaSerialization::DeserializeAndAddSamples(deltas);
-
- // The histogram has kIPCSerializationSourceFlag. So samples will be ignored.
- scoped_ptr<HistogramSamples> snapshot(histogram->SnapshotSamples());
- EXPECT_EQ(1, snapshot->GetCount(1));
- EXPECT_EQ(1, snapshot->GetCount(10));
- EXPECT_EQ(1, snapshot->GetCount(100));
- EXPECT_EQ(1, snapshot->GetCount(1000));
-
- // Clear kIPCSerializationSourceFlag to emulate multi-process usage.
- histogram->ClearFlags(HistogramBase::kIPCSerializationSourceFlag);
- HistogramDeltaSerialization::DeserializeAndAddSamples(deltas);
-
- scoped_ptr<HistogramSamples> snapshot2(histogram->SnapshotSamples());
- EXPECT_EQ(2, snapshot2->GetCount(1));
- EXPECT_EQ(2, snapshot2->GetCount(10));
- EXPECT_EQ(2, snapshot2->GetCount(100));
- EXPECT_EQ(2, snapshot2->GetCount(1000));
-}
-
-} // namespace base
« no previous file with comments | « base/metrics/histogram_delta_serialization.cc ('k') | base/metrics/histogram_flattener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698