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

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

Issue 9585026: Add a source id to global NetLog entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Move friend declaration Created 8 years, 9 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 "net/proxy/proxy_resolver_js_bindings.h" 5 #include "net/proxy/proxy_resolver_js_bindings.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/address_list.h" 10 #include "net/base/address_list.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 CapturingNetLog global_log(CapturingNetLog::kUnbounded); 269 CapturingNetLog global_log(CapturingNetLog::kUnbounded);
270 270
271 // Get a hold of a DefaultJSBindings* (it is a hidden impl class). 271 // Get a hold of a DefaultJSBindings* (it is a hidden impl class).
272 scoped_ptr<ProxyResolverJSBindings> bindings( 272 scoped_ptr<ProxyResolverJSBindings> bindings(
273 ProxyResolverJSBindings::CreateDefault( 273 ProxyResolverJSBindings::CreateDefault(
274 host_resolver, &global_log, NULL)); 274 host_resolver, &global_log, NULL));
275 275
276 // Attach a capturing NetLog as the current request's log stream. 276 // Attach a capturing NetLog as the current request's log stream.
277 CapturingNetLog log(CapturingNetLog::kUnbounded); 277 CapturingNetLog log(CapturingNetLog::kUnbounded);
278 BoundNetLog bound_log(NetLog::Source(NetLog::SOURCE_NONE, 0), &log); 278 BoundNetLog bound_log(BoundNetLog::Make(&log, NetLog::SOURCE_NONE));
279 ProxyResolverRequestContext context(&bound_log, NULL); 279 ProxyResolverRequestContext context(&bound_log, NULL);
280 bindings->set_current_request_context(&context); 280 bindings->set_current_request_context(&context);
281 281
282 std::string ip_address; 282 std::string ip_address;
283 net::CapturingNetLog::EntryList entries; 283 net::CapturingNetLog::EntryList entries;
284 log.GetEntries(&entries); 284 log.GetEntries(&entries);
285 ASSERT_EQ(0u, entries.size()); 285 ASSERT_EQ(0u, entries.size());
286 286
287 // Call all the bindings. Each call should be logging something to 287 // Call all the bindings. Each call should be logging something to
288 // our NetLog. 288 // our NetLog.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 global_log.GetEntries(&global_log_entries); 355 global_log.GetEntries(&global_log_entries);
356 EXPECT_EQ(2u, global_log_entries.size()); 356 EXPECT_EQ(2u, global_log_entries.size());
357 EXPECT_TRUE(LogContainsEvent( 357 EXPECT_TRUE(LogContainsEvent(
358 global_log_entries, 1, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, 358 global_log_entries, 1, NetLog::TYPE_PAC_JAVASCRIPT_ALERT,
359 NetLog::PHASE_NONE)); 359 NetLog::PHASE_NONE));
360 } 360 }
361 361
362 } // namespace 362 } // namespace
363 363
364 } // namespace net 364 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698