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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), true)); | 314 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), true)); |
315 | 315 |
316 wait_for_upload.Run(); | 316 wait_for_upload.Run(); |
317 | 317 |
318 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 318 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
319 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("cpu-brand")); | 319 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("cpu-brand")); |
320 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("network-type")); | 320 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("network-type")); |
321 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("user-agent")); | 321 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("user-agent")); |
322 } | 322 } |
323 | 323 |
| 324 #if defined(OS_ANDROID) |
| 325 // Flaky on android: https://crbug.com/639706 |
| 326 #define MAYBE_CrashWhenSubprocessWithoutArgumentFilter \ |
| 327 DISABLED_CrashWhenSubprocessWithoutArgumentFilter |
| 328 #else |
| 329 #define MAYBE_CrashWhenSubprocessWithoutArgumentFilter \ |
| 330 CrashWhenSubprocessWithoutArgumentFilter |
| 331 #endif |
| 332 |
324 // This tests subprocesses (like a navigating renderer) which gets told to | 333 // This tests subprocesses (like a navigating renderer) which gets told to |
325 // provide a argument-filtered trace and has no predicate in place to do the | 334 // provide a argument-filtered trace and has no predicate in place to do the |
326 // filtering (in this case, only the browser process gets it set), will crash | 335 // filtering (in this case, only the browser process gets it set), will crash |
327 // rather than return potential PII. | 336 // rather than return potential PII. |
328 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, | 337 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, |
329 CrashWhenSubprocessWithoutArgumentFilter) { | 338 MAYBE_CrashWhenSubprocessWithoutArgumentFilter) { |
330 SetupBackgroundTracingManager(); | 339 SetupBackgroundTracingManager(); |
331 | 340 |
332 base::trace_event::TraceLog::GetInstance()->SetArgumentFilterPredicate( | 341 base::trace_event::TraceLog::GetInstance()->SetArgumentFilterPredicate( |
333 base::Bind(&IsTraceEventArgsWhitelisted)); | 342 base::Bind(&IsTraceEventArgsWhitelisted)); |
334 | 343 |
335 base::RunLoop wait_for_upload; | 344 base::RunLoop wait_for_upload; |
336 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( | 345 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( |
337 wait_for_upload.QuitClosure()); | 346 wait_for_upload.QuitClosure()); |
338 | 347 |
339 std::unique_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); | 348 std::unique_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 1189 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
1181 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); | 1190 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); |
1182 | 1191 |
1183 run_loop.Run(); | 1192 run_loop.Run(); |
1184 | 1193 |
1185 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 1194 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
1186 } | 1195 } |
1187 } | 1196 } |
1188 | 1197 |
1189 } // namespace content | 1198 } // namespace content |
OLD | NEW |