OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/strings/pattern.h" |
6 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
7 #include "content/public/browser/background_tracing_manager.h" | 8 #include "content/public/browser/background_tracing_manager.h" |
8 #include "content/public/browser/background_tracing_preemptive_config.h" | 9 #include "content/public/browser/background_tracing_preemptive_config.h" |
9 #include "content/public/browser/background_tracing_reactive_config.h" | 10 #include "content/public/browser/background_tracing_reactive_config.h" |
10 #include "content/public/test/content_browser_test.h" | 11 #include "content/public/test/content_browser_test.h" |
11 #include "content/public/test/content_browser_test_utils.h" | 12 #include "content/public/test/content_browser_test_utils.h" |
12 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
13 #include "third_party/zlib/zlib.h" | 14 #include "third_party/zlib/zlib.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 run_loop.Run(); | 197 run_loop.Run(); |
197 | 198 |
198 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 199 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
199 } | 200 } |
200 } | 201 } |
201 | 202 |
202 namespace { | 203 namespace { |
203 | 204 |
204 bool IsTraceEventArgsWhitelisted(const char* category_group_name, | 205 bool IsTraceEventArgsWhitelisted(const char* category_group_name, |
205 const char* event_name) { | 206 const char* event_name) { |
206 if (MatchPattern(category_group_name, "benchmark") && | 207 if (base::MatchPattern(category_group_name, "benchmark") && |
207 MatchPattern(event_name, "whitelisted")) { | 208 base::MatchPattern(event_name, "whitelisted")) { |
208 return true; | 209 return true; |
209 } | 210 } |
210 | 211 |
211 return false; | 212 return false; |
212 } | 213 } |
213 | 214 |
214 } // namespace | 215 } // namespace |
215 | 216 |
216 // This tests that non-whitelisted args get stripped if required. | 217 // This tests that non-whitelisted args get stripped if required. |
217 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, | 218 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 581 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
581 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); | 582 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); |
582 | 583 |
583 run_loop.Run(); | 584 run_loop.Run(); |
584 | 585 |
585 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 586 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
586 } | 587 } |
587 } | 588 } |
588 | 589 |
589 } // namespace content | 590 } // namespace content |
OLD | NEW |