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 #include "chrome/browser/extensions/extension_test_api.h" | 5 #include "chrome/browser/extensions/api/test/test_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 12 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
13 #include "chrome/browser/extensions/extensions_quota_service.h" | 13 #include "chrome/browser/extensions/extensions_quota_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser_commands.h" | 15 #include "chrome/browser/ui/browser_commands.h" |
16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 | 19 |
20 namespace extensions { | |
Yoyo Zhou
2012/07/10 19:00:11
You could also put this at 34, so the anonymous na
vabr (Chromium)
2012/07/11 10:01:25
Done.
Both occur in the api/ subdirectory, with th
| |
21 | |
20 namespace { | 22 namespace { |
21 | 23 |
22 // If you see this error in your test, you need to set the config state | 24 // If you see this error in your test, you need to set the config state |
23 // to be returned by chrome.test.getConfig(). Do this by calling | 25 // to be returned by chrome.test.getConfig(). Do this by calling |
24 // ExtensionTestGetConfigFunction::set_test_config_state(Value* state) | 26 // ExtensionTestGetConfigFunction::set_test_config_state(Value* state) |
25 // in test set up. | 27 // in test set up. |
26 const char kNoTestConfigDataError[] = "Test configuration was not set."; | 28 const char kNoTestConfigDataError[] = "Test configuration was not set."; |
27 | 29 |
28 const char kNotTestProcessError[] = | 30 const char kNotTestProcessError[] = |
29 "The chrome.test namespace is only available in tests."; | 31 "The chrome.test namespace is only available in tests."; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 TestConfigState* test_config_state = TestConfigState::GetInstance(); | 134 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
133 | 135 |
134 if (!test_config_state->config_state()) { | 136 if (!test_config_state->config_state()) { |
135 error_ = kNoTestConfigDataError; | 137 error_ = kNoTestConfigDataError; |
136 return false; | 138 return false; |
137 } | 139 } |
138 | 140 |
139 result_.reset(test_config_state->config_state()->DeepCopy()); | 141 result_.reset(test_config_state->config_state()->DeepCopy()); |
140 return true; | 142 return true; |
141 } | 143 } |
144 | |
145 } // namespace extensions | |
OLD | NEW |