OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
6 #include "base/hash.h" | 6 #include "base/hash.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/task_runner.h" | 12 #include "base/task_runner.h" |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "base/time.h" | 14 #include "base/time/time.h" |
15 #include "net/disk_cache/simple/simple_index.h" | 15 #include "net/disk_cache/simple/simple_index.h" |
16 #include "net/disk_cache/simple/simple_index_file.h" | 16 #include "net/disk_cache/simple/simple_index_file.h" |
17 #include "net/disk_cache/simple/simple_util.h" | 17 #include "net/disk_cache/simple/simple_util.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const int64 kTestLastUsedTimeInternal = 12345; | 22 const int64 kTestLastUsedTimeInternal = 12345; |
23 const base::Time kTestLastUsedTime = | 23 const base::Time kTestLastUsedTime = |
24 base::Time::FromInternalValue(kTestLastUsedTimeInternal); | 24 base::Time::FromInternalValue(kTestLastUsedTimeInternal); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 WaitForTimeChange(); | 567 WaitForTimeChange(); |
568 EXPECT_EQ(expected_trigger, index()->write_to_disk_timer_.desired_run_time()); | 568 EXPECT_EQ(expected_trigger, index()->write_to_disk_timer_.desired_run_time()); |
569 index()->Insert("key2"); | 569 index()->Insert("key2"); |
570 index()->UpdateEntrySize("key2", 40); | 570 index()->UpdateEntrySize("key2", 40); |
571 EXPECT_TRUE(index()->write_to_disk_timer_.IsRunning()); | 571 EXPECT_TRUE(index()->write_to_disk_timer_.IsRunning()); |
572 EXPECT_LT(expected_trigger, index()->write_to_disk_timer_.desired_run_time()); | 572 EXPECT_LT(expected_trigger, index()->write_to_disk_timer_.desired_run_time()); |
573 index()->write_to_disk_timer_.Stop(); | 573 index()->write_to_disk_timer_.Stop(); |
574 } | 574 } |
575 | 575 |
576 } // namespace disk_cache | 576 } // namespace disk_cache |
OLD | NEW |