| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/policy/status_uploader.h" | 5 #include "chrome/browser/chromeos/policy/status_uploader.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 namespace { | 48 namespace { |
| 49 | 49 |
| 50 class MockDeviceStatusCollector : public policy::DeviceStatusCollector { | 50 class MockDeviceStatusCollector : public policy::DeviceStatusCollector { |
| 51 public: | 51 public: |
| 52 explicit MockDeviceStatusCollector(PrefService* local_state) | 52 explicit MockDeviceStatusCollector(PrefService* local_state) |
| 53 : DeviceStatusCollector( | 53 : DeviceStatusCollector( |
| 54 local_state, | 54 local_state, |
| 55 nullptr, | 55 nullptr, |
| 56 policy::DeviceStatusCollector::VolumeInfoFetcher(), | 56 policy::DeviceStatusCollector::VolumeInfoFetcher(), |
| 57 policy::DeviceStatusCollector::CPUStatisticsFetcher(), | 57 policy::DeviceStatusCollector::CPUStatisticsFetcher(), |
| 58 policy::DeviceStatusCollector::CPUTempFetcher()) {} | 58 policy::DeviceStatusCollector::CPUTempFetcher(), |
| 59 policy::DeviceStatusCollector::AndroidStatusFetcher()) {} |
| 59 | 60 |
| 60 MOCK_METHOD1(GetDeviceAndSessionStatusAsync, | 61 MOCK_METHOD1(GetDeviceAndSessionStatusAsync, |
| 61 void(const policy::DeviceStatusCollector::StatusCallback&)); | 62 void(const policy::DeviceStatusCollector::StatusCallback&)); |
| 62 | 63 |
| 63 // Explicit mock implementation declared here, since gmock::Invoke can't | 64 // Explicit mock implementation declared here, since gmock::Invoke can't |
| 64 // handle returning non-moveable types like scoped_ptr. | 65 // handle returning non-moveable types like scoped_ptr. |
| 65 std::unique_ptr<policy::DeviceLocalAccount> GetAutoLaunchedKioskSessionInfo() | 66 std::unique_ptr<policy::DeviceLocalAccount> GetAutoLaunchedKioskSessionInfo() |
| 66 override { | 67 override { |
| 67 return base::MakeUnique<policy::DeviceLocalAccount>( | 68 return base::MakeUnique<policy::DeviceLocalAccount>( |
| 68 policy::DeviceLocalAccount::TYPE_KIOSK_APP, "account_id", "app_id", | 69 policy::DeviceLocalAccount::TYPE_KIOSK_APP, "account_id", "app_id", |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // Now mock video capture, and no session data should be allowed. | 272 // Now mock video capture, and no session data should be allowed. |
| 272 MediaCaptureDevicesDispatcher::GetInstance()->OnMediaRequestStateChanged( | 273 MediaCaptureDevicesDispatcher::GetInstance()->OnMediaRequestStateChanged( |
| 273 0, 0, 0, GURL("http://www.google.com"), | 274 0, 0, 0, GURL("http://www.google.com"), |
| 274 content::MEDIA_DEVICE_VIDEO_CAPTURE, | 275 content::MEDIA_DEVICE_VIDEO_CAPTURE, |
| 275 content::MEDIA_REQUEST_STATE_OPENING); | 276 content::MEDIA_REQUEST_STATE_OPENING); |
| 276 base::RunLoop().RunUntilIdle(); | 277 base::RunLoop().RunUntilIdle(); |
| 277 EXPECT_FALSE(uploader.IsSessionDataUploadAllowed()); | 278 EXPECT_FALSE(uploader.IsSessionDataUploadAllowed()); |
| 278 } | 279 } |
| 279 | 280 |
| 280 } // namespace policy | 281 } // namespace policy |
| OLD | NEW |