diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-21 16:32:40 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-21 16:32:40 +0000 |
commit | 82b8664b1250c39412af70c6278061ab5c346e01 (patch) | |
tree | c27101dbebbf0475c5dcb55654c621c49f8508b7 /chrome/browser/extensions/test_extension_loader.h | |
parent | 167b1403caab4d655888fe9798aaf9b525e7d4ff (diff) | |
download | chromium_src-82b8664b1250c39412af70c6278061ab5c346e01.zip chromium_src-82b8664b1250c39412af70c6278061ab5c346e01.tar.gz chromium_src-82b8664b1250c39412af70c6278061ab5c346e01.tar.bz2 |
Committing issue 39299:
Test for extension user script load and inject.
This add a test that a user script actually gets injected into
pages and runs. Before we only had unit tests for the various
classes and weren't testing the system end-to-end.
Review URL: http://codereview.chromium.org/51003
Patch from Steve Krulewitz <skrulx@gmail.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/test_extension_loader.h')
-rwxr-xr-x | chrome/browser/extensions/test_extension_loader.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/extensions/test_extension_loader.h b/chrome/browser/extensions/test_extension_loader.h new file mode 100755 index 0000000..36792b0 --- /dev/null +++ b/chrome/browser/extensions/test_extension_loader.h @@ -0,0 +1,36 @@ +// Copyright (c) 2006-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_TEST_EXTENSION_LOADER_H_ +#define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_LOADER_H_ + +#include "base/basictypes.h" +#include "chrome/browser/extensions/extension.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" + +class Extension; +class FilePath; +class Profile; + +class TestExtensionLoader : public NotificationObserver { + public: + explicit TestExtensionLoader(Profile* profile); + + Extension* Load(const char* extension_id, const FilePath& path); + + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + private: + Profile* profile_; + Extension* extension_; + NotificationRegistrar registrar_; + const char* loading_extension_id_; + + DISALLOW_COPY_AND_ASSIGN(TestExtensionLoader); +}; + +#endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_LOADER_H_ |