diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-01 20:38:10 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-01 20:38:10 +0000 |
commit | f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8 (patch) | |
tree | 6ccdd87ccfc89adbcb372c517559fa61fbc6c6b2 /net/base/test_completion_callback_unittest.cc | |
parent | d1666539b57bf8552e203d355fd09909d36f9732 (diff) | |
download | chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.zip chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.tar.gz chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.tar.bz2 |
Begin CompletionCallback switchover.
Rename CompletionCallback to OldCompletionCallback in preparation for introducing a new CompletionCallback based on base::Callback.
Also renames other CompletionCallback types like CancelableCompletionCallback and TestCompletionCallback and CompletionCallbackImpl. All using sed with s/CompletionCallback/OldCompletionCallback/g.
BUG=98719
TEST=none
Review URL: http://codereview.chromium.org/8070013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/test_completion_callback_unittest.cc')
-rw-r--r-- | net/base/test_completion_callback_unittest.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/base/test_completion_callback_unittest.cc b/net/base/test_completion_callback_unittest.cc index 1b9d71d..20ca596 100644 --- a/net/base/test_completion_callback_unittest.cc +++ b/net/base/test_completion_callback_unittest.cc @@ -13,9 +13,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -typedef PlatformTest TestCompletionCallbackTest; +typedef PlatformTest TestOldCompletionCallbackTest; -using net::CompletionCallback; +using net::OldCompletionCallback; const int kMagicResult = 8888; @@ -30,7 +30,7 @@ class ExampleEmployer { // Do some imaginary work on a worker thread; // when done, worker posts callback on the original thread. // Returns true on success - bool DoSomething(CompletionCallback* callback); + bool DoSomething(OldCompletionCallback* callback); private: class ExampleWorker; @@ -43,7 +43,7 @@ class ExampleEmployer { class ExampleEmployer::ExampleWorker : public base::RefCountedThreadSafe<ExampleWorker> { public: - ExampleWorker(ExampleEmployer* employer, CompletionCallback* callback) + ExampleWorker(ExampleEmployer* employer, OldCompletionCallback* callback) : employer_(employer), callback_(callback), origin_loop_(MessageLoop::current()) { } @@ -56,7 +56,7 @@ class ExampleEmployer::ExampleWorker // Only used on the origin thread (where DoSomething was called). ExampleEmployer* employer_; - CompletionCallback* callback_; + OldCompletionCallback* callback_; // Used to post ourselves onto the origin thread. base::Lock origin_loop_lock_; MessageLoop* origin_loop_; @@ -99,7 +99,7 @@ ExampleEmployer::ExampleEmployer() { ExampleEmployer::~ExampleEmployer() { } -bool ExampleEmployer::DoSomething(CompletionCallback* callback) { +bool ExampleEmployer::DoSomething(OldCompletionCallback* callback) { DCHECK(!request_) << "already in use"; request_ = new ExampleWorker(this, callback); @@ -115,9 +115,9 @@ bool ExampleEmployer::DoSomething(CompletionCallback* callback) { return true; } -TEST_F(TestCompletionCallbackTest, Simple) { +TEST_F(TestOldCompletionCallbackTest, Simple) { ExampleEmployer boss; - TestCompletionCallback callback; + TestOldCompletionCallback callback; bool queued = boss.DoSomething(&callback); EXPECT_EQ(queued, true); int result = callback.WaitForResult(); |