| OLD | NEW |
| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 base::ScopedTempDir db_dir_; | 283 base::ScopedTempDir db_dir_; |
| 284 PerformanceMonitor* performance_monitor_; | 284 PerformanceMonitor* performance_monitor_; |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 class PerformanceMonitorUncleanExitBrowserTest | 287 class PerformanceMonitorUncleanExitBrowserTest |
| 288 : public PerformanceMonitorBrowserTest, | 288 : public PerformanceMonitorBrowserTest, |
| 289 public testing::WithParamInterface<bool> { | 289 public testing::WithParamInterface<bool> { |
| 290 public: | 290 public: |
| 291 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 291 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 292 PerformanceMonitorBrowserTest::SetUpCommandLine(command_line); | 292 PerformanceMonitorBrowserTest::SetUpCommandLine(command_line); |
| 293 if (GetParam()) | 293 #if defined(OS_CHROMEOS) |
| 294 command_line->AppendSwitch(::switches::kMultiProfiles); | 294 command_line->AppendSwitch( |
| 295 chromeos::switches::kIgnoreUserProfileMappingForTests); |
| 296 #endif |
| 295 } | 297 } |
| 296 | 298 |
| 297 virtual bool SetUpUserDataDirectory() OVERRIDE { | 299 virtual bool SetUpUserDataDirectory() OVERRIDE { |
| 298 base::FilePath user_data_directory; | 300 base::FilePath user_data_directory; |
| 299 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); | 301 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); |
| 300 | 302 |
| 301 // On CrOS, if we are "logged in" with the --login-profile switch, | 303 // On CrOS, if we are "logged in" with the --login-profile switch, |
| 302 // the default profile will be different. We check if we are logged in, and, | 304 // the default profile will be different. We check if we are logged in, and, |
| 303 // if we are, we use that profile name instead. (Note: trybots will | 305 // if we are, we use that profile name instead. (Note: trybots will |
| 304 // typically be logged in with 'user'.) | 306 // typically be logged in with 'user'.) |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 metrics = GetStats(METRIC_NETWORK_BYTES_READ); | 831 metrics = GetStats(METRIC_NETWORK_BYTES_READ); |
| 830 ASSERT_EQ(2u, metrics.size()); | 832 ASSERT_EQ(2u, metrics.size()); |
| 831 EXPECT_GE(metrics[1].value, page1_size + page2_size); | 833 EXPECT_GE(metrics[1].value, page1_size + page2_size); |
| 832 } | 834 } |
| 833 | 835 |
| 834 INSTANTIATE_TEST_CASE_P(PerformanceMonitorUncleanExitBrowserTestInstantiation, | 836 INSTANTIATE_TEST_CASE_P(PerformanceMonitorUncleanExitBrowserTestInstantiation, |
| 835 PerformanceMonitorUncleanExitBrowserTest, | 837 PerformanceMonitorUncleanExitBrowserTest, |
| 836 testing::Bool()); | 838 testing::Bool()); |
| 837 | 839 |
| 838 } // namespace performance_monitor | 840 } // namespace performance_monitor |
| OLD | NEW |