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

Side by Side Diff: net/base/prioritized_dispatcher_unittest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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 (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 <ctype.h> 5 #include <ctype.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return job; 146 return job;
147 } 147 }
148 148
149 TestJob* AddJobAtHead(char data, Priority priority) { 149 TestJob* AddJobAtHead(char data, Priority priority) {
150 TestJob* job = new TestJob(dispatcher_.get(), data, priority, &log_); 150 TestJob* job = new TestJob(dispatcher_.get(), data, priority, &log_);
151 jobs_.push_back(job); 151 jobs_.push_back(job);
152 job->Add(true); 152 job->Add(true);
153 return job; 153 return job;
154 } 154 }
155 155
156 void Expect(std::string log) { 156 void Expect(const std::string& log) {
157 EXPECT_EQ(0u, dispatcher_->num_queued_jobs()); 157 EXPECT_EQ(0u, dispatcher_->num_queued_jobs());
158 EXPECT_EQ(0u, dispatcher_->num_running_jobs()); 158 EXPECT_EQ(0u, dispatcher_->num_running_jobs());
159 EXPECT_EQ(log, log_); 159 EXPECT_EQ(log, log_);
160 log_.clear(); 160 log_.clear();
161 } 161 }
162 162
163 std::string log_; 163 std::string log_;
164 scoped_ptr<PrioritizedDispatcher> dispatcher_; 164 scoped_ptr<PrioritizedDispatcher> dispatcher_;
165 ScopedVector<TestJob> jobs_; 165 ScopedVector<TestJob> jobs_;
166 }; 166 };
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 PrioritizedDispatcher::Handle handle = job_b->handle(); 541 PrioritizedDispatcher::Handle handle = job_b->handle();
542 ASSERT_FALSE(handle.is_null()); 542 ASSERT_FALSE(handle.is_null());
543 dispatcher_->Cancel(handle); 543 dispatcher_->Cancel(handle);
544 EXPECT_DEBUG_DEATH(dispatcher_->Cancel(handle), ""); 544 EXPECT_DEBUG_DEATH(dispatcher_->Cancel(handle), "");
545 } 545 }
546 #endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG) 546 #endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
547 547
548 } // namespace 548 } // namespace
549 549
550 } // namespace net 550 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698