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 = 0; |
| 15 EXPECT_TRUE(fragmentation_checker::CountFileExtents(module_path, |
| 16 &extent_count)); |
| 17 EXPECT_GT(extent_count, 0); |
| 18 } |
| 19 |
| 20 TEST(FragmentationChecker, InvalidFile) { |
| 21 FilePath module_path; |
| 22 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &module_path)); |
| 23 module_path = module_path.DirName().AppendASCII(guid::GenerateGUID()); |
| 24 int extent_count = 0; |
| 25 EXPECT_FALSE(fragmentation_checker::CountFileExtents(module_path, |
| 26 &extent_count)); |
| 27 } |
OLD | NEW |