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

Side by Side Diff: chrome_frame/test/reliability/page_load_test.cc

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory ownership bug in ProxyPolicyTest Created 7 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 | Annotate | Revision Log
OLDNEW
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 20 matching lines...) Expand all
31 #include "base/path_service.h" 31 #include "base/path_service.h"
32 #include "base/prefs/json_pref_store.h" 32 #include "base/prefs/json_pref_store.h"
33 #include "base/prefs/pref_registry_simple.h" 33 #include "base/prefs/pref_registry_simple.h"
34 #include "base/prefs/pref_service.h" 34 #include "base/prefs/pref_service.h"
35 #include "base/prefs/pref_value_store.h" 35 #include "base/prefs/pref_value_store.h"
36 #include "base/strings/string_number_conversions.h" 36 #include "base/strings/string_number_conversions.h"
37 #include "base/strings/string_util.h" 37 #include "base/strings/string_util.h"
38 #include "base/strings/utf_string_conversions.h" 38 #include "base/strings/utf_string_conversions.h"
39 #include "base/test/test_file_util.h" 39 #include "base/test/test_file_util.h"
40 #include "base/time/time.h" 40 #include "base/time/time.h"
41 #include "chrome/browser/prefs/pref_service_mock_builder.h" 41 #include "chrome/browser/prefs/pref_service_mock_factory.h"
42 #include "chrome/common/automation_messages.h" 42 #include "chrome/common/automation_messages.h"
43 #include "chrome/common/chrome_constants.h" 43 #include "chrome/common/chrome_constants.h"
44 #include "chrome/common/chrome_paths.h" 44 #include "chrome/common/chrome_paths.h"
45 #include "chrome/common/chrome_paths_internal.h" 45 #include "chrome/common/chrome_paths_internal.h"
46 #include "chrome/common/chrome_switches.h" 46 #include "chrome/common/chrome_switches.h"
47 #include "chrome/common/logging_chrome.h" 47 #include "chrome/common/logging_chrome.h"
48 #include "chrome/common/net/url_fixer_upper.h" 48 #include "chrome/common/net/url_fixer_upper.h"
49 #include "chrome/common/pref_names.h" 49 #include "chrome/common/pref_names.h"
50 #include "chrome/test/automation/automation_proxy.h" 50 #include "chrome/test/automation/automation_proxy.h"
51 #include "chrome/test/automation/browser_proxy.h" 51 #include "chrome/test/automation/browser_proxy.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (metrics) 427 if (metrics)
428 metrics->crash_dump_count = num_dumps; 428 metrics->crash_dump_count = num_dumps;
429 } 429 }
430 430
431 // Get a PrefService whose contents correspond to the Local State file 431 // Get a PrefService whose contents correspond to the Local State file
432 // that was saved by the app as it closed. The caller takes ownership of the 432 // that was saved by the app as it closed. The caller takes ownership of the
433 // returned PrefService object. 433 // returned PrefService object.
434 PrefService* GetLocalState(PrefRegistry* registry) { 434 PrefService* GetLocalState(PrefRegistry* registry) {
435 base::FilePath path; 435 base::FilePath path;
436 chrome::GetChromeFrameUserDataDirectory(&path); 436 chrome::GetChromeFrameUserDataDirectory(&path);
437 PrefServiceMockBuilder builder; 437 PrefServiceMockFactory factory;
438 builder.WithUserFilePrefs( 438 factory.SetUserPrefsFile(
439 path, 439 path,
440 JsonPrefStore::GetTaskRunnerForFile( 440 JsonPrefStore::GetTaskRunnerForFile(
441 path, content::BrowserThread::GetBlockingPool())); 441 path, content::BrowserThread::GetBlockingPool()));
442 return builder.Create(registry); 442 return factory.Create(registry).release();
443 } 443 }
444 444
445 void GetStabilityMetrics(NavigationMetrics* metrics) { 445 void GetStabilityMetrics(NavigationMetrics* metrics) {
446 if (!metrics) 446 if (!metrics)
447 return; 447 return;
448 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple(); 448 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple();
449 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); 449 registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false);
450 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, 0); 450 registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, 0);
451 registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); 451 registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1);
452 registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); 452 registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 CommandLine v8_command_line( 592 CommandLine v8_command_line(
593 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); 593 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags));
594 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { 594 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) {
595 g_v8_log_path = base::MakeAbsoluteFilePath( 595 g_v8_log_path = base::MakeAbsoluteFilePath(
596 v8_command_line.GetSwitchValuePath(kV8LogFileSwitch)); 596 v8_command_line.GetSwitchValuePath(kV8LogFileSwitch));
597 } 597 }
598 } 598 }
599 } 599 }
600 } 600 }
601 } 601 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_pref_service_syncable.h ('k') | components/autofill/core/browser/autofill_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698