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

Side by Side Diff: chrome/test/perf/startup_test.cc

Issue 165123003: Use chrome_constants rather than hardcoded Preferences string in startup_test.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile Created 6 years, 10 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/environment.h" 5 #include "base/environment.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 set_template_user_data(data_dir); 103 set_template_user_data(data_dir);
104 } 104 }
105 105
106 // Rewrite the preferences file to point to the proper image directory. 106 // Rewrite the preferences file to point to the proper image directory.
107 virtual void SetUpProfile() OVERRIDE { 107 virtual void SetUpProfile() OVERRIDE {
108 UIPerfTest::SetUpProfile(); 108 UIPerfTest::SetUpProfile();
109 if (profile_type_ != PerfUITestSuite::COMPLEX_THEME) 109 if (profile_type_ != PerfUITestSuite::COMPLEX_THEME)
110 return; 110 return;
111 111
112 const base::FilePath pref_template_path(user_data_dir(). 112 const base::FilePath pref_template_path(user_data_dir().
113 AppendASCII("Default"). 113 AppendASCII(chrome::kInitialProfile).
114 AppendASCII("PreferencesTemplate")); 114 AppendASCII("PreferencesTemplate"));
115 const base::FilePath pref_path(user_data_dir(). 115 const base::FilePath pref_path(user_data_dir().
116 AppendASCII(TestingProfile::kTestUserProfileDir). 116 AppendASCII(TestingProfile::kTestUserProfileDir).
117 AppendASCII("Preferences")); 117 Append(chrome::kPreferencesFilename));
118 118
119 // Read in preferences template. 119 // Read in preferences template.
120 std::string pref_string; 120 std::string pref_string;
121 EXPECT_TRUE(base::ReadFileToString(pref_template_path, &pref_string)); 121 EXPECT_TRUE(base::ReadFileToString(pref_template_path, &pref_string));
122 base::string16 format_string = base::ASCIIToUTF16(pref_string); 122 base::string16 format_string = base::ASCIIToUTF16(pref_string);
123 123
124 // Make sure temp directory has the proper format for writing to prefs file. 124 // Make sure temp directory has the proper format for writing to prefs file.
125 #if defined(OS_POSIX) 125 #if defined(OS_POSIX)
126 std::wstring user_data_dir_w(base::ASCIIToWide(user_data_dir().value())); 126 std::wstring user_data_dir_w(base::ASCIIToWide(user_data_dir().value()));
127 #elif defined(OS_WIN) 127 #elif defined(OS_WIN)
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 474
475 TEST_F(StartupTest, ProfilingScript1) { 475 TEST_F(StartupTest, ProfilingScript1) {
476 SetUpWithFileURL(); 476 SetUpWithFileURL();
477 SetUpWithProfiling(); 477 SetUpWithProfiling();
478 RunStartupTest("warm", "profiling_scripts1", WARM, NOT_IMPORTANT, 478 RunStartupTest("warm", "profiling_scripts1", WARM, NOT_IMPORTANT,
479 PerfUITestSuite::DEFAULT_THEME, 1, 0); 479 PerfUITestSuite::DEFAULT_THEME, 1, 0);
480 } 480 }
481 481
482 } // namespace 482 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698