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

Unified Diff: net/proxy/multi_threaded_proxy_resolver_unittest.cc

Issue 4118004: Update NetLog to be thread safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Final sync with trunk Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver.cc ('k') | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/multi_threaded_proxy_resolver_unittest.cc
===================================================================
--- net/proxy/multi_threaded_proxy_resolver_unittest.cc (revision 67848)
+++ net/proxy/multi_threaded_proxy_resolver_unittest.cc (working copy)
@@ -260,10 +260,12 @@
// on completion, this should have been copied into |log0|.
// We also have 1 log entry that was emitted by the
// MultiThreadedProxyResolver.
- ASSERT_EQ(2u, log0.entries().size());
- EXPECT_EQ(NetLog::TYPE_SUBMITTED_TO_RESOLVER_THREAD,
- log0.entries()[0].type);
+ net::CapturingNetLog::EntryList entries0;
+ log0.GetEntries(&entries0);
+ ASSERT_EQ(2u, entries0.size());
+ EXPECT_EQ(NetLog::TYPE_SUBMITTED_TO_RESOLVER_THREAD, entries0[0].type);
+
// Start 3 more requests (request1 to request3).
TestCompletionCallback callback1;
@@ -368,30 +370,42 @@
// 1 entry from the mock proxy resolver.
EXPECT_EQ(0, callback0.WaitForResult());
EXPECT_EQ("PROXY request0:80", results0.ToPacString());
- ASSERT_EQ(2u, log0.entries().size());
+
+ net::CapturingNetLog::EntryList entries0;
+ log0.GetEntries(&entries0);
+
+ ASSERT_EQ(2u, entries0.size());
EXPECT_EQ(NetLog::TYPE_SUBMITTED_TO_RESOLVER_THREAD,
- log0.entries()[0].type);
+ entries0[0].type);
// Check that request 1 completed as expected.
EXPECT_EQ(1, callback1.WaitForResult());
EXPECT_EQ("PROXY request1:80", results1.ToPacString());
- ASSERT_EQ(4u, log1.entries().size());
+
+ net::CapturingNetLog::EntryList entries1;
+ log1.GetEntries(&entries1);
+
+ ASSERT_EQ(4u, entries1.size());
EXPECT_TRUE(LogContainsBeginEvent(
- log1.entries(), 0,
+ entries1, 0,
NetLog::TYPE_WAITING_FOR_PROXY_RESOLVER_THREAD));
EXPECT_TRUE(LogContainsEndEvent(
- log1.entries(), 1,
+ entries1, 1,
NetLog::TYPE_WAITING_FOR_PROXY_RESOLVER_THREAD));
// Check that request 2 completed as expected.
EXPECT_EQ(2, callback2.WaitForResult());
EXPECT_EQ("PROXY request2:80", results2.ToPacString());
- ASSERT_EQ(4u, log2.entries().size());
+
+ net::CapturingNetLog::EntryList entries2;
+ log2.GetEntries(&entries2);
+
+ ASSERT_EQ(4u, entries2.size());
EXPECT_TRUE(LogContainsBeginEvent(
- log2.entries(), 0,
+ entries2, 0,
NetLog::TYPE_WAITING_FOR_PROXY_RESOLVER_THREAD));
EXPECT_TRUE(LogContainsEndEvent(
- log2.entries(), 1,
+ entries2, 1,
NetLog::TYPE_WAITING_FOR_PROXY_RESOLVER_THREAD));
}
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver.cc ('k') | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698