OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ |
6 #define EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ | 6 #define EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "extensions/browser/extension_function.h" | 9 #include "extensions/browser/extension_function.h" |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 }; | 70 }; |
71 | 71 |
72 class TestSendMessageFunction : public AsyncExtensionFunction { | 72 class TestSendMessageFunction : public AsyncExtensionFunction { |
73 public: | 73 public: |
74 DECLARE_EXTENSION_FUNCTION("test.sendMessage", UNKNOWN) | 74 DECLARE_EXTENSION_FUNCTION("test.sendMessage", UNKNOWN) |
75 | 75 |
76 // Sends a reply back to the calling extension. Many extensions don't need | 76 // Sends a reply back to the calling extension. Many extensions don't need |
77 // a reply and will just ignore it. | 77 // a reply and will just ignore it. |
78 void Reply(const std::string& message); | 78 void Reply(const std::string& message); |
79 | 79 |
| 80 // Sends an error back to the calling extension. |
| 81 void ReplyWithError(const std::string& error); |
| 82 |
80 protected: | 83 protected: |
81 virtual ~TestSendMessageFunction(); | 84 virtual ~TestSendMessageFunction(); |
82 | 85 |
83 // ExtensionFunction: | 86 // ExtensionFunction: |
84 virtual bool RunAsync() OVERRIDE; | 87 virtual bool RunAsync() OVERRIDE; |
85 }; | 88 }; |
86 | 89 |
87 class TestGetConfigFunction : public TestExtensionFunction { | 90 class TestGetConfigFunction : public TestExtensionFunction { |
88 public: | 91 public: |
89 DECLARE_EXTENSION_FUNCTION("test.getConfig", UNKNOWN) | 92 DECLARE_EXTENSION_FUNCTION("test.getConfig", UNKNOWN) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 protected: | 132 protected: |
130 virtual ~TestWaitForRoundTripFunction(); | 133 virtual ~TestWaitForRoundTripFunction(); |
131 | 134 |
132 // TestExtensionFunction: | 135 // TestExtensionFunction: |
133 virtual bool RunSafe() OVERRIDE; | 136 virtual bool RunSafe() OVERRIDE; |
134 }; | 137 }; |
135 | 138 |
136 } // namespace extensions | 139 } // namespace extensions |
137 | 140 |
138 #endif // EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ | 141 #endif // EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ |
OLD | NEW |