| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 policy::DeviceStatusCollector::CPUStatisticsFetcher(), | 58 policy::DeviceStatusCollector::CPUStatisticsFetcher(), |
| 59 policy::DeviceStatusCollector::CPUTempFetcher()) {} | 59 policy::DeviceStatusCollector::CPUTempFetcher()) {} |
| 60 | 60 |
| 61 MOCK_METHOD1(GetDeviceStatus, bool(em::DeviceStatusReportRequest*)); | 61 MOCK_METHOD1(GetDeviceStatus, bool(em::DeviceStatusReportRequest*)); |
| 62 MOCK_METHOD1(GetDeviceSessionStatus, bool(em::SessionStatusReportRequest*)); | 62 MOCK_METHOD1(GetDeviceSessionStatus, bool(em::SessionStatusReportRequest*)); |
| 63 | 63 |
| 64 // Explicit mock implementation declared here, since gmock::Invoke can't | 64 // Explicit mock implementation declared here, since gmock::Invoke can't |
| 65 // handle returning non-moveable types like scoped_ptr. | 65 // handle returning non-moveable types like scoped_ptr. |
| 66 std::unique_ptr<policy::DeviceLocalAccount> GetAutoLaunchedKioskSessionInfo() | 66 std::unique_ptr<policy::DeviceLocalAccount> GetAutoLaunchedKioskSessionInfo() |
| 67 override { | 67 override { |
| 68 return base::WrapUnique(new policy::DeviceLocalAccount( | 68 return base::MakeUnique<policy::DeviceLocalAccount>( |
| 69 policy::DeviceLocalAccount::TYPE_KIOSK_APP, "account_id", "app_id", | 69 policy::DeviceLocalAccount::TYPE_KIOSK_APP, "account_id", "app_id", |
| 70 "update_url")); | 70 "update_url"); |
| 71 } | 71 } |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace | 74 } // namespace |
| 75 | 75 |
| 76 namespace policy { | 76 namespace policy { |
| 77 class StatusUploaderTest : public testing::Test { | 77 class StatusUploaderTest : public testing::Test { |
| 78 public: | 78 public: |
| 79 StatusUploaderTest() : task_runner_(new base::TestSimpleTaskRunner()) { | 79 StatusUploaderTest() : task_runner_(new base::TestSimpleTaskRunner()) { |
| 80 DeviceStatusCollector::RegisterPrefs(prefs_.registry()); | 80 DeviceStatusCollector::RegisterPrefs(prefs_.registry()); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // Now mock video capture, and no session data should be allowed. | 257 // Now mock video capture, and no session data should be allowed. |
| 258 MediaCaptureDevicesDispatcher::GetInstance()->OnMediaRequestStateChanged( | 258 MediaCaptureDevicesDispatcher::GetInstance()->OnMediaRequestStateChanged( |
| 259 0, 0, 0, GURL("http://www.google.com"), | 259 0, 0, 0, GURL("http://www.google.com"), |
| 260 content::MEDIA_DEVICE_VIDEO_CAPTURE, | 260 content::MEDIA_DEVICE_VIDEO_CAPTURE, |
| 261 content::MEDIA_REQUEST_STATE_OPENING); | 261 content::MEDIA_REQUEST_STATE_OPENING); |
| 262 base::RunLoop().RunUntilIdle(); | 262 base::RunLoop().RunUntilIdle(); |
| 263 EXPECT_FALSE(uploader.IsSessionDataUploadAllowed()); | 263 EXPECT_FALSE(uploader.IsSessionDataUploadAllowed()); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace policy | 266 } // namespace policy |
| OLD | NEW |