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

Side by Side Diff: net/disk_cache/backend_unittest.cc

Issue 1105623002: Use of base::StringPairs appropriately in backend_unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: included the required header file. Created 5 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
« no previous file with comments | « no previous file | 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 (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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/port.h" 8 #include "base/port.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
12 #include "base/test/mock_entropy_provider.h" 13 #include "base/test/mock_entropy_provider.h"
13 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 14 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
14 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
15 #include "base/threading/platform_thread.h" 16 #include "base/threading/platform_thread.h"
16 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
17 #include "net/base/cache_type.h" 18 #include "net/base/cache_type.h"
18 #include "net/base/io_buffer.h" 19 #include "net/base/io_buffer.h"
19 #include "net/base/net_errors.h" 20 #include "net/base/net_errors.h"
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 EXPECT_EQ(0, cache_->GetEntryCount()); 2744 EXPECT_EQ(0, cache_->GetEntryCount());
2744 EXPECT_NE(net::OK, OpenEntry("First", &entry2)); 2745 EXPECT_NE(net::OK, OpenEntry("First", &entry2));
2745 EXPECT_NE(net::OK, CreateEntry("Something new", &entry2)); 2746 EXPECT_NE(net::OK, CreateEntry("Something new", &entry2));
2746 EXPECT_NE(net::OK, DoomEntry("First")); 2747 EXPECT_NE(net::OK, DoomEntry("First"));
2747 EXPECT_NE(net::OK, DoomAllEntries()); 2748 EXPECT_NE(net::OK, DoomAllEntries());
2748 EXPECT_NE(net::OK, DoomEntriesBetween(Time(), Time::Now())); 2749 EXPECT_NE(net::OK, DoomEntriesBetween(Time(), Time::Now()));
2749 EXPECT_NE(net::OK, DoomEntriesSince(Time())); 2750 EXPECT_NE(net::OK, DoomEntriesSince(Time()));
2750 iter = CreateIterator(); 2751 iter = CreateIterator();
2751 EXPECT_NE(net::OK, iter->OpenNextEntry(&entry2)); 2752 EXPECT_NE(net::OK, iter->OpenNextEntry(&entry2));
2752 2753
2753 std::vector<std::pair<std::string, std::string>> stats; 2754 base::StringPairs stats;
2754 cache_->GetStats(&stats); 2755 cache_->GetStats(&stats);
2755 EXPECT_TRUE(stats.empty()); 2756 EXPECT_TRUE(stats.empty());
2756 cache_->OnExternalCacheHit("First"); 2757 cache_->OnExternalCacheHit("First");
2757 } 2758 }
2758 2759
2759 TEST_F(DiskCacheBackendTest, DisabledAPI) { 2760 TEST_F(DiskCacheBackendTest, DisabledAPI) {
2760 ASSERT_TRUE(CopyTestCache("bad_rankings2")); 2761 ASSERT_TRUE(CopyTestCache("bad_rankings2"));
2761 DisableFirstCleanup(); 2762 DisableFirstCleanup();
2762 InitCache(); 2763 InitCache();
2763 BackendDisabledAPI(); 2764 BackendDisabledAPI();
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
3528 // after closing. 3529 // after closing.
3529 // NOTE: IF THIS TEST IS FLAKY THEN IT IS FAILING. See https://crbug.com/416940 3530 // NOTE: IF THIS TEST IS FLAKY THEN IT IS FAILING. See https://crbug.com/416940
3530 TEST_F(DiskCacheBackendTest, SimpleCacheDeleteQuickly) { 3531 TEST_F(DiskCacheBackendTest, SimpleCacheDeleteQuickly) {
3531 SetSimpleCacheMode(); 3532 SetSimpleCacheMode();
3532 for (int i = 0; i < 100; ++i) { 3533 for (int i = 0; i < 100; ++i) {
3533 InitCache(); 3534 InitCache();
3534 cache_.reset(); 3535 cache_.reset();
3535 EXPECT_TRUE(CleanupCacheDir()); 3536 EXPECT_TRUE(CleanupCacheDir());
3536 } 3537 }
3537 } 3538 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698