summaryrefslogtreecommitdiffstats
path: root/base/mac_util_unittest.cc
blob: 18b8b5ee4410dee270aff73f1154e8dd8f6de0e6 (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
// Copyright (c) 2008 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/mac_util.h"

#include <ApplicationServices/ApplicationServices.h>

#include "base/file_path.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"

typedef PlatformTest MacUtilTest;

TEST_F(MacUtilTest, TestFSRef) {
  FSRef ref;
  std::string path("/System/Library");

  ASSERT_TRUE(mac_util::FSRefFromPath(path, &ref));
  EXPECT_EQ(path, mac_util::PathFromFSRef(ref));
}

TEST_F(MacUtilTest, TestLibraryPath) {
  FilePath library_dir = mac_util::GetUserLibraryPath();
  // Make sure the string isn't empty.
  EXPECT_FALSE(library_dir.value().empty());
}