summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_view_unittest.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 19:33:20 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 19:33:20 +0000
commit45904e20797f8cd28a776ed0e40ba94dc4eef97e (patch)
tree00b15cd6207f993e9553313202801702b3f7b250 /chrome/browser/extensions/extension_view_unittest.cc
parent1cb5fbed08b85c459288c98d63cf7c3158f519a2 (diff)
downloadchromium_src-45904e20797f8cd28a776ed0e40ba94dc4eef97e.zip
chromium_src-45904e20797f8cd28a776ed0e40ba94dc4eef97e.tar.gz
chromium_src-45904e20797f8cd28a776ed0e40ba94dc4eef97e.tar.bz2
Introducing ExtensionProcessManager. This manages the ExtensionViews to
ensure there is only 1 process per extension. I also changed ExtensionMessageService from singleton to one instance per Profile. This means messages can only be passed to extensions and scripts within the same profile. Review URL: http://codereview.chromium.org/62132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_view_unittest.cc')
-rwxr-xr-xchrome/browser/extensions/extension_view_unittest.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_view_unittest.cc b/chrome/browser/extensions/extension_view_unittest.cc
index 69a1fb9..d3d52bf 100755
--- a/chrome/browser/extensions/extension_view_unittest.cc
+++ b/chrome/browser/extensions/extension_view_unittest.cc
@@ -6,9 +6,11 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
+#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_view.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/extensions/test_extension_loader.h"
+#include "chrome/browser/tab_contents/site_instance.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/in_process_browser_test.h"
#include "chrome/test/ui_test_utils.h"
@@ -28,8 +30,9 @@ const char* kExtensionId = "00123456789abcdef0123456789abcdef0123456";
// up a javascript alert.
class MockExtensionView : public ExtensionView {
public:
- MockExtensionView(Extension* extension, const GURL& url, Profile* profile)
- : ExtensionView(extension, url, profile), got_message_(false) {
+ MockExtensionView(Extension* extension, const GURL& url,
+ SiteInstance* instance)
+ : ExtensionView(extension, url, instance), got_message_(false) {
InitHidden();
MessageLoop::current()->PostDelayedTask(FROM_HERE,
new MessageLoop::QuitTask, kAlertTimeoutMs);
@@ -88,6 +91,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionViewTest, Index) {
GURL url = Extension::GetResourceURL(extension->url(), "toolstrip1.html");
// Start the extension process and wait for it to show a javascript alert.
- MockExtensionView view(extension, url, browser()->profile());
+ MockExtensionView view(
+ extension, url, ExtensionProcessManager::GetInstance()->
+ GetSiteInstanceForURL(url, browser()->profile()));
EXPECT_TRUE(view.got_message());
}