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

Side by Side Diff: chrome/browser/performance_monitor/performance_monitor_browsertest.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/logging.h" 7 #include "base/logging.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/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile); 293 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile);
294 } else { 294 } else {
295 first_profile_name_ = chrome::kInitialProfile; 295 first_profile_name_ = chrome::kInitialProfile;
296 } 296 }
297 #else 297 #else
298 first_profile_name_ = chrome::kInitialProfile; 298 first_profile_name_ = chrome::kInitialProfile;
299 #endif 299 #endif
300 300
301 base::FilePath first_profile = 301 base::FilePath first_profile =
302 user_data_directory.AppendASCII(first_profile_name_); 302 user_data_directory.AppendASCII(first_profile_name_);
303 CHECK(file_util::CreateDirectory(first_profile)); 303 CHECK(base::CreateDirectory(first_profile));
304 304
305 base::FilePath stock_prefs_file; 305 base::FilePath stock_prefs_file;
306 PathService::Get(chrome::DIR_TEST_DATA, &stock_prefs_file); 306 PathService::Get(chrome::DIR_TEST_DATA, &stock_prefs_file);
307 stock_prefs_file = stock_prefs_file.AppendASCII("performance_monitor") 307 stock_prefs_file = stock_prefs_file.AppendASCII("performance_monitor")
308 .AppendASCII("unclean_exit_prefs"); 308 .AppendASCII("unclean_exit_prefs");
309 CHECK(base::PathExists(stock_prefs_file)); 309 CHECK(base::PathExists(stock_prefs_file));
310 310
311 base::FilePath first_profile_prefs_file = 311 base::FilePath first_profile_prefs_file =
312 first_profile.Append(chrome::kPreferencesFilename); 312 first_profile.Append(chrome::kPreferencesFilename);
313 CHECK(base::CopyFile(stock_prefs_file, first_profile_prefs_file)); 313 CHECK(base::CopyFile(stock_prefs_file, first_profile_prefs_file));
314 CHECK(base::PathExists(first_profile_prefs_file)); 314 CHECK(base::PathExists(first_profile_prefs_file));
315 315
316 second_profile_name_ = 316 second_profile_name_ =
317 std::string(chrome::kMultiProfileDirPrefix) 317 std::string(chrome::kMultiProfileDirPrefix)
318 .append(base::IntToString(1)); 318 .append(base::IntToString(1));
319 319
320 base::FilePath second_profile = 320 base::FilePath second_profile =
321 user_data_directory.AppendASCII(second_profile_name_); 321 user_data_directory.AppendASCII(second_profile_name_);
322 CHECK(file_util::CreateDirectory(second_profile)); 322 CHECK(base::CreateDirectory(second_profile));
323 323
324 base::FilePath second_profile_prefs_file = 324 base::FilePath second_profile_prefs_file =
325 second_profile.Append(chrome::kPreferencesFilename); 325 second_profile.Append(chrome::kPreferencesFilename);
326 CHECK(base::CopyFile(stock_prefs_file, second_profile_prefs_file)); 326 CHECK(base::CopyFile(stock_prefs_file, second_profile_prefs_file));
327 CHECK(base::PathExists(second_profile_prefs_file)); 327 CHECK(base::PathExists(second_profile_prefs_file));
328 328
329 return true; 329 return true;
330 } 330 }
331 331
332 protected: 332 protected:
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 test_server()->GetURL(std::string("files/").append("title2.html"))); 785 test_server()->GetURL(std::string("files/").append("title2.html")));
786 786
787 GatherStatistics(); 787 GatherStatistics();
788 788
789 metrics = GetStats(METRIC_NETWORK_BYTES_READ); 789 metrics = GetStats(METRIC_NETWORK_BYTES_READ);
790 ASSERT_EQ(2u, metrics.size()); 790 ASSERT_EQ(2u, metrics.size());
791 EXPECT_GE(metrics[1].value, page1_size + page2_size); 791 EXPECT_GE(metrics[1].value, page1_size + page2_size);
792 } 792 }
793 793
794 } // namespace performance_monitor 794 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/database.cc ('k') | chrome/browser/policy/cloud/resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698