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

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

Issue 8879031: Removing MessageLoop::QuitTask() from net/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 9 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/base/cookie_monster_unittest.cc ('k') | net/socket/client_socket_pool_base_unittest.cc » ('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/base/host_resolver_impl.h" 5 #include "net/base/host_resolver_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 825
826 virtual void OnCompleted(ResolveRequest* resolve) { 826 virtual void OnCompleted(ResolveRequest* resolve) {
827 EXPECT_EQ("a", resolve->hostname()); 827 EXPECT_EQ("a", resolve->hostname());
828 EXPECT_EQ(80, resolve->port()); 828 EXPECT_EQ(80, resolve->port());
829 829
830 // Deletes the host resolver. 830 // Deletes the host resolver.
831 host_resolver_.reset(); 831 host_resolver_.reset();
832 832
833 // Quit after returning from OnCompleted (to give it a chance at 833 // Quit after returning from OnCompleted (to give it a chance at
834 // incorrectly running the cancelled tasks). 834 // incorrectly running the cancelled tasks).
835 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); 835 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
836 } 836 }
837 837
838 private: 838 private:
839 scoped_ptr<HostResolver> host_resolver_; 839 scoped_ptr<HostResolver> host_resolver_;
840 DISALLOW_COPY_AND_ASSIGN(DeleteWithinCallbackVerifier); 840 DISALLOW_COPY_AND_ASSIGN(DeleteWithinCallbackVerifier);
841 }; 841 };
842 842
843 TEST_F(HostResolverImplTest, DeleteWithinCallback) { 843 TEST_F(HostResolverImplTest, DeleteWithinCallback) {
844 // Use a capturing resolver_proc, since the verifier needs to know what calls 844 // Use a capturing resolver_proc, since the verifier needs to know what calls
845 // reached Resolver(). Also, the capturing resolver_proc is initially 845 // reached Resolver(). Also, the capturing resolver_proc is initially
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 resolver_proc->WaitForAllAttemptsToFinish(TimeDelta::FromMilliseconds(60000)); 1558 resolver_proc->WaitForAllAttemptsToFinish(TimeDelta::FromMilliseconds(60000));
1559 MessageLoop::current()->RunAllPending(); 1559 MessageLoop::current()->RunAllPending();
1560 1560
1561 EXPECT_EQ(resolver_proc->total_attempts_resolved(), kTotalAttempts); 1561 EXPECT_EQ(resolver_proc->total_attempts_resolved(), kTotalAttempts);
1562 EXPECT_EQ(resolver_proc->resolved_attempt_number(), kAttemptNumberToResolve); 1562 EXPECT_EQ(resolver_proc->resolved_attempt_number(), kAttemptNumberToResolve);
1563 } 1563 }
1564 1564
1565 // TODO(cbentzel): Test a mix of requests with different HostResolverFlags. 1565 // TODO(cbentzel): Test a mix of requests with different HostResolverFlags.
1566 1566
1567 } // namespace net 1567 } // namespace net
OLDNEW
« no previous file with comments | « net/base/cookie_monster_unittest.cc ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698