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 | |
196 // This tests triggering more than once still only gathers once. | 187 // This tests triggering more than once still only gathers once. |
197 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, | 188 IN_PROC_BROWSER_TEST_F(BackgroundTracingManagerBrowserTest, |
198 MAYBE_CallTriggersMoreThanOnceOnlyGatherOnce) { | 189 CallTriggersMoreThanOnceOnlyGatherOnce) { |
199 { | 190 { |
200 SetupBackgroundTracingManager(); | 191 SetupBackgroundTracingManager(); |
201 | 192 |
202 base::RunLoop run_loop; | 193 base::RunLoop run_loop; |
203 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( | 194 BackgroundTracingManagerUploadConfigWrapper upload_config_wrapper( |
204 run_loop.QuitClosure()); | 195 run_loop.QuitClosure()); |
205 | 196 |
206 scoped_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); | 197 scoped_ptr<BackgroundTracingConfig> config = CreatePreemptiveConfig(); |
207 | 198 |
208 content::BackgroundTracingManager::TriggerHandle handle = | 199 content::BackgroundTracingManager::TriggerHandle handle = |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 1108 BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
1118 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); | 1109 handle, base::Bind(&StartedFinalizingCallback, base::Closure(), false)); |
1119 | 1110 |
1120 run_loop.Run(); | 1111 run_loop.Run(); |
1121 | 1112 |
1122 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); | 1113 EXPECT_TRUE(upload_config_wrapper.get_receive_count() == 1); |
1123 } | 1114 } |
1124 } | 1115 } |
1125 | 1116 |
1126 } // namespace content | 1117 } // namespace content |
OLD | NEW |