| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 NAVIGATION_ERROR = 0, | 129 NAVIGATION_ERROR = 0, |
| 130 NAVIGATION_SUCCESS, | 130 NAVIGATION_SUCCESS, |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 typedef struct { | 133 typedef struct { |
| 134 // These are results from the test automation that drives Chrome | 134 // These are results from the test automation that drives Chrome |
| 135 NavigationResult result; | 135 NavigationResult result; |
| 136 int crash_dump_count; | 136 int crash_dump_count; |
| 137 // These are stability metrics recorded by Chrome itself | 137 // These are stability metrics recorded by Chrome itself |
| 138 bool browser_clean_exit; | 138 bool browser_clean_exit; |
| 139 int browser_execution_phase; |
| 139 int browser_launch_count; | 140 int browser_launch_count; |
| 140 int page_load_count; | 141 int page_load_count; |
| 141 int browser_crash_count; | 142 int browser_crash_count; |
| 142 int renderer_crash_count; | 143 int renderer_crash_count; |
| 143 int plugin_crash_count; | 144 int plugin_crash_count; |
| 144 } NavigationMetrics; | 145 } NavigationMetrics; |
| 145 | 146 |
| 146 PageLoadTest() {} | 147 PageLoadTest() {} |
| 147 | 148 |
| 148 // Accept URL as std::string here because the url may also act as a test id | 149 // Accept URL as std::string here because the url may also act as a test id |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 JsonPrefStore::GetTaskRunnerForFile( | 440 JsonPrefStore::GetTaskRunnerForFile( |
| 440 path, content::BrowserThread::GetBlockingPool())); | 441 path, content::BrowserThread::GetBlockingPool())); |
| 441 return builder.Create(registry); | 442 return builder.Create(registry); |
| 442 } | 443 } |
| 443 | 444 |
| 444 void GetStabilityMetrics(NavigationMetrics* metrics) { | 445 void GetStabilityMetrics(NavigationMetrics* metrics) { |
| 445 if (!metrics) | 446 if (!metrics) |
| 446 return; | 447 return; |
| 447 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple(); | 448 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple(); |
| 448 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 449 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
| 450 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, 0); |
| 449 registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); | 451 registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); |
| 450 registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); | 452 registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); |
| 451 registry->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); | 453 registry->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); |
| 452 registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 454 registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
| 453 | 455 |
| 454 scoped_ptr<PrefService> local_state(GetLocalState(registry)); | 456 scoped_ptr<PrefService> local_state(GetLocalState(registry)); |
| 455 if (!local_state.get()) | 457 if (!local_state.get()) |
| 456 return; | 458 return; |
| 457 | 459 |
| 458 metrics->browser_clean_exit = | 460 metrics->browser_clean_exit = |
| 459 local_state->GetBoolean(prefs::kStabilityExitedCleanly); | 461 local_state->GetBoolean(prefs::kStabilityExitedCleanly); |
| 462 metrics->browser_execution_phase = |
| 463 local_state->GetInteger(prefs::kStabilityExecutionPhase); |
| 460 metrics->browser_launch_count = | 464 metrics->browser_launch_count = |
| 461 local_state->GetInteger(prefs::kStabilityLaunchCount); | 465 local_state->GetInteger(prefs::kStabilityLaunchCount); |
| 462 metrics->page_load_count = | 466 metrics->page_load_count = |
| 463 local_state->GetInteger(prefs::kStabilityPageLoadCount); | 467 local_state->GetInteger(prefs::kStabilityPageLoadCount); |
| 464 metrics->browser_crash_count = | 468 metrics->browser_crash_count = |
| 465 local_state->GetInteger(prefs::kStabilityCrashCount); | 469 local_state->GetInteger(prefs::kStabilityCrashCount); |
| 466 metrics->renderer_crash_count = | 470 metrics->renderer_crash_count = |
| 467 local_state->GetInteger(prefs::kStabilityRendererCrashCount); | 471 local_state->GetInteger(prefs::kStabilityRendererCrashCount); |
| 468 // TODO(huanr) | 472 // TODO(huanr) |
| 469 metrics->plugin_crash_count = 0; | 473 metrics->plugin_crash_count = 0; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 CommandLine v8_command_line( | 592 CommandLine v8_command_line( |
| 589 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 593 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
| 590 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 594 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
| 591 g_v8_log_path = base::MakeAbsoluteFilePath( | 595 g_v8_log_path = base::MakeAbsoluteFilePath( |
| 592 v8_command_line.GetSwitchValuePath(kV8LogFileSwitch)); | 596 v8_command_line.GetSwitchValuePath(kV8LogFileSwitch)); |
| 593 } | 597 } |
| 594 } | 598 } |
| 595 } | 599 } |
| 596 } | 600 } |
| 597 } | 601 } |
| OLD | NEW |