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

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

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: IndexTable review Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | net/disk_cache/disk_format.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/disk_cache/disk_cache_test_util.h" 5 #include "net/disk_cache/disk_cache_test_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 last_ = callbacks_called_; 116 last_ = callbacks_called_;
117 if (40 == num_iterations_) 117 if (40 == num_iterations_)
118 MessageLoop::current()->Quit(); 118 MessageLoop::current()->Quit();
119 } 119 }
120 } 120 }
121 121
122 // ----------------------------------------------------------------------- 122 // -----------------------------------------------------------------------
123 123
124 CallbackTest::CallbackTest(MessageLoopHelper* helper, 124 CallbackTest::CallbackTest(MessageLoopHelper* helper,
125 bool reuse) 125 bool reuse)
126 : helper_(helper), 126 : callback_(base::Bind(&CallbackTest::Run, base::Unretained(this))),
127 helper_(helper),
127 reuse_(reuse ? 0 : 1) { 128 reuse_(reuse ? 0 : 1) {
128 } 129 }
129 130
130 CallbackTest::~CallbackTest() { 131 CallbackTest::~CallbackTest() {
131 } 132 }
132 133
133 // On the actual callback, increase the number of tests received and check for 134 // On the actual callback, increase the number of tests received and check for
134 // errors (an unexpected test received) 135 // errors (an unexpected test received)
135 void CallbackTest::Run(int result) { 136 void CallbackTest::Run(int result) {
136 last_result_ = result; 137 last_result_ = result;
137 138
138 if (reuse_) { 139 if (reuse_) {
139 DCHECK_EQ(1, reuse_); 140 DCHECK_EQ(1, reuse_);
140 if (2 == reuse_) 141 if (2 == reuse_)
141 helper_->set_callback_reused_error(true); 142 helper_->set_callback_reused_error(true);
142 reuse_++; 143 reuse_++;
143 } 144 }
144 145
145 helper_->CallbackWasCalled(); 146 helper_->CallbackWasCalled();
146 } 147 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | net/disk_cache/disk_format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698