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

Side by Side Diff: chrome/browser/extensions/extensions_quota_service_unittest.cc

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 years, 1 month 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 | Annotate | Revision Log
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 "base/stl_util.h" 5 #include "base/stl_util.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "chrome/browser/extensions/extension_function.h" 7 #include "chrome/browser/extensions/extension_function.h"
8 #include "chrome/browser/extensions/extensions_quota_service.h" 8 #include "chrome/browser/extensions/extensions_quota_service.h"
9 #include "content/test/test_browser_thread.h" 9 #include "content/test/test_browser_thread.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using base::TimeDelta; 12 using base::TimeDelta;
13 using base::TimeTicks; 13 using base::TimeTicks;
14 using content::BrowserThread;
14 15
15 typedef QuotaLimitHeuristic::Bucket Bucket; 16 typedef QuotaLimitHeuristic::Bucket Bucket;
16 typedef QuotaLimitHeuristic::Config Config; 17 typedef QuotaLimitHeuristic::Config Config;
17 typedef QuotaLimitHeuristic::BucketList BucketList; 18 typedef QuotaLimitHeuristic::BucketList BucketList;
18 typedef ExtensionsQuotaService::TimedLimit TimedLimit; 19 typedef ExtensionsQuotaService::TimedLimit TimedLimit;
19 typedef ExtensionsQuotaService::SustainedLimit SustainedLimit; 20 typedef ExtensionsQuotaService::SustainedLimit SustainedLimit;
20 21
21 static const Config kFrozenConfig = { 0, TimeDelta::FromDays(0) }; 22 static const Config kFrozenConfig = { 0, TimeDelta::FromDays(0) };
22 static const Config k2PerMinute = { 2, TimeDelta::FromMinutes(1) }; 23 static const Config k2PerMinute = { 2, TimeDelta::FromMinutes(1) };
23 static const Config k20PerHour = { 20, TimeDelta::FromHours(1) }; 24 static const Config k20PerHour = { 20, TimeDelta::FromHours(1) };
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 EXPECT_FALSE(service_->Assess(extension_a_, f, &arg, 310 EXPECT_FALSE(service_->Assess(extension_a_, f, &arg,
310 kStartTime + TimeDelta::FromSeconds(15))); 311 kStartTime + TimeDelta::FromSeconds(15)));
311 312
312 // We don't allow this extension to use quota limited functions even if they 313 // We don't allow this extension to use quota limited functions even if they
313 // wait a while. 314 // wait a while.
314 EXPECT_FALSE(service_->Assess(extension_a_, f, &arg, 315 EXPECT_FALSE(service_->Assess(extension_a_, f, &arg,
315 kStartTime + TimeDelta::FromDays(1))); 316 kStartTime + TimeDelta::FromDays(1)));
316 EXPECT_FALSE(service_->Assess(extension_a_, g, &arg, 317 EXPECT_FALSE(service_->Assess(extension_a_, g, &arg,
317 kStartTime + TimeDelta::FromDays(1))); 318 kStartTime + TimeDelta::FromDays(1)));
318 } 319 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_webrequest_time_tracker.cc ('k') | chrome/browser/extensions/external_extension_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698