| 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/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 public: | 59 public: |
| 60 void GetBucketsForArgs(const base::ListValue* args, | 60 void GetBucketsForArgs(const base::ListValue* args, |
| 61 BucketList* buckets) override {} | 61 BucketList* buckets) override {} |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class MockFunction : public ExtensionFunction { | 64 class MockFunction : public ExtensionFunction { |
| 65 public: | 65 public: |
| 66 explicit MockFunction(const char* name) { set_name(name); } | 66 explicit MockFunction(const char* name) { set_name(name); } |
| 67 | 67 |
| 68 void SetArgs(const base::ListValue* args) override {} | 68 void SetArgs(const base::ListValue* args) override {} |
| 69 void SetError(const std::string& error) override {} | |
| 70 void Destruct() const override { delete this; } | 69 void Destruct() const override { delete this; } |
| 71 ResponseAction Run() override { return RespondLater(); } | 70 ResponseAction Run() override { return RespondLater(); } |
| 72 | 71 |
| 73 protected: | 72 protected: |
| 74 ~MockFunction() override {} | 73 ~MockFunction() override {} |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 class TimedLimitMockFunction : public MockFunction { | 76 class TimedLimitMockFunction : public MockFunction { |
| 78 public: | 77 public: |
| 79 explicit TimedLimitMockFunction(const char* name) : MockFunction(name) {} | 78 explicit TimedLimitMockFunction(const char* name) : MockFunction(name) {} |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 EXPECT_NE("", service_->Assess(extension_a_, f.get(), &arg, | 322 EXPECT_NE("", service_->Assess(extension_a_, f.get(), &arg, |
| 324 kStartTime + TimeDelta::FromDays(1) + | 323 kStartTime + TimeDelta::FromDays(1) + |
| 325 TimeDelta::FromSeconds(25))); | 324 TimeDelta::FromSeconds(25))); |
| 326 | 325 |
| 327 // Like now. | 326 // Like now. |
| 328 EXPECT_EQ("", service_->Assess(extension_a_, f.get(), &arg, | 327 EXPECT_EQ("", service_->Assess(extension_a_, f.get(), &arg, |
| 329 kStartTime + TimeDelta::FromDays(2))); | 328 kStartTime + TimeDelta::FromDays(2))); |
| 330 } | 329 } |
| 331 | 330 |
| 332 } // namespace extensions | 331 } // namespace extensions |
| OLD | NEW |