Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc

Issue 1426803004: Made the NavigationTracingObserver always be active whenever background tracing is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@random_triggers
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/tracing/navigation_tracing.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/base_switches.h" 5 #include "base/base_switches.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 switches::kForceFieldTrialParams, 221 switches::kForceFieldTrialParams,
222 "BackgroundTracing.TestGroup:config/default_config_for_testing"); 222 "BackgroundTracing.TestGroup:config/default_config_for_testing");
223 223
224 tracing::SetConfigTextFilterForTesting(&FieldTrialConfigTextFilter); 224 tracing::SetConfigTextFilterForTesting(&FieldTrialConfigTextFilter);
225 } 225 }
226 }; 226 };
227 227
228 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, 228 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup,
229 ScenarioSetFromFieldtrial) { 229 ScenarioSetFromFieldtrial) {
230 // We should reach this point without crashing. 230 // We should reach this point without crashing.
231 EXPECT_TRUE(content::BackgroundTracingManager::GetInstance() 231 EXPECT_TRUE(
232 ->HasActiveScenarioForTesting()); 232 content::BackgroundTracingManager::GetInstance()->HasActiveScenario());
233 } 233 }
234 234
235 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, 235 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup,
236 PRE_StartupTracingThrottle) { 236 PRE_StartupTracingThrottle) {
237 EXPECT_TRUE(content::BackgroundTracingManager::GetInstance() 237 EXPECT_TRUE(
238 ->HasActiveScenarioForTesting()); 238 content::BackgroundTracingManager::GetInstance()->HasActiveScenario());
239 239
240 // Simulate a trace upload. 240 // Simulate a trace upload.
241 PrefService* local_state = g_browser_process->local_state(); 241 PrefService* local_state = g_browser_process->local_state();
242 DCHECK(local_state); 242 DCHECK(local_state);
243 local_state->SetInt64(prefs::kBackgroundTracingLastUpload, 243 local_state->SetInt64(prefs::kBackgroundTracingLastUpload,
244 base::Time::Now().ToInternalValue()); 244 base::Time::Now().ToInternalValue());
245 } 245 }
246 246
247 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup, 247 IN_PROC_BROWSER_TEST_F(ChromeTracingDelegateBrowserTestOnStartup,
248 StartupTracingThrottle) { 248 StartupTracingThrottle) {
249 // The startup scenario should *not* be started, since not enough 249 // The startup scenario should *not* be started, since not enough
250 // time has elapsed since the last upload (set in the PRE_ above). 250 // time has elapsed since the last upload (set in the PRE_ above).
251 EXPECT_FALSE(content::BackgroundTracingManager::GetInstance() 251 EXPECT_FALSE(
252 ->HasActiveScenarioForTesting()); 252 content::BackgroundTracingManager::GetInstance()->HasActiveScenario());
253 } 253 }
254 254
255 } // namespace 255 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tracing/navigation_tracing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698