diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 20:08:51 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 20:08:51 +0000 |
commit | 0a724b214d8c644bf65fd86a45447f6a868c05c5 (patch) | |
tree | ebdfb74c4ff93edc8ced221baf74c1f53a408965 /chrome/browser/extensions/extension_test_api.h | |
parent | 772baef77e74bc7bd50f6380dee2283839d7351a (diff) | |
download | chromium_src-0a724b214d8c644bf65fd86a45447f6a868c05c5.zip chromium_src-0a724b214d8c644bf65fd86a45447f6a868c05c5.tar.gz chromium_src-0a724b214d8c644bf65fd86a45447f6a868c05c5.tar.bz2 |
Make chrome.test functions only accessible to tests.
BUG=103867
TEST=Inspect an extension and try to call chrome.test functions; they should fail.
Review URL: http://codereview.chromium.org/9124027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116904 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 | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_test_api.h b/chrome/browser/extensions/extension_test_api.h index cdae81c..6b653a9 100644 --- a/chrome/browser/extensions/extension_test_api.h +++ b/chrome/browser/extensions/extension_test_api.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,31 +11,40 @@ template <typename T> struct DefaultSingletonTraits; -class ExtensionTestPassFunction : public SyncExtensionFunction { +// A function that is only available in tests. +// Prior to running, checks that we are in an extension process. +class TestExtensionFunction : public SyncExtensionFunction { + public: + virtual ~TestExtensionFunction(); + + virtual void Run() OVERRIDE; +}; + +class ExtensionTestPassFunction : public TestExtensionFunction { virtual ~ExtensionTestPassFunction(); virtual bool RunImpl() OVERRIDE; DECLARE_EXTENSION_FUNCTION_NAME("test.notifyPass") }; -class ExtensionTestFailFunction : public SyncExtensionFunction { +class ExtensionTestFailFunction : public TestExtensionFunction { virtual ~ExtensionTestFailFunction(); virtual bool RunImpl() OVERRIDE; DECLARE_EXTENSION_FUNCTION_NAME("test.notifyFail") }; -class ExtensionTestLogFunction : public SyncExtensionFunction { +class ExtensionTestLogFunction : public TestExtensionFunction { virtual ~ExtensionTestLogFunction(); virtual bool RunImpl() OVERRIDE; DECLARE_EXTENSION_FUNCTION_NAME("test.log") }; -class ExtensionTestQuotaResetFunction : public SyncExtensionFunction { +class ExtensionTestQuotaResetFunction : public TestExtensionFunction { virtual ~ExtensionTestQuotaResetFunction(); virtual bool RunImpl() OVERRIDE; DECLARE_EXTENSION_FUNCTION_NAME("test.resetQuota") }; -class ExtensionTestCreateIncognitoTabFunction : public SyncExtensionFunction { +class ExtensionTestCreateIncognitoTabFunction : public TestExtensionFunction { virtual ~ExtensionTestCreateIncognitoTabFunction(); virtual bool RunImpl() OVERRIDE; DECLARE_EXTENSION_FUNCTION_NAME("test.createIncognitoTab") |