OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TEST_TEST_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TEST_TEST_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/extensions/extension_function.h" | 10 #include "chrome/browser/extensions/extension_function.h" |
11 | 11 |
12 template <typename T> struct DefaultSingletonTraits; | 12 template <typename T> struct DefaultSingletonTraits; |
13 | 13 |
14 namespace extensions { | |
15 | |
14 // A function that is only available in tests. | 16 // A function that is only available in tests. |
15 // Prior to running, checks that we are in an extension process. | 17 // Prior to running, checks that we are in an extension process. |
16 class TestExtensionFunction : public SyncExtensionFunction { | 18 class TestExtensionFunction : public SyncExtensionFunction { |
17 protected: | 19 protected: |
18 virtual ~TestExtensionFunction(); | 20 virtual ~TestExtensionFunction(); |
19 | 21 |
20 // ExtensionFunction: | 22 // ExtensionFunction: |
21 virtual void Run() OVERRIDE; | 23 virtual void Run() OVERRIDE; |
22 }; | 24 }; |
23 | 25 |
24 class ExtensionTestPassFunction : public TestExtensionFunction { | 26 class ExtensionTestPassFunction : public TestExtensionFunction { |
Yoyo Zhou
2012/07/10 19:00:11
Now that these are in the namespace, you don't nee
vabr (Chromium)
2012/07/11 10:01:25
Done.
| |
25 public: | 27 public: |
26 DECLARE_EXTENSION_FUNCTION_NAME("test.notifyPass") | 28 DECLARE_EXTENSION_FUNCTION_NAME("test.notifyPass") |
27 | 29 |
28 protected: | 30 protected: |
29 virtual ~ExtensionTestPassFunction(); | 31 virtual ~ExtensionTestPassFunction(); |
30 | 32 |
31 // ExtensionFunction: | 33 // ExtensionFunction: |
32 virtual bool RunImpl() OVERRIDE; | 34 virtual bool RunImpl() OVERRIDE; |
33 }; | 35 }; |
34 | 36 |
(...skipping 12 matching lines...) Expand all Loading... | |
47 public: | 49 public: |
48 DECLARE_EXTENSION_FUNCTION_NAME("test.log") | 50 DECLARE_EXTENSION_FUNCTION_NAME("test.log") |
49 | 51 |
50 protected: | 52 protected: |
51 virtual ~ExtensionTestLogFunction(); | 53 virtual ~ExtensionTestLogFunction(); |
52 | 54 |
53 // ExtensionFunction: | 55 // ExtensionFunction: |
54 virtual bool RunImpl() OVERRIDE; | 56 virtual bool RunImpl() OVERRIDE; |
55 }; | 57 }; |
56 | 58 |
57 class ExtensionTestQuotaResetFunction : public TestExtensionFunction { | 59 class ExtensionTestQuotaResetFunction : public TestExtensionFunction { |
Yoyo Zhou
2012/07/10 19:00:11
This one seems like it should be called TestResetQ
vabr (Chromium)
2012/07/11 10:01:25
Done.
| |
58 public: | 60 public: |
59 DECLARE_EXTENSION_FUNCTION_NAME("test.resetQuota") | 61 DECLARE_EXTENSION_FUNCTION_NAME("test.resetQuota") |
60 | 62 |
61 protected: | 63 protected: |
62 virtual ~ExtensionTestQuotaResetFunction(); | 64 virtual ~ExtensionTestQuotaResetFunction(); |
63 | 65 |
64 // ExtensionFunction: | 66 // ExtensionFunction: |
65 virtual bool RunImpl() OVERRIDE; | 67 virtual bool RunImpl() OVERRIDE; |
66 }; | 68 }; |
67 | 69 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 | 126 |
125 DISALLOW_COPY_AND_ASSIGN(TestConfigState); | 127 DISALLOW_COPY_AND_ASSIGN(TestConfigState); |
126 }; | 128 }; |
127 | 129 |
128 virtual ~ExtensionTestGetConfigFunction(); | 130 virtual ~ExtensionTestGetConfigFunction(); |
129 | 131 |
130 // ExtensionFunction: | 132 // ExtensionFunction: |
131 virtual bool RunImpl() OVERRIDE; | 133 virtual bool RunImpl() OVERRIDE; |
132 }; | 134 }; |
133 | 135 |
134 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_API_H_ | 136 } // namespace extensions |
Yoyo Zhou
2012/07/10 19:00:11
nit: two spaces before the //
vabr (Chromium)
2012/07/11 10:01:25
Done.
| |
137 | |
138 #endif // CHROME_BROWSER_EXTENSIONS_API_TEST_TEST_API_H_ | |
OLD | NEW |