OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |