OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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/file_path.h" |
| 6 #include "base/path_service.h" |
| 7 #include "chrome/browser/fragmentation_checker_win.h" |
| 8 #include "chrome/common/guid.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 TEST(FragmentationChecker, BasicCheck) { |
| 12 FilePath module_path; |
| 13 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &module_path)); |
| 14 int extent_count = fragmentation_checker::CountFileExtents(module_path); |
| 15 EXPECT_GT(extent_count, 0); |
| 16 } |
| 17 |
| 18 TEST(FragmentationChecker, InvalidFile) { |
| 19 FilePath module_path; |
| 20 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &module_path)); |
| 21 module_path = module_path.DirName().AppendASCII(guid::GenerateGUID()); |
| 22 int extent_count = fragmentation_checker::CountFileExtents(module_path); |
| 23 EXPECT_EQ(extent_count, 0); |
| 24 } |
OLD | NEW |