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

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

Issue 13671005: Re-apply 192420: Move login switches to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/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 24 matching lines...) Expand all
35 #include "chrome/common/extensions/extension.h" 35 #include "chrome/common/extensions/extension.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "chrome/test/base/ui_test_utils.h" 37 #include "chrome/test/base/ui_test_utils.h"
38 #include "content/public/browser/notification_registrar.h" 38 #include "content/public/browser/notification_registrar.h"
39 #include "content/public/browser/notification_service.h" 39 #include "content/public/browser/notification_service.h"
40 #include "content/public/common/page_transition_types.h" 40 #include "content/public/common/page_transition_types.h"
41 #include "content/public/test/browser_test_utils.h" 41 #include "content/public/test/browser_test_utils.h"
42 #include "content/public/test/test_navigation_observer.h" 42 #include "content/public/test/test_navigation_observer.h"
43 #include "content/public/test/test_utils.h" 43 #include "content/public/test/test_utils.h"
44 44
45 #if defined(OS_CHROMEOS)
46 #include "chromeos/chromeos_switches.h"
47 #endif
48
45 #if defined(OS_MACOSX) 49 #if defined(OS_MACOSX)
46 #include "base/mac/scoped_nsautorelease_pool.h" 50 #include "base/mac/scoped_nsautorelease_pool.h"
47 #endif 51 #endif
48 52
49 using extensions::Extension; 53 using extensions::Extension;
50 54
51 namespace performance_monitor { 55 namespace performance_monitor {
52 56
53 namespace { 57 namespace {
54 58
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 virtual bool SetUpUserDataDirectory() OVERRIDE { 282 virtual bool SetUpUserDataDirectory() OVERRIDE {
279 base::FilePath user_data_directory; 283 base::FilePath user_data_directory;
280 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); 284 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory);
281 285
282 // On CrOS, if we are "logged in" with the --login-profile switch, 286 // On CrOS, if we are "logged in" with the --login-profile switch,
283 // the default profile will be different. We check if we are logged in, and, 287 // the default profile will be different. We check if we are logged in, and,
284 // if we are, we use that profile name instead. (Note: trybots will 288 // if we are, we use that profile name instead. (Note: trybots will
285 // typically be logged in with 'user'.) 289 // typically be logged in with 'user'.)
286 #if defined(OS_CHROMEOS) 290 #if defined(OS_CHROMEOS)
287 const CommandLine command_line = *CommandLine::ForCurrentProcess(); 291 const CommandLine command_line = *CommandLine::ForCurrentProcess();
288 if (command_line.HasSwitch(switches::kLoginProfile)) { 292 if (command_line.HasSwitch(chromeos::switches::kLoginProfile)) {
289 first_profile_name_ = 293 first_profile_name_ =
290 command_line.GetSwitchValueASCII(switches::kLoginProfile); 294 command_line.GetSwitchValueASCII(chromeos::switches::kLoginProfile);
291 } else { 295 } else {
292 first_profile_name_ = chrome::kInitialProfile; 296 first_profile_name_ = chrome::kInitialProfile;
293 } 297 }
294 #else 298 #else
295 first_profile_name_ = chrome::kInitialProfile; 299 first_profile_name_ = chrome::kInitialProfile;
296 #endif 300 #endif
297 301
298 base::FilePath first_profile = 302 base::FilePath first_profile =
299 user_data_directory.AppendASCII(first_profile_name_); 303 user_data_directory.AppendASCII(first_profile_name_);
300 CHECK(file_util::CreateDirectory(first_profile)); 304 CHECK(file_util::CreateDirectory(first_profile));
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 test_server()->GetURL(std::string("files/").append("title2.html"))); 790 test_server()->GetURL(std::string("files/").append("title2.html")));
787 791
788 performance_monitor()->DoTimedCollections(); 792 performance_monitor()->DoTimedCollections();
789 793
790 metrics = GetStats(METRIC_NETWORK_BYTES_READ); 794 metrics = GetStats(METRIC_NETWORK_BYTES_READ);
791 ASSERT_EQ(2u, metrics.size()); 795 ASSERT_EQ(2u, metrics.size());
792 EXPECT_GE(metrics[1].value, page1_size + page2_size); 796 EXPECT_GE(metrics[1].value, page1_size + page2_size);
793 } 797 }
794 798
795 } // namespace performance_monitor 799 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_system.cc ('k') | chrome/browser/policy/browser_policy_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698