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 PrefServiceSimple* GetLocalState() { | 431 PrefService* GetLocalState() { |
432 FilePath path; | 432 FilePath path; |
433 chrome::GetChromeFrameUserDataDirectory(&path); | 433 chrome::GetChromeFrameUserDataDirectory(&path); |
434 PrefServiceMockBuilder builder; | 434 PrefServiceMockBuilder builder; |
435 builder.WithUserFilePrefs( | 435 builder.WithUserFilePrefs( |
436 path, | 436 path, |
437 JsonPrefStore::GetTaskRunnerForFile( | 437 JsonPrefStore::GetTaskRunnerForFile( |
438 path, content::BrowserThread::GetBlockingPool())); | 438 path, content::BrowserThread::GetBlockingPool())); |
439 return builder.CreateSimple(); | 439 return builder.CreateSimple(); |
440 } | 440 } |
441 | 441 |
442 void GetStabilityMetrics(NavigationMetrics* metrics) { | 442 void GetStabilityMetrics(NavigationMetrics* metrics) { |
443 if (!metrics) | 443 if (!metrics) |
444 return; | 444 return; |
445 scoped_ptr<PrefServiceSimple> local_state(GetLocalState()); | 445 scoped_ptr<PrefService> local_state(GetLocalState()); |
446 if (!local_state.get()) | 446 if (!local_state.get()) |
447 return; | 447 return; |
448 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 448 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
449 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); | 449 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); |
450 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); | 450 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); |
451 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); | 451 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); |
452 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 452 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
453 | 453 |
454 metrics->browser_clean_exit = | 454 metrics->browser_clean_exit = |
455 local_state->GetBoolean(prefs::kStabilityExitedCleanly); | 455 local_state->GetBoolean(prefs::kStabilityExitedCleanly); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 585 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
586 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 586 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
587 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); | 587 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); |
588 if (!file_util::AbsolutePath(&g_v8_log_path)) | 588 if (!file_util::AbsolutePath(&g_v8_log_path)) |
589 g_v8_log_path = FilePath(); | 589 g_v8_log_path = FilePath(); |
590 } | 590 } |
591 } | 591 } |
592 } | 592 } |
593 } | 593 } |
594 } | 594 } |
OLD | NEW |