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

Side by Side Diff: net/proxy/single_threaded_proxy_resolver_unittest.cc

Issue 363025: Improve the display of LoadLogs when truncation occurs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Change -1 to be a constant instead Created 11 years, 1 month 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/proxy/single_threaded_proxy_resolver.cc ('k') | net/socket/client_socket_pool_base.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/waitable_event.h" 5 #include "base/waitable_event.h"
6 #include "googleurl/src/gurl.h" 6 #include "googleurl/src/gurl.h"
7 #include "net/base/load_log.h" 7 #include "net/base/load_log.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/test_completion_callback.h" 9 #include "net/base/test_completion_callback.h"
10 #include "net/proxy/proxy_info.h" 10 #include "net/proxy/proxy_info.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Call SetPacScriptByData() -- verify that it reaches the synchronous 148 // Call SetPacScriptByData() -- verify that it reaches the synchronous
149 // resolver. 149 // resolver.
150 TestCompletionCallback set_script_callback; 150 TestCompletionCallback set_script_callback;
151 rv = resolver->SetPacScriptByData("pac script bytes", &set_script_callback); 151 rv = resolver->SetPacScriptByData("pac script bytes", &set_script_callback);
152 EXPECT_EQ(ERR_IO_PENDING, rv); 152 EXPECT_EQ(ERR_IO_PENDING, rv);
153 EXPECT_EQ(OK, set_script_callback.WaitForResult()); 153 EXPECT_EQ(OK, set_script_callback.WaitForResult());
154 EXPECT_EQ("pac script bytes", mock->last_pac_bytes()); 154 EXPECT_EQ("pac script bytes", mock->last_pac_bytes());
155 155
156 // Start request 0. 156 // Start request 0.
157 TestCompletionCallback callback0; 157 TestCompletionCallback callback0;
158 scoped_refptr<LoadLog> log0(new LoadLog); 158 scoped_refptr<LoadLog> log0(new LoadLog(LoadLog::kUnbounded));
159 ProxyInfo results0; 159 ProxyInfo results0;
160 rv = resolver->GetProxyForURL( 160 rv = resolver->GetProxyForURL(
161 GURL("http://request0"), &results0, &callback0, NULL, log0); 161 GURL("http://request0"), &results0, &callback0, NULL, log0);
162 EXPECT_EQ(ERR_IO_PENDING, rv); 162 EXPECT_EQ(ERR_IO_PENDING, rv);
163 163
164 // Wait for request 0 to finish. 164 // Wait for request 0 to finish.
165 rv = callback0.WaitForResult(); 165 rv = callback0.WaitForResult();
166 EXPECT_EQ(0, rv); 166 EXPECT_EQ(0, rv);
167 EXPECT_EQ("PROXY request0:80", results0.ToPacString()); 167 EXPECT_EQ("PROXY request0:80", results0.ToPacString());
168 168
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 rv = callback1.WaitForResult(); 393 rv = callback1.WaitForResult();
394 EXPECT_EQ(1, rv); 394 EXPECT_EQ(1, rv);
395 EXPECT_EQ("PROXY request1:80", results1.ToPacString()); 395 EXPECT_EQ("PROXY request1:80", results1.ToPacString());
396 396
397 // The SetPacScript callback should never have been completed. 397 // The SetPacScript callback should never have been completed.
398 EXPECT_FALSE(set_pac_script_callback.have_result()); 398 EXPECT_FALSE(set_pac_script_callback.have_result());
399 } 399 }
400 400
401 } // namespace 401 } // namespace
402 } // namespace net 402 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/single_threaded_proxy_resolver.cc ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698