| Index: base/path_service_unittest.cc
|
| diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc
|
| index 26998de5c097ceaccf95e83f0cac54056c0a0255..7fa49a52a3a9dd3e1e73b1d644f4ab2295376574 100644
|
| --- a/base/path_service_unittest.cc
|
| +++ b/base/path_service_unittest.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 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.
|
|
|
| @@ -39,6 +39,17 @@ bool ReturnsInvalidPath(int dir_type) {
|
| }
|
| #endif
|
|
|
| +const int kSimpleProviderKey = 9999;
|
| +const FilePath::CharType kSimpleProviderPath[] = FILE_PATH_LITERAL(".");
|
| +
|
| +bool SimpleProvider(int key, FilePath* result) {
|
| + if (key == kSimpleProviderKey) {
|
| + *result = FilePath(kSimpleProviderPath);
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| } // namespace
|
|
|
| // On the Mac this winds up using some autoreleased objects, so we need to
|
| @@ -70,3 +81,12 @@ TEST_F(PathServiceTest, Get) {
|
| }
|
| #endif
|
| }
|
| +
|
| +TEST_F(PathServiceTest, RegisterUnregister) {
|
| + EXPECT_FALSE(ReturnsValidPath(kSimpleProviderKey)) << kSimpleProviderKey;
|
| + PathService::RegisterProvider(&SimpleProvider,
|
| + kSimpleProviderKey, kSimpleProviderKey+1);
|
| + EXPECT_TRUE(ReturnsValidPath(kSimpleProviderKey)) << kSimpleProviderKey;
|
| + PathService::UnregisterProvider(&SimpleProvider);
|
| + EXPECT_FALSE(ReturnsValidPath(kSimpleProviderKey)) << kSimpleProviderKey;
|
| +}
|
|
|