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

Side by Side Diff: net/dns/dns_transaction_unittest.cc

Issue 19661004: Made MessagePump a non-thread safe class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding a missing header. Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | net/dns/serial_worker_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) 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 "net/dns/dns_transaction.h" 5 #include "net/dns/dns_transaction.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 // Use short timeout to speed up the test. 614 // Use short timeout to speed up the test.
615 config_.timeout = TestTimeouts::tiny_timeout(); 615 config_.timeout = TestTimeouts::tiny_timeout();
616 ConfigureFactory(); 616 ConfigureFactory();
617 617
618 AddQueryAndTimeout(kT0HostName, kT0Qtype); 618 AddQueryAndTimeout(kT0HostName, kT0Qtype);
619 AddQueryAndTimeout(kT0HostName, kT0Qtype); 619 AddQueryAndTimeout(kT0HostName, kT0Qtype);
620 AddQueryAndTimeout(kT0HostName, kT0Qtype); 620 AddQueryAndTimeout(kT0HostName, kT0Qtype);
621 621
622 TransactionHelper helper0(kT0HostName, kT0Qtype, ERR_DNS_TIMED_OUT); 622 TransactionHelper helper0(kT0HostName, kT0Qtype, ERR_DNS_TIMED_OUT);
623 EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get())); 623 EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
624 base::MessageLoop::current()->AssertIdle(); 624 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting());
625 } 625 }
626 626
627 TEST_F(DnsTransactionTest, ServerFallbackAndRotate) { 627 TEST_F(DnsTransactionTest, ServerFallbackAndRotate) {
628 // Test that we fallback on both server failure and timeout. 628 // Test that we fallback on both server failure and timeout.
629 config_.attempts = 2; 629 config_.attempts = 2;
630 // The next request should start from the next server. 630 // The next request should start from the next server.
631 config_.rotate = true; 631 config_.rotate = true;
632 ConfigureNumServers(3); 632 ConfigureNumServers(3);
633 // Use short timeout to speed up the test. 633 // Use short timeout to speed up the test.
634 config_.timeout = TestTimeouts::tiny_timeout(); 634 config_.timeout = TestTimeouts::tiny_timeout();
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 config_.timeout = TestTimeouts::tiny_timeout(); 931 config_.timeout = TestTimeouts::tiny_timeout();
932 ConfigureFactory(); 932 ConfigureFactory();
933 933
934 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); 934 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT);
935 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); 935 EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
936 } 936 }
937 937
938 } // namespace 938 } // namespace
939 939
940 } // namespace net 940 } // namespace net
OLDNEW
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | net/dns/serial_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698