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

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

Issue 10590004: [cros] Fake a stub user login when no --login-manager and --login-user are given. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further test fixes. Created 8 years, 6 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
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/path_service.h" 7 #include "base/path_service.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "base/test/test_file_util.h" 13 #include "base/test/test_file_util.h"
14 #include "base/test/test_timeouts.h" 14 #include "base/test/test_timeouts.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/common/chrome_constants.h" 18 #include "chrome/common/chrome_constants.h"
18 #include "chrome/common/chrome_paths.h" 19 #include "chrome/common/chrome_paths.h"
19 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
20 #include "chrome/common/env_vars.h" 21 #include "chrome/common/env_vars.h"
21 #include "chrome/test/automation/automation_proxy.h" 22 #include "chrome/test/automation/automation_proxy.h"
22 #include "chrome/test/base/test_switches.h" 23 #include "chrome/test/base/test_switches.h"
23 #include "chrome/test/base/ui_test_utils.h" 24 #include "chrome/test/base/ui_test_utils.h"
24 #include "chrome/test/perf/perf_test.h" 25 #include "chrome/test/perf/perf_test.h"
25 #include "chrome/test/ui/ui_perf_test.h" 26 #include "chrome/test/ui/ui_perf_test.h"
26 #include "net/base/net_util.h" 27 #include "net/base/net_util.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 AppendASCII(profile); 86 AppendASCII(profile);
86 set_template_user_data(data_dir); 87 set_template_user_data(data_dir);
87 } 88 }
88 89
89 // Rewrite the preferences file to point to the proper image directory. 90 // Rewrite the preferences file to point to the proper image directory.
90 virtual void SetUpProfile() { 91 virtual void SetUpProfile() {
91 UIPerfTest::SetUpProfile(); 92 UIPerfTest::SetUpProfile();
92 if (profile_type_ != UITestBase::COMPLEX_THEME) 93 if (profile_type_ != UITestBase::COMPLEX_THEME)
93 return; 94 return;
94 95
95 const FilePath pref_template_path(user_data_dir().AppendASCII("Default"). 96 const FilePath pref_template_path(user_data_dir().
97 AppendASCII("Default").
96 AppendASCII("PreferencesTemplate")); 98 AppendASCII("PreferencesTemplate"));
97 const FilePath pref_path(user_data_dir().AppendASCII("Default"). 99 const FilePath pref_path(user_data_dir().
100 AppendASCII(ProfileManager::kTestUserProfile).
98 AppendASCII("Preferences")); 101 AppendASCII("Preferences"));
99 102
100 // Read in preferences template. 103 // Read in preferences template.
101 std::string pref_string; 104 std::string pref_string;
102 EXPECT_TRUE(file_util::ReadFileToString(pref_template_path, &pref_string)); 105 EXPECT_TRUE(file_util::ReadFileToString(pref_template_path, &pref_string));
103 string16 format_string = ASCIIToUTF16(pref_string); 106 string16 format_string = ASCIIToUTF16(pref_string);
104 107
105 // Make sure temp directory has the proper format for writing to prefs file. 108 // Make sure temp directory has the proper format for writing to prefs file.
106 #if defined(OS_POSIX) 109 #if defined(OS_POSIX)
107 std::wstring user_data_dir_w(ASCIIToWide(user_data_dir().value())); 110 std::wstring user_data_dir_w(ASCIIToWide(user_data_dir().value()));
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 UITestBase::CUSTOM_FRAME, 0, 0); 457 UITestBase::CUSTOM_FRAME, 0, 0);
455 } 458 }
456 459
457 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { 460 TEST_F(StartupTest, PerfNativeFrameGtkTheme) {
458 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, 461 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT,
459 UITestBase::CUSTOM_FRAME_NATIVE_THEME, 0, 0); 462 UITestBase::CUSTOM_FRAME_NATIVE_THEME, 0, 0);
460 } 463 }
461 #endif 464 #endif
462 465
463 } // namespace 466 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698