OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file provides reliablity tests which run for ChromeFrame. | 5 // This file provides reliablity tests which run for ChromeFrame. |
6 // | 6 // |
7 // Usage: | 7 // Usage: |
8 // <reliability test exe> --list=file --startline=start --endline=end [...] | 8 // <reliability test exe> --list=file --startline=start --endline=end [...] |
9 // Upon invocation, it visits each of the URLs on line numbers between start | 9 // Upon invocation, it visits each of the URLs on line numbers between start |
10 // and end, inclusive, stored in the input file. The line number starts from 1. | 10 // and end, inclusive, stored in the input file. The line number starts from 1. |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 num_dumps++; | 421 num_dumps++; |
422 } | 422 } |
423 } | 423 } |
424 if (metrics) | 424 if (metrics) |
425 metrics->crash_dump_count = num_dumps; | 425 metrics->crash_dump_count = num_dumps; |
426 } | 426 } |
427 | 427 |
428 // Get a PrefService whose contents correspond to the Local State file | 428 // Get a PrefService whose contents correspond to the Local State file |
429 // that was saved by the app as it closed. The caller takes ownership of the | 429 // that was saved by the app as it closed. The caller takes ownership of the |
430 // returned PrefService object. | 430 // returned PrefService object. |
431 PrefService* GetLocalState() { | 431 PrefServiceSimple* GetLocalState() { |
432 FilePath path; | 432 FilePath path; |
433 chrome::GetChromeFrameUserDataDirectory(&path); | 433 chrome::GetChromeFrameUserDataDirectory(&path); |
434 return PrefServiceMockBuilder().WithUserFilePrefs( | 434 PrefServiceMockBuilder builder; |
| 435 builder.WithUserFilePrefs( |
435 path, | 436 path, |
436 JsonPrefStore::GetTaskRunnerForFile( | 437 JsonPrefStore::GetTaskRunnerForFile( |
437 path, content::BrowserThread::GetBlockingPool())).Create(); | 438 path, content::BrowserThread::GetBlockingPool())); |
| 439 return builder.CreateSimple(); |
438 } | 440 } |
439 | 441 |
440 void GetStabilityMetrics(NavigationMetrics* metrics) { | 442 void GetStabilityMetrics(NavigationMetrics* metrics) { |
441 if (!metrics) | 443 if (!metrics) |
442 return; | 444 return; |
443 scoped_ptr<PrefService> local_state(GetLocalState()); | 445 scoped_ptr<PrefServiceSimple> local_state(GetLocalState()); |
444 if (!local_state.get()) | 446 if (!local_state.get()) |
445 return; | 447 return; |
446 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 448 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
447 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); | 449 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); |
448 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); | 450 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); |
449 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); | 451 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); |
450 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 452 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
451 | 453 |
452 metrics->browser_clean_exit = | 454 metrics->browser_clean_exit = |
453 local_state->GetBoolean(prefs::kStabilityExitedCleanly); | 455 local_state->GetBoolean(prefs::kStabilityExitedCleanly); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 585 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
584 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 586 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
585 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); | 587 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); |
586 if (!file_util::AbsolutePath(&g_v8_log_path)) | 588 if (!file_util::AbsolutePath(&g_v8_log_path)) |
587 g_v8_log_path = FilePath(); | 589 g_v8_log_path = FilePath(); |
588 } | 590 } |
589 } | 591 } |
590 } | 592 } |
591 } | 593 } |
592 } | 594 } |
OLD | NEW |