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

Side by Side Diff: extensions/browser/quota_service_unittest.cc

Issue 2236443003: extensions: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't add braces Created 4 years, 4 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
« no previous file with comments | « extensions/browser/quota_service.cc ('k') | extensions/common/extension_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/process/process.h" 9 #include "base/process/process.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 19 matching lines...) Expand all
30 30
31 const char kGenericName[] = "name"; 31 const char kGenericName[] = "name";
32 const Config kFrozenConfig = {0, TimeDelta::FromDays(0)}; 32 const Config kFrozenConfig = {0, TimeDelta::FromDays(0)};
33 const Config k2PerMinute = {2, TimeDelta::FromMinutes(1)}; 33 const Config k2PerMinute = {2, TimeDelta::FromMinutes(1)};
34 const TimeTicks kStartTime = TimeTicks(); 34 const TimeTicks kStartTime = TimeTicks();
35 const TimeTicks k1MinuteAfterStart = kStartTime + TimeDelta::FromMinutes(1); 35 const TimeTicks k1MinuteAfterStart = kStartTime + TimeDelta::FromMinutes(1);
36 36
37 class Mapper : public QuotaLimitHeuristic::BucketMapper { 37 class Mapper : public QuotaLimitHeuristic::BucketMapper {
38 public: 38 public:
39 Mapper() {} 39 Mapper() {}
40 ~Mapper() override { STLDeleteValues(&buckets_); } 40 ~Mapper() override { base::STLDeleteValues(&buckets_); }
41 void GetBucketsForArgs(const base::ListValue* args, 41 void GetBucketsForArgs(const base::ListValue* args,
42 BucketList* buckets) override { 42 BucketList* buckets) override {
43 for (size_t i = 0; i < args->GetSize(); i++) { 43 for (size_t i = 0; i < args->GetSize(); i++) {
44 int id; 44 int id;
45 ASSERT_TRUE(args->GetInteger(i, &id)); 45 ASSERT_TRUE(args->GetInteger(i, &id));
46 if (buckets_.find(id) == buckets_.end()) 46 if (buckets_.find(id) == buckets_.end())
47 buckets_[id] = new Bucket(); 47 buckets_[id] = new Bucket();
48 buckets->push_back(buckets_[id]); 48 buckets->push_back(buckets_[id]);
49 } 49 }
50 } 50 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 EXPECT_NE("", service_->Assess(extension_a_, f.get(), &arg, 325 EXPECT_NE("", service_->Assess(extension_a_, f.get(), &arg,
326 kStartTime + TimeDelta::FromDays(1) + 326 kStartTime + TimeDelta::FromDays(1) +
327 TimeDelta::FromSeconds(25))); 327 TimeDelta::FromSeconds(25)));
328 328
329 // Like now. 329 // Like now.
330 EXPECT_EQ("", service_->Assess(extension_a_, f.get(), &arg, 330 EXPECT_EQ("", service_->Assess(extension_a_, f.get(), &arg,
331 kStartTime + TimeDelta::FromDays(2))); 331 kStartTime + TimeDelta::FromDays(2)));
332 } 332 }
333 333
334 } // namespace extensions 334 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/quota_service.cc ('k') | extensions/common/extension_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698