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

Side by Side Diff: content/common/gpu/client/gl_helper_unittest.cc

Issue 892213004: Mechanical rename of base::debug -> base::trace_event for /content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_trace_part3_1
Patch Set: Rebase. Created 5 years, 10 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 | « content/child/child_thread_impl.cc ('k') | content/common/gpu/gpu_command_buffer_stub.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 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 <stdio.h> 5 #include <stdio.h>
6 #include <cmath> 6 #include <cmath>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include <GLES2/gl2.h> 10 #include <GLES2/gl2.h>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 context_->GetGLInterface(), helper_.get())); 69 context_->GetGLInterface(), helper_.get()));
70 } 70 }
71 71
72 void TearDown() override { 72 void TearDown() override {
73 helper_scaling_.reset(NULL); 73 helper_scaling_.reset(NULL);
74 helper_.reset(NULL); 74 helper_.reset(NULL);
75 context_.reset(NULL); 75 context_.reset(NULL);
76 } 76 }
77 77
78 void StartTracing(const std::string& filter) { 78 void StartTracing(const std::string& filter) {
79 base::debug::TraceLog::GetInstance()->SetEnabled( 79 base::trace_event::TraceLog::GetInstance()->SetEnabled(
80 base::debug::CategoryFilter(filter), 80 base::trace_event::CategoryFilter(filter),
81 base::debug::TraceLog::RECORDING_MODE, 81 base::trace_event::TraceLog::RECORDING_MODE,
82 base::debug::TraceOptions( 82 base::trace_event::TraceOptions(
83 base::debug::RECORD_UNTIL_FULL)); 83 base::trace_event::RECORD_UNTIL_FULL));
84 } 84 }
85 85
86 static void TraceDataCB( 86 static void TraceDataCB(
87 const base::Callback<void()>& callback, 87 const base::Callback<void()>& callback,
88 std::string* output, 88 std::string* output,
89 const scoped_refptr<base::RefCountedString>& json_events_str, 89 const scoped_refptr<base::RefCountedString>& json_events_str,
90 bool has_more_events) { 90 bool has_more_events) {
91 if (output->size() > 1) { 91 if (output->size() > 1) {
92 output->append(","); 92 output->append(",");
93 } 93 }
94 output->append(json_events_str->data()); 94 output->append(json_events_str->data());
95 if (!has_more_events) { 95 if (!has_more_events) {
96 callback.Run(); 96 callback.Run();
97 } 97 }
98 } 98 }
99 99
100 // End tracing, return tracing data in a simple map 100 // End tracing, return tracing data in a simple map
101 // of event name->counts. 101 // of event name->counts.
102 void EndTracing(std::map<std::string, int>* event_counts) { 102 void EndTracing(std::map<std::string, int>* event_counts) {
103 std::string json_data = "["; 103 std::string json_data = "[";
104 base::debug::TraceLog::GetInstance()->SetDisabled(); 104 base::trace_event::TraceLog::GetInstance()->SetDisabled();
105 base::RunLoop run_loop; 105 base::RunLoop run_loop;
106 base::debug::TraceLog::GetInstance()->Flush( 106 base::trace_event::TraceLog::GetInstance()->Flush(
107 base::Bind(&GLHelperTest::TraceDataCB, 107 base::Bind(&GLHelperTest::TraceDataCB,
108 run_loop.QuitClosure(), 108 run_loop.QuitClosure(),
109 base::Unretained(&json_data))); 109 base::Unretained(&json_data)));
110 run_loop.Run(); 110 run_loop.Run();
111 json_data.append("]"); 111 json_data.append("]");
112 112
113 scoped_ptr<base::Value> trace_data(base::JSONReader::Read(json_data)); 113 scoped_ptr<base::Value> trace_data(base::JSONReader::Read(json_data));
114 base::ListValue* list; 114 base::ListValue* list;
115 CHECK(trace_data->GetAsList(&list)); 115 CHECK(trace_data->GetAsList(&list));
116 for (size_t i = 0; i < list->GetSize(); i++) { 116 for (size_t i = 0; i < list->GetSize(); i++) {
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); 1971 base::TestSuite* suite = new content::ContentTestSuite(argc, argv);
1972 #if defined(OS_MACOSX) 1972 #if defined(OS_MACOSX)
1973 base::mac::ScopedNSAutoreleasePool pool; 1973 base::mac::ScopedNSAutoreleasePool pool;
1974 #endif 1974 #endif
1975 1975
1976 return base::LaunchUnitTestsSerially( 1976 return base::LaunchUnitTestsSerially(
1977 argc, 1977 argc,
1978 argv, 1978 argv,
1979 base::Bind(&RunHelper, base::Unretained(suite))); 1979 base::Bind(&RunHelper, base::Unretained(suite)));
1980 } 1980 }
OLDNEW
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698