diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-04 16:36:25 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-04 16:36:25 +0000 |
commit | 17c4f3c7c289c840f8b285f7834ab7007f85e35e (patch) | |
tree | e21af5a41aba26623cf56d6fe2412c34a32daafc /chrome/browser/extensions/extension_browsertest.h | |
parent | cd659ee5e9e02a3fdf261fb9ebdf25801661b5fa (diff) | |
download | chromium_src-17c4f3c7c289c840f8b285f7834ab7007f85e35e.zip chromium_src-17c4f3c7c289c840f8b285f7834ab7007f85e35e.tar.gz chromium_src-17c4f3c7c289c840f8b285f7834ab7007f85e35e.tar.bz2 |
Add an ExtensionBrowserTest base class that allows in-process browser tests of extensions using ExtensionsService directly, rather than TestExtensionLoaded. Use it to re-enable some old browser tests that had been disabled.
Review URL: http://codereview.chromium.org/150213
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19930 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browsertest.h')
-rw-r--r-- | chrome/browser/extensions/extension_browsertest.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_browsertest.h b/chrome/browser/extensions/extension_browsertest.h new file mode 100644 index 0000000..385fd9e --- /dev/null +++ b/chrome/browser/extensions/extension_browsertest.h @@ -0,0 +1,41 @@ +// Copyright (c) 2009 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. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_TEST_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_TEST_H_ + +#include <string> + +#include "base/command_line.h" +#include "base/file_path.h" +#include "chrome/common/notification_details.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" +#include "chrome/common/notification_type.h" +#include "chrome/test/in_process_browser_test.h" + +// Base class for extension browser tests. Provides utilities for loading, +// unloading, and installing extensions. +class ExtensionBrowserTest + : public InProcessBrowserTest, public NotificationObserver { + protected: + virtual void SetUpCommandLine(CommandLine* command_line); + bool LoadExtension(const FilePath& path); + bool InstallExtension(const FilePath& path); + void UninstallExtension(const std::string& extension_id); + + bool loaded_; + bool installed_; + FilePath test_data_dir_; + + private: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + bool WaitForExtensionHostsToLoad(); + + NotificationRegistrar registrar_; +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_TEST_H_ |