Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: chrome/browser/net/connect_interceptor_unittest.cc

Issue 9088015: Fix Sleep() calls to use TimeDelta in portions of chrome/browser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/net/connect_interceptor.h" 5 #include "chrome/browser/net/connect_interceptor.h"
6 6
7 #include "base/threading/platform_thread.h" 7 #include "base/threading/platform_thread.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace chrome_browser_net { 10 namespace chrome_browser_net {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 TEST(ConnectInterceptorTest, TimedCacheEviction) { 58 TEST(ConnectInterceptorTest, TimedCacheEviction) {
59 // Creat a cache that has a short expiration so that we can force evictions. 59 // Creat a cache that has a short expiration so that we can force evictions.
60 ConnectInterceptor::TimedCache cache(base::TimeDelta::FromMilliseconds(1)); 60 ConnectInterceptor::TimedCache cache(base::TimeDelta::FromMilliseconds(1));
61 61
62 GURL url("http://google.com/anypath"); 62 GURL url("http://google.com/anypath");
63 EXPECT_FALSE(cache.WasRecentlySeen(url)); 63 EXPECT_FALSE(cache.WasRecentlySeen(url));
64 64
65 cache.SetRecentlySeen(url); 65 cache.SetRecentlySeen(url);
66 66
67 // Sleep at least long enough to cause an eviction. 67 // Sleep at least long enough to cause an eviction.
68 base::PlatformThread::Sleep(30); 68 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(30));
69 69
70 EXPECT_FALSE(cache.WasRecentlySeen(url)); 70 EXPECT_FALSE(cache.WasRecentlySeen(url));
71 } 71 }
72 72
73 } // namespace chrome_browser_net. 73 } // namespace chrome_browser_net.
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service_uitest.cc ('k') | chrome/browser/net/url_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698