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

Side by Side Diff: net/log/trace_net_log_observer_unittest.cc

Issue 1165673002: [Startup Tracing] Hook up TraceConfig and remove CategoryFilter & TraceOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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
« no previous file with comments | « mojo/runner/desktop/launcher_process.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/log/trace_net_log_observer.h" 5 #include "net/log/trace_net_log_observer.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 ASSERT_TRUE(trace_value->GetAsList(&trace_events)); 84 ASSERT_TRUE(trace_value->GetAsList(&trace_events));
85 85
86 trace_events_ = FilterNetLogTraceEvents(*trace_events); 86 trace_events_ = FilterNetLogTraceEvents(*trace_events);
87 87
88 if (!has_more_events) 88 if (!has_more_events)
89 run_loop->Quit(); 89 run_loop->Quit();
90 } 90 }
91 91
92 static void EnableTraceLog() { 92 static void EnableTraceLog() {
93 TraceLog::GetInstance()->SetEnabled( 93 TraceLog::GetInstance()->SetEnabled(
94 base::trace_event::CategoryFilter(kNetLogTracingCategory), 94 base::trace_event::TraceConfig(kNetLogTracingCategory, ""),
95 TraceLog::RECORDING_MODE, base::trace_event::TraceOptions()); 95 TraceLog::RECORDING_MODE);
96 } 96 }
97 97
98 void EndTraceAndFlush() { 98 void EndTraceAndFlush() {
99 base::RunLoop run_loop; 99 base::RunLoop run_loop;
100 TraceLog::GetInstance()->SetDisabled(); 100 TraceLog::GetInstance()->SetDisabled();
101 TraceLog::GetInstance()->Flush( 101 TraceLog::GetInstance()->Flush(
102 base::Bind(&TraceNetLogObserverTest::OnTraceDataCollected, 102 base::Bind(&TraceNetLogObserverTest::OnTraceDataCollected,
103 base::Unretained(this), base::Unretained(&run_loop))); 103 base::Unretained(this), base::Unretained(&run_loop)));
104 run_loop.Run(); 104 run_loop.Run();
105 } 105 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 EXPECT_TRUE(item1->GetString("args.params.foo", &item1_params)); 364 EXPECT_TRUE(item1->GetString("args.params.foo", &item1_params));
365 EXPECT_EQ("bar", item1_params); 365 EXPECT_EQ("bar", item1_params);
366 366
367 EXPECT_TRUE(item2->GetString("args.params", &item2_params)); 367 EXPECT_TRUE(item2->GetString("args.params", &item2_params));
368 EXPECT_TRUE(item2_params.empty()); 368 EXPECT_TRUE(item2_params.empty());
369 } 369 }
370 370
371 } // namespace 371 } // namespace
372 372
373 } // namespace net 373 } // namespace net
OLDNEW
« no previous file with comments | « mojo/runner/desktop/launcher_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698