summaryrefslogtreecommitdiff
path: root/chromium/base/enterprise_util_mac_unittest.mm
blob: 8b89b5a705590fe45b9ebcb585f6d39e37b7caf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/enterprise_util.h"

#include "testing/gtest/include/gtest/gtest.h"

namespace base {

TEST(EnterpriseUtilMacTest, IsDeviceRegisteredWithManagementOldSmokeTest) {
  MacDeviceManagementStateOld state = IsDeviceRegisteredWithManagementOld();

  EXPECT_NE(MacDeviceManagementStateOld::kFailureAPIUnavailable, state);
  EXPECT_NE(MacDeviceManagementStateOld::kFailureUnableToParseResult, state);
}

TEST(EnterpriseUtilMacTest, IsDeviceRegisteredWithManagementNewSmokeTest) {
  MacDeviceManagementStateNew state = IsDeviceRegisteredWithManagementNew();

  if (@available(macOS 10.13.4, *)) {
    EXPECT_NE(MacDeviceManagementStateNew::kFailureAPIUnavailable, state);
    EXPECT_NE(MacDeviceManagementStateNew::kFailureUnableToParseResult, state);
  } else {
    EXPECT_EQ(MacDeviceManagementStateNew::kFailureAPIUnavailable, state);
  }
}

}  // namespace base