| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 178 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
| 179 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), true)); | 179 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), true)); |
| 180 | 180 |
| 181 run_loop.Run(); | 181 run_loop.Run(); |
| 182 | 182 |
| 183 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 183 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 #if defined(THREAD_SANITIZER) |
| 188 // There's a race in ConvertableToTraceFormat that's hard to suppress, |
| 189 // see http://crbug.com/559117. |
| 190 #define MAYBE_CallTriggersMoreThanOnceOnlyGatherOnce \ |
| 191 DISABLED_CallTriggersMoreThanOnceOnlyGatherOnce |
| 192 #else |
| 193 #define MAYBE_CallTriggersMoreThanOnceOnlyGatherOnce \ |
| 194 CallTriggersMoreThanOnceOnlyGatherOnce |
| 195 #endif |
| 187 // This tests triggering more than once still only gathers once. | 196 // This tests triggering more than once still only gathers once. |
| 188 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, | 197 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, |
| 189 CallTriggersMoreThanOnceOnlyGatherOnce) { | 198 MAYBE_CallTriggersMoreThanOnceOnlyGatherOnce) { |
| 190 { | 199 { |
| 191 SetupBackgroundTracingManager(); | 200 SetupBackgroundTracingManager(); |
| 192 | 201 |
| 193 base::RunLoop run_loop; | 202 base::RunLoop run_loop; |
| 194 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( | 203 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( |
| 195 run_loop.QuitClosure()); | 204 run_loop.QuitClosure()); |
| 196 | 205 |
| 197 scoped_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); | 206 scoped_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); |
| 198 | 207 |
| 199 content::BackgroundTracingManager::TriggerHandle handle = | 208 content::BackgroundTracingManager::TriggerHandle handle = |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 1117 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
| 1109 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); | 1118 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); |
| 1110 | 1119 |
| 1111 run_loop.Run(); | 1120 run_loop.Run(); |
| 1112 | 1121 |
| 1113 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 1122 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
| 1114 } | 1123 } |
| 1115 } | 1124 } |
| 1116 | 1125 |
| 1117 } // namespace content | 1126 } // namespace content |
| OLD | NEW |