OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 test which runs under UI test framework. The | 5 // This file provides reliablity test which runs under UI test framework. The |
6 // test is intended to run within QEMU environment. | 6 // test is intended to run within QEMU environment. |
7 // | 7 // |
8 // Usage 1: reliability_test | 8 // Usage 1: reliability_test |
9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly | 9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly |
10 // used by buildbot, to verify reliability_test itself runs ok. | 10 // used by buildbot, to verify reliability_test itself runs ok. |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 metrics->crash_dump_count = num_dumps; | 523 metrics->crash_dump_count = num_dumps; |
524 } | 524 } |
525 | 525 |
526 // Get a PrefService whose contents correspond to the Local State file | 526 // Get a PrefService whose contents correspond to the Local State file |
527 // that was saved by the app as it closed. The caller takes ownership of the | 527 // that was saved by the app as it closed. The caller takes ownership of the |
528 // returned PrefService object. | 528 // returned PrefService object. |
529 PrefService* GetLocalState() { | 529 PrefService* GetLocalState() { |
530 FilePath local_state_path = user_data_dir() | 530 FilePath local_state_path = user_data_dir() |
531 .Append(chrome::kLocalStateFilename); | 531 .Append(chrome::kLocalStateFilename); |
532 | 532 |
533 PrefService* local_state(new PrefService(new PrefValueStore( | 533 PrefService* local_state = PrefService::CreateUserPrefService( |
534 NULL, /* no managed preference values */ | 534 local_state_path); |
535 new JsonPrefStore( /* user defined preference values */ | |
536 local_state_path, | |
537 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)), | |
538 NULL /* no advised preference values */))); | |
539 return local_state; | 535 return local_state; |
540 } | 536 } |
541 | 537 |
542 void GetStabilityMetrics(NavigationMetrics* metrics) { | 538 void GetStabilityMetrics(NavigationMetrics* metrics) { |
543 if (!metrics) | 539 if (!metrics) |
544 return; | 540 return; |
545 scoped_ptr<PrefService> local_state(GetLocalState()); | 541 scoped_ptr<PrefService> local_state(GetLocalState()); |
546 if (!local_state.get()) | 542 if (!local_state.get()) |
547 return; | 543 return; |
548 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 544 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 710 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
715 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 711 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
716 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); | 712 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); |
717 if (!file_util::AbsolutePath(&g_v8_log_path)) | 713 if (!file_util::AbsolutePath(&g_v8_log_path)) |
718 g_v8_log_path = FilePath(); | 714 g_v8_log_path = FilePath(); |
719 } | 715 } |
720 } | 716 } |
721 } | 717 } |
722 } | 718 } |
723 } | 719 } |
OLD | NEW |