diff options
author | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 19:26:39 +0000 |
---|---|---|
committer | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 19:26:39 +0000 |
commit | 761e7160090e0643dc265067e7f833aeedbf9e21 (patch) | |
tree | e5d7a5e59ea246e5d4f84112666dd40efe21fce2 /chrome/browser/extensions/extension_test_api.h | |
parent | 9288808841602769a316568cb6d14ed6b6d988dc (diff) | |
download | chromium_src-761e7160090e0643dc265067e7f833aeedbf9e21.zip chromium_src-761e7160090e0643dc265067e7f833aeedbf9e21.tar.gz chromium_src-761e7160090e0643dc265067e7f833aeedbf9e21.tar.bz2 |
Pass test server port to javascript part of extensions API tests.
BUG=56715
TEST=ExtensionApiTests.(I18N|History|Clipboard,TabConnect)
Review URL: http://codereview.chromium.org/3728004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_test_api.h')
-rw-r--r-- | chrome/browser/extensions/extension_test_api.h | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_test_api.h b/chrome/browser/extensions/extension_test_api.h index e0b8dce..27b55dc 100644 --- a/chrome/browser/extensions/extension_test_api.h +++ b/chrome/browser/extensions/extension_test_api.h @@ -6,34 +6,36 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_API_H_ #pragma once +#include "base/singleton.h" +#include "base/values.h" #include "chrome/browser/extensions/extension_function.h" class ExtensionTestPassFunction : public SyncExtensionFunction { - ~ExtensionTestPassFunction() {} + ~ExtensionTestPassFunction(); virtual bool RunImpl(); DECLARE_EXTENSION_FUNCTION_NAME("test.notifyPass") }; class ExtensionTestFailFunction : public SyncExtensionFunction { - ~ExtensionTestFailFunction() {} + ~ExtensionTestFailFunction(); virtual bool RunImpl(); DECLARE_EXTENSION_FUNCTION_NAME("test.notifyFail") }; class ExtensionTestLogFunction : public SyncExtensionFunction { - ~ExtensionTestLogFunction() {} + ~ExtensionTestLogFunction(); virtual bool RunImpl(); DECLARE_EXTENSION_FUNCTION_NAME("test.log") }; class ExtensionTestQuotaResetFunction : public SyncExtensionFunction { - ~ExtensionTestQuotaResetFunction() {} + ~ExtensionTestQuotaResetFunction(); virtual bool RunImpl(); DECLARE_EXTENSION_FUNCTION_NAME("test.resetQuota") }; class ExtensionTestCreateIncognitoTabFunction : public SyncExtensionFunction { - ~ExtensionTestCreateIncognitoTabFunction() {} + ~ExtensionTestCreateIncognitoTabFunction(); virtual bool RunImpl(); DECLARE_EXTENSION_FUNCTION_NAME("test.createIncognitoTab") }; @@ -45,9 +47,40 @@ class ExtensionTestSendMessageFunction : public AsyncExtensionFunction { void Reply(const std::string& message); private: - ~ExtensionTestSendMessageFunction() {} + ~ExtensionTestSendMessageFunction(); virtual bool RunImpl(); DECLARE_EXTENSION_FUNCTION_NAME("test.sendMessage") }; +class ExtensionTestGetConfigFunction : public SyncExtensionFunction { + public: + // Set the dictionary returned by chrome.test.getConfig(). + // Does not take ownership of |value|. + static void set_test_config_state(DictionaryValue* value); + + private: + // Tests that set configuration state do so by calling + // set_test_config_state() as part of test set up, and unsetting it + // during tear down. This singleton class holds a pointer to that + // state, owned by the test code. + class TestConfigState { + public: + void set_config_state(DictionaryValue* config_state) { + config_state_ = config_state; + } + const DictionaryValue* config_state() { + return config_state_; + } + private: + friend struct DefaultSingletonTraits<TestConfigState>; + TestConfigState(); + DictionaryValue* config_state_; + DISALLOW_COPY_AND_ASSIGN(TestConfigState); + }; + + ~ExtensionTestGetConfigFunction(); + virtual bool RunImpl(); + DECLARE_EXTENSION_FUNCTION_NAME("test.getConfig") +}; + #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_API_H_ |