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

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

Issue 1886913002: Convert //chrome/browser/metrics from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/metrics_memory_details.h" 5 #include "chrome/browser/metrics/metrics_memory_details.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/test/histogram_tester.h" 10 #include "base/test/histogram_tester.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 }; 47 };
48 48
49 IN_PROC_BROWSER_TEST_F(MetricsMemoryDetailsBrowserTest, TestMemoryDetails) { 49 IN_PROC_BROWSER_TEST_F(MetricsMemoryDetailsBrowserTest, TestMemoryDetails) {
50 base::HistogramTester histogram_tester; 50 base::HistogramTester histogram_tester;
51 51
52 scoped_refptr<TestMemoryDetails> details(new TestMemoryDetails); 52 scoped_refptr<TestMemoryDetails> details(new TestMemoryDetails);
53 details->StartFetchAndWait(); 53 details->StartFetchAndWait();
54 54
55 // Memory.Browser histogram should have a single non-0 sample recorded. 55 // Memory.Browser histogram should have a single non-0 sample recorded.
56 histogram_tester.ExpectTotalCount("Memory.Browser", 1); 56 histogram_tester.ExpectTotalCount("Memory.Browser", 1);
57 scoped_ptr<base::HistogramSamples> samples( 57 std::unique_ptr<base::HistogramSamples> samples(
58 histogram_tester.GetHistogramSamplesSinceCreation("Memory.Browser")); 58 histogram_tester.GetHistogramSamplesSinceCreation("Memory.Browser"));
59 ASSERT_TRUE(samples); 59 ASSERT_TRUE(samples);
60 EXPECT_NE(0, samples->sum()); 60 EXPECT_NE(0, samples->sum());
61 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698