| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Destruct() const OVERRIDE { delete this; } | 69 virtual void Destruct() const OVERRIDE { delete this; } |
| 70 virtual bool RunImpl() OVERRIDE { return true; } | 70 virtual ResponseAction Run() OVERRIDE { return RespondLater(); } |
| 71 virtual void SendResponse(bool) OVERRIDE {} | 71 virtual void SendResponse(bool) OVERRIDE {} |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 virtual ~MockFunction() {} | 74 virtual ~MockFunction() {} |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 class TimedLimitMockFunction : public MockFunction { | 77 class TimedLimitMockFunction : public MockFunction { |
| 78 public: | 78 public: |
| 79 explicit TimedLimitMockFunction(const std::string& name) | 79 explicit TimedLimitMockFunction(const std::string& name) |
| 80 : MockFunction(name) {} | 80 : MockFunction(name) {} |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 "", | 407 "", |
| 408 service_->Assess( | 408 service_->Assess( |
| 409 extension_a_, f.get(), &arg, kStartTime + TimeDelta::FromDays(1))); | 409 extension_a_, f.get(), &arg, kStartTime + TimeDelta::FromDays(1))); |
| 410 EXPECT_NE( | 410 EXPECT_NE( |
| 411 "", | 411 "", |
| 412 service_->Assess( | 412 service_->Assess( |
| 413 extension_a_, g.get(), &arg, kStartTime + TimeDelta::FromDays(1))); | 413 extension_a_, g.get(), &arg, kStartTime + TimeDelta::FromDays(1))); |
| 414 } | 414 } |
| 415 | 415 |
| 416 } // namespace extensions | 416 } // namespace extensions |
| OLD | NEW |