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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), true)); | 347 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), true)); |
348 | 348 |
349 wait_for_upload.Run(); | 349 wait_for_upload.Run(); |
350 | 350 |
351 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 351 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
352 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("cpu-brand")); | 352 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("cpu-brand")); |
353 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("network-type")); | 353 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("network-type")); |
354 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("user-agent")); | 354 EXPECT_TRUE(upload_config_wrapper.TraceHasMatchingString("user-agent")); |
355 } | 355 } |
356 | 356 |
357 #if defined(OS_ANDROID) || defined(OS_LINUX) | 357 // Flaky on android, linux, and windows: https://crbug.com/639706 and |
358 // Flaky on android: https://crbug.com/639706 | 358 // https://crbug.com/643415. |
359 // Flaky on android, linux: https://crbug.com/639706 | |
360 #define MAYBE_CrashWhenSubprocessWithoutArgumentFilter \ | |
361 DISABLED_CrashWhenSubprocessWithoutArgumentFilter | |
362 #else | |
363 #define MAYBE_CrashWhenSubprocessWithoutArgumentFilter \ | |
364 CrashWhenSubprocessWithoutArgumentFilter | |
365 #endif | |
366 | |
367 // This tests subprocesses (like a navigating renderer) which gets told to | 359 // This tests subprocesses (like a navigating renderer) which gets told to |
368 // provide a argument-filtered trace and has no predicate in place to do the | 360 // provide a argument-filtered trace and has no predicate in place to do the |
369 // filtering (in this case, only the browser process gets it set), will crash | 361 // filtering (in this case, only the browser process gets it set), will crash |
370 // rather than return potential PII. | 362 // rather than return potential PII. |
371 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, | 363 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, |
372 MAYBE_CrashWhenSubprocessWithoutArgumentFilter) { | 364 DISABLED_CrashWhenSubprocessWithoutArgumentFilter) { |
373 SetupBackgroundTracingManager(); | 365 SetupBackgroundTracingManager(); |
374 | 366 |
375 base::trace_event::TraceLog::GetInstance()->SetArgumentFilterPredicate( | 367 base::trace_event::TraceLog::GetInstance()->SetArgumentFilterPredicate( |
376 base::Bind(&IsTraceEventArgsWhitelisted)); | 368 base::Bind(&IsTraceEventArgsWhitelisted)); |
377 | 369 |
378 base::RunLoop wait_for_upload; | 370 base::RunLoop wait_for_upload; |
379 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( | 371 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( |
380 wait_for_upload.QuitClosure()); | 372 wait_for_upload.QuitClosure()); |
381 | 373 |
382 std::unique_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); | 374 std::unique_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1454 EXPECT_FALSE( | 1446 EXPECT_FALSE( |
1455 BackgroundTracingManagerImpl::GetInstance()->IsTracingForTesting()); | 1447 BackgroundTracingManagerImpl::GetInstance()->IsTracingForTesting()); |
1456 | 1448 |
1457 run_loop.Run(); | 1449 run_loop.Run(); |
1458 | 1450 |
1459 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 1451 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
1460 } | 1452 } |
1461 } | 1453 } |
1462 | 1454 |
1463 } // namespace content | 1455 } // namespace content |
OLD | NEW |