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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/process/process.h" | 6 #include "base/process/process.h" |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "content/public/test/test_browser_thread.h" | 9 #include "content/public/test/test_browser_thread.h" |
10 #include "extensions/browser/extension_function.h" | 10 #include "extensions/browser/extension_function.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 BucketList* buckets) OVERRIDE {} | 59 BucketList* buckets) OVERRIDE {} |
60 }; | 60 }; |
61 | 61 |
62 class MockFunction : public ExtensionFunction { | 62 class MockFunction : public ExtensionFunction { |
63 public: | 63 public: |
64 explicit MockFunction(const std::string& name) { set_name(name); } | 64 explicit MockFunction(const std::string& name) { set_name(name); } |
65 | 65 |
66 virtual void SetArgs(const base::ListValue* args) OVERRIDE {} | 66 virtual void SetArgs(const base::ListValue* args) OVERRIDE {} |
67 virtual std::string GetError() const OVERRIDE { return std::string(); } | 67 virtual std::string GetError() const OVERRIDE { return std::string(); } |
68 virtual void SetError(const std::string& error) OVERRIDE {} | 68 virtual void SetError(const std::string& error) OVERRIDE {} |
69 virtual void Run() OVERRIDE {} | |
70 virtual void Destruct() const OVERRIDE { delete this; } | 69 virtual void Destruct() const OVERRIDE { delete this; } |
71 virtual bool RunImpl() OVERRIDE { return true; } | 70 virtual bool RunImpl() OVERRIDE { return true; } |
72 virtual void SendResponse(bool) OVERRIDE {} | 71 virtual void SendResponse(bool) OVERRIDE {} |
73 | 72 |
74 protected: | 73 protected: |
75 virtual ~MockFunction() {} | 74 virtual ~MockFunction() {} |
76 }; | 75 }; |
77 | 76 |
78 class TimedLimitMockFunction : public MockFunction { | 77 class TimedLimitMockFunction : public MockFunction { |
79 public: | 78 public: |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 "", | 407 "", |
409 service_->Assess( | 408 service_->Assess( |
410 extension_a_, f.get(), &arg, kStartTime + TimeDelta::FromDays(1))); | 409 extension_a_, f.get(), &arg, kStartTime + TimeDelta::FromDays(1))); |
411 EXPECT_NE( | 410 EXPECT_NE( |
412 "", | 411 "", |
413 service_->Assess( | 412 service_->Assess( |
414 extension_a_, g.get(), &arg, kStartTime + TimeDelta::FromDays(1))); | 413 extension_a_, g.get(), &arg, kStartTime + TimeDelta::FromDays(1))); |
415 } | 414 } |
416 | 415 |
417 } // namespace extensions | 416 } // namespace extensions |
OLD | NEW |