enterprise_util_mac_unittest.mm 1.0 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "base/enterprise_util.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. namespace base {
  7. TEST(EnterpriseUtilMacTest, IsDeviceRegisteredWithManagementOldSmokeTest) {
  8. MacDeviceManagementStateOld state = IsDeviceRegisteredWithManagementOld();
  9. EXPECT_NE(MacDeviceManagementStateOld::kFailureAPIUnavailable, state);
  10. EXPECT_NE(MacDeviceManagementStateOld::kFailureUnableToParseResult, state);
  11. }
  12. TEST(EnterpriseUtilMacTest, IsDeviceRegisteredWithManagementNewSmokeTest) {
  13. MacDeviceManagementStateNew state = IsDeviceRegisteredWithManagementNew();
  14. if (@available(macOS 10.13.4, *)) {
  15. EXPECT_NE(MacDeviceManagementStateNew::kFailureAPIUnavailable, state);
  16. EXPECT_NE(MacDeviceManagementStateNew::kFailureUnableToParseResult, state);
  17. } else {
  18. EXPECT_EQ(MacDeviceManagementStateNew::kFailureAPIUnavailable, state);
  19. }
  20. }
  21. } // namespace base