OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/precache/core/precache_database.h" | 5 #include "components/precache/core/precache_database.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 namespace precache { | 52 namespace precache { |
53 | 53 |
54 class PrecacheDatabaseTest : public testing::Test { | 54 class PrecacheDatabaseTest : public testing::Test { |
55 public: | 55 public: |
56 PrecacheDatabaseTest() {} | 56 PrecacheDatabaseTest() {} |
57 virtual ~PrecacheDatabaseTest() {} | 57 virtual ~PrecacheDatabaseTest() {} |
58 | 58 |
59 protected: | 59 protected: |
60 virtual void SetUp() OVERRIDE { | 60 virtual void SetUp() override { |
61 base::StatisticsRecorder::Initialize(); | 61 base::StatisticsRecorder::Initialize(); |
62 precache_database_ = new PrecacheDatabase(); | 62 precache_database_ = new PrecacheDatabase(); |
63 | 63 |
64 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 64 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
65 base::FilePath db_path = scoped_temp_dir_.path().Append( | 65 base::FilePath db_path = scoped_temp_dir_.path().Append( |
66 base::FilePath(FILE_PATH_LITERAL("precache_database"))); | 66 base::FilePath(FILE_PATH_LITERAL("precache_database"))); |
67 precache_database_->Init(db_path); | 67 precache_database_->Init(db_path); |
68 | 68 |
69 // Log a sample for each histogram, to ensure that they are all created. | 69 // Log a sample for each histogram, to ensure that they are all created. |
70 // This has to be done here, and not in the for loop below, because of the | 70 // This has to be done here, and not in the for loop below, because of the |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 scoped_ptr<base::HistogramSamples> saved_bytes_cellular( | 383 scoped_ptr<base::HistogramSamples> saved_bytes_cellular( |
384 GetHistogramSamplesDelta("Precache.Saved.Cellular")); | 384 GetHistogramSamplesDelta("Precache.Saved.Cellular")); |
385 EXPECT_EQ(1, saved_bytes_cellular->TotalCount()); | 385 EXPECT_EQ(1, saved_bytes_cellular->TotalCount()); |
386 EXPECT_EQ(1, saved_bytes_cellular->GetCount(kSize1)); | 386 EXPECT_EQ(1, saved_bytes_cellular->GetCount(kSize1)); |
387 } | 387 } |
388 | 388 |
389 } // namespace | 389 } // namespace |
390 | 390 |
391 } // namespace precache | 391 } // namespace precache |
OLD | NEW |