breadcrumb_persistent_storage_util_unittest.cc 1002 B

123456789101112131415161718192021222324
  1. // Copyright 2019 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 "components/breadcrumbs/core/breadcrumb_persistent_storage_util.h"
  5. #include "base/files/file_path.h"
  6. #include "base/files/scoped_temp_dir.h"
  7. #include "testing/gtest/include/gtest/gtest.h"
  8. #include "testing/platform_test.h"
  9. // Test fixture to test BreadcrumbPersistentStorageUtil.
  10. typedef PlatformTest BreadcrumbPersistentStorageUtilTest;
  11. // Tests that the breadcrumb storage file path is different from the temp file
  12. // path.
  13. TEST_F(BreadcrumbPersistentStorageUtilTest, UniqueTempStorage) {
  14. base::ScopedTempDir scoped_temp_directory;
  15. EXPECT_TRUE(scoped_temp_directory.CreateUniqueTempDir());
  16. const base::FilePath directory = scoped_temp_directory.GetPath();
  17. EXPECT_NE(breadcrumbs::GetBreadcrumbPersistentStorageFilePath(directory),
  18. breadcrumbs::GetBreadcrumbPersistentStorageTempFilePath(directory));
  19. }