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 std::string GetError() const override { return std::string(); } | |
70 void SetError(const std::string& error) override {} | 69 void SetError(const std::string& error) override {} |
71 void Destruct() const override { delete this; } | 70 void Destruct() const override { delete this; } |
72 ResponseAction Run() override { return RespondLater(); } | 71 ResponseAction Run() override { return RespondLater(); } |
73 | 72 |
74 protected: | 73 protected: |
75 ~MockFunction() override {} | 74 ~MockFunction() override {} |
76 }; | 75 }; |
77 | 76 |
78 class TimedLimitMockFunction : public MockFunction { | 77 class TimedLimitMockFunction : public MockFunction { |
79 public: | 78 public: |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 EXPECT_NE("", service_->Assess(extension_a_, f.get(), &arg, | 323 EXPECT_NE("", service_->Assess(extension_a_, f.get(), &arg, |
325 kStartTime + TimeDelta::FromDays(1) + | 324 kStartTime + TimeDelta::FromDays(1) + |
326 TimeDelta::FromSeconds(25))); | 325 TimeDelta::FromSeconds(25))); |
327 | 326 |
328 // Like now. | 327 // Like now. |
329 EXPECT_EQ("", service_->Assess(extension_a_, f.get(), &arg, | 328 EXPECT_EQ("", service_->Assess(extension_a_, f.get(), &arg, |
330 kStartTime + TimeDelta::FromDays(2))); | 329 kStartTime + TimeDelta::FromDays(2))); |
331 } | 330 } |
332 | 331 |
333 } // namespace extensions | 332 } // namespace extensions |
OLD | NEW |