| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 const base::Time last_upload_time = base::Time::FromInternalValue( | 144 const base::Time last_upload_time = base::Time::FromInternalValue( |
| 145 local_state->GetInt64(prefs::kBackgroundTracingLastUpload)); | 145 local_state->GetInt64(prefs::kBackgroundTracingLastUpload)); |
| 146 EXPECT_FALSE(last_upload_time.is_null()); | 146 EXPECT_FALSE(last_upload_time.is_null()); |
| 147 | 147 |
| 148 // We should not be able to start a new reactive scenario immediately after | 148 // We should not be able to start a new reactive scenario immediately after |
| 149 // a previous one gets uploaded. | 149 // a previous one gets uploaded. |
| 150 EXPECT_FALSE(StartPreemptiveScenario( | 150 EXPECT_FALSE(StartPreemptiveScenario( |
| 151 base::Closure(), content::BackgroundTracingManager::NO_DATA_FILTERING)); | 151 base::Closure(), content::BackgroundTracingManager::NO_DATA_FILTERING)); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Flaky on Linux. See https://crbug.com/723933. |
| 155 #if defined(OS_LINUX) |
| 156 #define MAYBE_BackgroundTracingThrottleTimeElapsed \ |
| 157 DISABLED_BackgroundTracingThrottleTimeElapsed |
| 158 #else |
| 159 #define MAYBE_BackgroundTracingThrottleTimeElapsed \ |
| 160 BackgroundTracingThrottleTimeElapsed |
| 161 #endif |
| 154 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTest, | 162 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTest, |
| 155 BackgroundTracingThrottleTimeElapsed) { | 163 MAYBE_BackgroundTracingThrottleTimeElapsed) { |
| 156 base::RunLoop wait_for_upload; | 164 base::RunLoop wait_for_upload; |
| 157 | 165 |
| 158 EXPECT_TRUE(StartPreemptiveScenario( | 166 EXPECT_TRUE(StartPreemptiveScenario( |
| 159 wait_for_upload.QuitClosure(), | 167 wait_for_upload.QuitClosure(), |
| 160 content::BackgroundTracingManager::NO_DATA_FILTERING)); | 168 content::BackgroundTracingManager::NO_DATA_FILTERING)); |
| 161 | 169 |
| 162 TriggerPreemptiveScenario(base::Closure()); | 170 TriggerPreemptiveScenario(base::Closure()); |
| 163 | 171 |
| 164 wait_for_upload.Run(); | 172 wait_for_upload.Run(); |
| 165 | 173 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 300 |
| 293 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, | 301 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, |
| 294 StartupTracingThrottle) { | 302 StartupTracingThrottle) { |
| 295 // The startup scenario should *not* be started, since not enough | 303 // The startup scenario should *not* be started, since not enough |
| 296 // time has elapsed since the last upload (set in the PRE_ above). | 304 // time has elapsed since the last upload (set in the PRE_ above). |
| 297 EXPECT_FALSE( | 305 EXPECT_FALSE( |
| 298 content::BackgroundTracingManager::GetInstance()->HasActiveScenario()); | 306 content::BackgroundTracingManager::GetInstance()->HasActiveScenario()); |
| 299 } | 307 } |
| 300 | 308 |
| 301 } // namespace | 309 } // namespace |
| OLD | NEW |