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

Side by Side Diff: chrome/browser/net/network_stats_unittest.cc

Issue 12210088: Make the TestServer use an absolute document root path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testserver uses absolute docroot path Created 7 years, 10 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
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "chrome/browser/net/network_stats.h" 8 #include "chrome/browser/net/network_stats.h"
9 #include "net/base/host_resolver.h" 9 #include "net/base/host_resolver.h"
10 #include "net/base/mock_host_resolver.h" 10 #include "net/base/mock_host_resolver.h"
(...skipping 14 matching lines...) Expand all
25 message_loop_.RunUntilIdle(); 25 message_loop_.RunUntilIdle();
26 } 26 }
27 MessageLoopForIO message_loop_; 27 MessageLoopForIO message_loop_;
28 }; 28 };
29 29
30 class NetworkStatsTestUDP : public NetworkStatsTest { 30 class NetworkStatsTestUDP : public NetworkStatsTest {
31 public: 31 public:
32 NetworkStatsTestUDP() 32 NetworkStatsTestUDP()
33 : test_server_(net::TestServer::TYPE_UDP_ECHO, 33 : test_server_(net::TestServer::TYPE_UDP_ECHO,
34 net::TestServer::kLocalhost, 34 net::TestServer::kLocalhost,
35 base::FilePath(FILE_PATH_LITERAL("net/data"))) { 35 net::TestServer::GetSourceRelativePath(
36 base::FilePath(FILE_PATH_LITERAL("net/data")))) {
36 } 37 }
37 38
38 protected: 39 protected:
39 void RunUDPEchoTest(int bytes, int packets, bool has_proxy) { 40 void RunUDPEchoTest(int bytes, int packets, bool has_proxy) {
40 net::TestCompletionCallback cb; 41 net::TestCompletionCallback cb;
41 42
42 scoped_ptr<net::MockHostResolver> host_resolver( 43 scoped_ptr<net::MockHostResolver> host_resolver(
43 new net::MockHostResolver()); 44 new net::MockHostResolver());
44 45
45 // We will use HISTOGRAM_PORT_MAX as the PortIndex enum for testing 46 // We will use HISTOGRAM_PORT_MAX as the PortIndex enum for testing
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 network_stats.Crypt( 408 network_stats.Crypt(
408 key, key_string.length(), payload_data, KBytesToSend, encoded_data); 409 key, key_string.length(), payload_data, KBytesToSend, encoded_data);
409 std::string encoded_payload(encoded_data, KBytesToSend); 410 std::string encoded_payload(encoded_data, KBytesToSend);
410 411
411 message = version + checksum + payload_size + key_string + encoded_payload; 412 message = version + checksum + payload_size + key_string + encoded_payload;
412 EXPECT_EQ(NetworkStats::SUCCESS, network_stats.VerifyBytes(message)); 413 EXPECT_EQ(NetworkStats::SUCCESS, network_stats.VerifyBytes(message));
413 EXPECT_EQ(1u, network_stats.packets_received_mask()); 414 EXPECT_EQ(1u, network_stats.packets_received_mask());
414 } 415 }
415 416
416 } // namespace chrome_browser_net 417 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698