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

Side by Side Diff: chrome/browser/memory/tab_manager_web_contents_data_unittest.cc

Issue 2171123002: chrome/browser/memory: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
« no previous file with comments | « chrome/browser/memory/tab_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/memory/tab_manager_web_contents_data.h" 5 #include "chrome/browser/memory/tab_manager_web_contents_data.h"
6 6
7 #include "base/test/histogram_tester.h" 7 #include "base/test/histogram_tester.h"
8 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
10 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 TEST_F(TabManagerWebContentsDataTest, LastInactiveTime) { 88 TEST_F(TabManagerWebContentsDataTest, LastInactiveTime) {
89 EXPECT_EQ(base::TimeTicks::UnixEpoch(), tab_data()->LastInactiveTime()); 89 EXPECT_EQ(base::TimeTicks::UnixEpoch(), tab_data()->LastInactiveTime());
90 auto now = base::TimeTicks::Now(); 90 auto now = base::TimeTicks::Now();
91 tab_data()->SetLastInactiveTime(now); 91 tab_data()->SetLastInactiveTime(now);
92 EXPECT_EQ(now, tab_data()->LastInactiveTime()); 92 EXPECT_EQ(now, tab_data()->LastInactiveTime());
93 } 93 }
94 94
95 TEST_F(TabManagerWebContentsDataTest, CopyState) { 95 TEST_F(TabManagerWebContentsDataTest, CopyState) {
96 std::unique_ptr<WebContents> web_contents2; 96 std::unique_ptr<WebContents> web_contents2;
97 auto tab_data2 = CreateWebContentsAndTabData(&web_contents2); 97 auto* tab_data2 = CreateWebContentsAndTabData(&web_contents2);
98 98
99 EXPECT_EQ(tab_data()->tab_data_, tab_data2->tab_data_); 99 EXPECT_EQ(tab_data()->tab_data_, tab_data2->tab_data_);
100 tab_data()->IncrementDiscardCount(); 100 tab_data()->IncrementDiscardCount();
101 tab_data()->SetDiscardState(true); 101 tab_data()->SetDiscardState(true);
102 EXPECT_NE(tab_data()->tab_data_, tab_data2->tab_data_); 102 EXPECT_NE(tab_data()->tab_data_, tab_data2->tab_data_);
103 103
104 TabManager::WebContentsData::CopyState(tab_data()->web_contents(), 104 TabManager::WebContentsData::CopyState(tab_data()->web_contents(),
105 tab_data2->web_contents()); 105 tab_data2->web_contents());
106 EXPECT_EQ(tab_data()->tab_data_, tab_data2->tab_data_); 106 EXPECT_EQ(tab_data()->tab_data_, tab_data2->tab_data_);
107 EXPECT_EQ(tab_data()->test_tick_clock_, tab_data2->test_tick_clock_); 107 EXPECT_EQ(tab_data()->test_tick_clock_, tab_data2->test_tick_clock_);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 test_clock().Advance(base::TimeDelta::FromSeconds(7)); 198 test_clock().Advance(base::TimeDelta::FromSeconds(7));
199 tab_data()->SetDiscardState(false); 199 tab_data()->SetDiscardState(false);
200 200
201 EXPECT_EQ(1, 201 EXPECT_EQ(1,
202 histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); 202 histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second);
203 203
204 histograms.ExpectBucketCount(kHistogramName, 12000, 1); 204 histograms.ExpectBucketCount(kHistogramName, 12000, 1);
205 } 205 }
206 206
207 } // namespace memory 207 } // namespace memory
OLDNEW
« no previous file with comments | « chrome/browser/memory/tab_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698