| 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/files/file_util.h" | 5 #include "base/files/file_util.h" |
| 6 #include "base/memory/ref_counted_memory.h" | 6 #include "base/memory/ref_counted_memory.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "content/public/browser/tracing_controller.h" | 8 #include "content/public/browser/tracing_controller.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/content_browser_test.h" | 10 #include "content/public/test/content_browser_test.h" |
| 11 #include "content/public/test/content_browser_test_utils.h" | 11 #include "content/public/test/content_browser_test_utils.h" |
| 12 #include "content/shell/browser/shell.h" | 12 #include "content/shell/browser/shell.h" |
| 13 | 13 |
| 14 using base::debug::CategoryFilter; | 14 using base::debug::CategoryFilter; |
| 15 using base::debug::TraceOptions; | 15 using base::debug::TraceOptions; |
| 16 using base::debug::RECORD_CONTINUOUSLY; | 16 using base::debug::RECORD_CONTINUOUSLY; |
| 17 using base::debug::RECORD_UNTIL_FULL; | 17 using base::debug::RECORD_UNTIL_FULL; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class TracingControllerTest : public ContentBrowserTest { | 21 class TracingControllerTest : public ContentBrowserTest { |
| 22 public: | 22 public: |
| 23 TracingControllerTest() {} | 23 TracingControllerTest() {} |
| 24 | 24 |
| 25 virtual void SetUp() OVERRIDE { | 25 virtual void SetUp() override { |
| 26 get_categories_done_callback_count_ = 0; | 26 get_categories_done_callback_count_ = 0; |
| 27 enable_recording_done_callback_count_ = 0; | 27 enable_recording_done_callback_count_ = 0; |
| 28 disable_recording_done_callback_count_ = 0; | 28 disable_recording_done_callback_count_ = 0; |
| 29 enable_monitoring_done_callback_count_ = 0; | 29 enable_monitoring_done_callback_count_ = 0; |
| 30 disable_monitoring_done_callback_count_ = 0; | 30 disable_monitoring_done_callback_count_ = 0; |
| 31 capture_monitoring_snapshot_done_callback_count_ = 0; | 31 capture_monitoring_snapshot_done_callback_count_ = 0; |
| 32 ContentBrowserTest::SetUp(); | 32 ContentBrowserTest::SetUp(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 virtual void TearDown() OVERRIDE { | 35 virtual void TearDown() override { |
| 36 ContentBrowserTest::TearDown(); | 36 ContentBrowserTest::TearDown(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void Navigate(Shell* shell) { | 39 void Navigate(Shell* shell) { |
| 40 NavigateToURL(shell, GetTestUrl("", "title.html")); | 40 NavigateToURL(shell, GetTestUrl("", "title.html")); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void GetCategoriesDoneCallbackTest(base::Closure quit_callback, | 43 void GetCategoriesDoneCallbackTest(base::Closure quit_callback, |
| 44 const std::set<std::string>& categories) { | 44 const std::set<std::string>& categories) { |
| 45 get_categories_done_callback_count_++; | 45 get_categories_done_callback_count_++; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 trace_options, | 367 trace_options, |
| 368 TracingController::EnableMonitoringDoneCallback())); | 368 TracingController::EnableMonitoringDoneCallback())); |
| 369 controller->CaptureMonitoringSnapshot(NULL); | 369 controller->CaptureMonitoringSnapshot(NULL); |
| 370 base::RunLoop().RunUntilIdle(); | 370 base::RunLoop().RunUntilIdle(); |
| 371 EXPECT_TRUE(controller->DisableMonitoring( | 371 EXPECT_TRUE(controller->DisableMonitoring( |
| 372 TracingController::DisableMonitoringDoneCallback())); | 372 TracingController::DisableMonitoringDoneCallback())); |
| 373 base::RunLoop().RunUntilIdle(); | 373 base::RunLoop().RunUntilIdle(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace content | 376 } // namespace content |
| OLD | NEW |