blob: 8b89b5a705590fe45b9ebcb585f6d39e37b7caf3 [file] [log] [blame]
Avi Drissmand066bae2020-01-17 19:17:011// 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
5#include "base/enterprise_util.h"
6
7#include "testing/gtest/include/gtest/gtest.h"
8
9namespace base {
10
11TEST(EnterpriseUtilMacTest, IsDeviceRegisteredWithManagementOldSmokeTest) {
12 MacDeviceManagementStateOld state = IsDeviceRegisteredWithManagementOld();
13
14 EXPECT_NE(MacDeviceManagementStateOld::kFailureAPIUnavailable, state);
15 EXPECT_NE(MacDeviceManagementStateOld::kFailureUnableToParseResult, state);
16}
17
18TEST(EnterpriseUtilMacTest, IsDeviceRegisteredWithManagementNewSmokeTest) {
19 MacDeviceManagementStateNew state = IsDeviceRegisteredWithManagementNew();
20
21 if (@available(macOS 10.13.4, *)) {
22 EXPECT_NE(MacDeviceManagementStateNew::kFailureAPIUnavailable, state);
23 EXPECT_NE(MacDeviceManagementStateNew::kFailureUnableToParseResult, state);
24 } else {
25 EXPECT_EQ(MacDeviceManagementStateNew::kFailureAPIUnavailable, state);
26 }
27}
28
29} // namespace base