diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-29 22:24:31 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-29 22:24:31 +0000 |
commit | c64631651a4267994dbdd336243e06b64e4e7a5f (patch) | |
tree | 23700eae496a6cf3cda0beea3742f12656c8cd4b /chrome/browser/extensions/extension_view_unittest.cc | |
parent | 45671618a6690a8501f01905a4ed6d19cfcdc0b1 (diff) | |
download | chromium_src-c64631651a4267994dbdd336243e06b64e4e7a5f.zip chromium_src-c64631651a4267994dbdd336243e06b64e4e7a5f.tar.gz chromium_src-c64631651a4267994dbdd336243e06b64e4e7a5f.tar.bz2 |
Refactor ExtensionView to support a UI-less extension instance.
- Introduce ExtensionHost, which is the guy that talks to the RenderViewHost.
- ExtensionView holds an ExtensionHost, and also renders its contents in an
HWND.
- Added code to load a page optionally specified in the manifest as a
background process whenever it exists.
Review URL: http://codereview.chromium.org/92043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_view_unittest.cc')
-rwxr-xr-x | chrome/browser/extensions/extension_view_unittest.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/extensions/extension_view_unittest.cc b/chrome/browser/extensions/extension_view_unittest.cc index e1c3d8d..3529022 100755 --- a/chrome/browser/extensions/extension_view_unittest.cc +++ b/chrome/browser/extensions/extension_view_unittest.cc @@ -6,7 +6,7 @@ #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_view.h" +#include "chrome/browser/extensions/extension_host.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/test_extension_loader.h" #include "chrome/browser/tab_contents/site_instance.h" @@ -28,12 +28,13 @@ const char* kExtensionId = "00123456789abcdef0123456789abcdef0123456"; // This class starts up an extension process and waits until it tries to put // up a javascript alert. -class MockExtensionView : public ExtensionView { +class MockExtensionHost : public ExtensionHost { public: - MockExtensionView(Extension* extension, const GURL& url, - SiteInstance* instance, Browser* browser) - : ExtensionView(extension, url, instance, browser), got_message_(false) { - InitHidden(); + MockExtensionHost(Extension* extension, const GURL& url, + SiteInstance* instance) + : ExtensionHost(extension, instance), + got_message_(false) { + CreateRenderView(url, NULL); MessageLoop::current()->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, kAlertTimeoutMs); ui_test_utils::RunMessageLoop(); @@ -58,7 +59,7 @@ class MockExtensionView : public ExtensionView { MessageLoopForUI::current()->Quit(); // Call super, otherwise we'll leak reply_msg. - ExtensionView::RunJavaScriptMessage( + ExtensionHost::RunJavaScriptMessage( message, default_prompt, frame_url, flags, reply_msg, did_suppress_message); } @@ -100,8 +101,7 @@ 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()->GetExtensionsService()->GetSiteInstanceForURL(url), - browser()); - EXPECT_TRUE(view.got_message()); + MockExtensionHost host(extension, url, + browser()->profile()->GetExtensionsService()->GetSiteInstanceForURL(url)); + EXPECT_TRUE(host.got_message()); } |