OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/data_usage/external_data_use_observer.h" | 5 #include "chrome/browser/android/data_usage/external_data_use_observer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 namespace chrome { | 52 namespace chrome { |
53 | 53 |
54 namespace android { | 54 namespace android { |
55 | 55 |
56 class ExternalDataUseObserverTest : public testing::Test { | 56 class ExternalDataUseObserverTest : public testing::Test { |
57 public: | 57 public: |
58 void SetUp() override { | 58 void SetUp() override { |
59 thread_bundle_.reset(new content::TestBrowserThreadBundle( | 59 thread_bundle_.reset(new content::TestBrowserThreadBundle( |
60 content::TestBrowserThreadBundle::IO_MAINLOOP)); | 60 content::TestBrowserThreadBundle::IO_MAINLOOP)); |
61 io_task_runner_ = content::BrowserThread::GetMessageLoopProxyForThread( | 61 io_task_runner_ = content::BrowserThread::GetTaskRunnerForThread( |
62 content::BrowserThread::IO); | 62 content::BrowserThread::IO); |
63 ui_task_runner_ = content::BrowserThread::GetMessageLoopProxyForThread( | 63 ui_task_runner_ = content::BrowserThread::GetTaskRunnerForThread( |
64 content::BrowserThread::UI); | 64 content::BrowserThread::UI); |
65 data_use_aggregator_.reset( | 65 data_use_aggregator_.reset( |
66 new data_usage::DataUseAggregator(nullptr, nullptr)); | 66 new data_usage::DataUseAggregator(nullptr, nullptr)); |
67 external_data_use_observer_.reset(new ExternalDataUseObserver( | 67 external_data_use_observer_.reset(new ExternalDataUseObserver( |
68 data_use_aggregator_.get(), io_task_runner_.get(), | 68 data_use_aggregator_.get(), io_task_runner_.get(), |
69 ui_task_runner_.get())); | 69 ui_task_runner_.get())); |
70 // Wait for |external_data_use_observer_| to create the Java object. | 70 // Wait for |external_data_use_observer_| to create the Java object. |
71 base::RunLoop().RunUntilIdle(); | 71 base::RunLoop().RunUntilIdle(); |
72 external_data_use_observer() | 72 external_data_use_observer() |
73 ->data_use_tab_model_->is_control_app_installed_ = true; | 73 ->data_use_tab_model_->is_control_app_installed_ = true; |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 ExternalDataUseObserver::DATAUSAGE_REPORT_SUBMISSION_TIMED_OUT, 1); | 645 ExternalDataUseObserver::DATAUSAGE_REPORT_SUBMISSION_TIMED_OUT, 1); |
646 histogram_tester.ExpectUniqueSample( | 646 histogram_tester.ExpectUniqueSample( |
647 "DataUsage.ReportSubmission.Bytes.TimedOut", | 647 "DataUsage.ReportSubmission.Bytes.TimedOut", |
648 default_upload_bytes() + default_download_bytes(), 1); | 648 default_upload_bytes() + default_download_bytes(), 1); |
649 histogram_tester.ExpectTotalCount(kUMAReportSubmissionDurationHistogram, 0); | 649 histogram_tester.ExpectTotalCount(kUMAReportSubmissionDurationHistogram, 0); |
650 } | 650 } |
651 | 651 |
652 } // namespace android | 652 } // namespace android |
653 | 653 |
654 } // namespace chrome | 654 } // namespace chrome |
OLD | NEW |