| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "content/browser/tracing/tracing_controller_impl.h" | 7 #include "content/browser/tracing/tracing_controller_impl.h" |
| 8 #include "content/public/test/browser_test_utils.h" | 8 #include "content/public/test/browser_test_utils.h" |
| 9 #include "content/public/test/content_browser_test.h" | 9 #include "content/public/test/content_browser_test.h" |
| 10 #include "content/public/test/content_browser_test_utils.h" | 10 #include "content/public/test/content_browser_test_utils.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 | 286 |
| 287 IN_PROC_BROWSER_TEST_F(TracingControllerTest, | 287 IN_PROC_BROWSER_TEST_F(TracingControllerTest, |
| 288 EnableCaptureAndDisableMonitoringWithFilePath) { | 288 EnableCaptureAndDisableMonitoringWithFilePath) { |
| 289 base::FilePath file_path; | 289 base::FilePath file_path; |
| 290 base::CreateTemporaryFile(&file_path); | 290 base::CreateTemporaryFile(&file_path); |
| 291 TestEnableCaptureAndDisableMonitoring(file_path); | 291 TestEnableCaptureAndDisableMonitoring(file_path); |
| 292 EXPECT_EQ(file_path.value(), last_actual_monitoring_file_path().value()); | 292 EXPECT_EQ(file_path.value(), last_actual_monitoring_file_path().value()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 // See http://crbug.com/392446 |
| 296 #if defined(OS_ANDROID) |
| 297 #define MAYBE_EnableCaptureAndDisableMonitoringWithEmptyFileAndNullCallback \ |
| 298 DISABLED_EnableCaptureAndDisableMonitoringWithEmptyFileAndNullCallback |
| 299 #else |
| 300 #define MAYBE_EnableCaptureAndDisableMonitoringWithEmptyFileAndNullCallback \ |
| 301 EnableCaptureAndDisableMonitoringWithEmptyFileAndNullCallback |
| 302 #endif |
| 295 IN_PROC_BROWSER_TEST_F( | 303 IN_PROC_BROWSER_TEST_F( |
| 296 TracingControllerTest, | 304 TracingControllerTest, |
| 297 EnableCaptureAndDisableMonitoringWithEmptyFileAndNullCallback) { | 305 MAYBE_EnableCaptureAndDisableMonitoringWithEmptyFileAndNullCallback) { |
| 298 Navigate(shell()); | 306 Navigate(shell()); |
| 299 | 307 |
| 300 TracingController* controller = TracingController::GetInstance(); | 308 TracingController* controller = TracingController::GetInstance(); |
| 301 EXPECT_TRUE(controller->EnableMonitoring( | 309 EXPECT_TRUE(controller->EnableMonitoring( |
| 302 "*", TracingController::ENABLE_SAMPLING, | 310 "*", TracingController::ENABLE_SAMPLING, |
| 303 TracingController::EnableMonitoringDoneCallback())); | 311 TracingController::EnableMonitoringDoneCallback())); |
| 304 controller->CaptureMonitoringSnapshot( | 312 controller->CaptureMonitoringSnapshot( |
| 305 base::FilePath(), TracingController::TracingFileResultCallback()); | 313 base::FilePath(), TracingController::TracingFileResultCallback()); |
| 306 base::RunLoop().RunUntilIdle(); | 314 base::RunLoop().RunUntilIdle(); |
| 307 EXPECT_TRUE(controller->DisableMonitoring( | 315 EXPECT_TRUE(controller->DisableMonitoring( |
| 308 TracingController::DisableMonitoringDoneCallback())); | 316 TracingController::DisableMonitoringDoneCallback())); |
| 309 base::RunLoop().RunUntilIdle(); | 317 base::RunLoop().RunUntilIdle(); |
| 310 } | 318 } |
| 311 | 319 |
| 312 } // namespace content | 320 } // namespace content |
| OLD | NEW |