OLD | NEW |
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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 void SetUp() override { service_.reset(new QuotaService()); } | 114 void SetUp() override { service_.reset(new QuotaService()); } |
115 void TearDown() override { | 115 void TearDown() override { |
116 loop_.RunUntilIdle(); | 116 loop_.RunUntilIdle(); |
117 service_.reset(); | 117 service_.reset(); |
118 } | 118 } |
119 | 119 |
120 protected: | 120 protected: |
121 std::string extension_a_; | 121 std::string extension_a_; |
122 std::string extension_b_; | 122 std::string extension_b_; |
123 std::string extension_c_; | 123 std::string extension_c_; |
124 scoped_ptr<QuotaService> service_; | 124 std::unique_ptr<QuotaService> service_; |
125 base::MessageLoop loop_; | 125 base::MessageLoop loop_; |
126 content::TestBrowserThread ui_thread_; | 126 content::TestBrowserThread ui_thread_; |
127 }; | 127 }; |
128 | 128 |
129 class QuotaLimitHeuristicTest : public testing::Test { | 129 class QuotaLimitHeuristicTest : public testing::Test { |
130 public: | 130 public: |
131 static void DoMoreThan2PerMinuteFor5Minutes(const TimeTicks& start_time, | 131 static void DoMoreThan2PerMinuteFor5Minutes(const TimeTicks& start_time, |
132 QuotaLimitHeuristic* lim, | 132 QuotaLimitHeuristic* lim, |
133 Bucket* b, | 133 Bucket* b, |
134 int an_unexhausted_minute) { | 134 int an_unexhausted_minute) { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |