summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-14 08:27:39 +0000
committerlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-14 08:27:39 +0000
commit366af8acfca9eca7e77a453c514dd02e2d638577 (patch)
tree238f5e1fc773253ec7bd7a2e848f09892254ecd0 /chrome
parenta5ab30a4c604d77110914aa8d6c5a25fbba01a6b (diff)
downloadchromium_src-366af8acfca9eca7e77a453c514dd02e2d638577.zip
chromium_src-366af8acfca9eca7e77a453c514dd02e2d638577.tar.gz
chromium_src-366af8acfca9eca7e77a453c514dd02e2d638577.tar.bz2
Fix UrlFetcher unittest.
TBR=joshia,iyengar Review URL: http://codereview.chromium.org/18220 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc5
-rw-r--r--chrome/browser/url_fetcher_unittest.cc8
2 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
index d40c21b..ae6b684 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -7,6 +7,7 @@
#include "base/message_loop.h"
#include "chrome/browser/renderer_security_policy.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/render_messages.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
@@ -103,6 +104,10 @@ class ResourceDispatcherHostTest : public testing::Test,
URLRequest::RegisterProtocolFactory("test", NULL);
RendererSecurityPolicy::GetInstance()->Remove(0);
+ // The plugin lib is automatically loaded during these test
+ // and we want a clean environment for other tests.
+ ChromePluginLib::UnloadAllPlugins();
+
// Flush the message loop to make Purify happy.
message_loop_.RunAllPending();
}
diff --git a/chrome/browser/url_fetcher_unittest.cc b/chrome/browser/url_fetcher_unittest.cc
index dccf560..7e28f33 100644
--- a/chrome/browser/url_fetcher_unittest.cc
+++ b/chrome/browser/url_fetcher_unittest.cc
@@ -6,6 +6,7 @@
#include "base/time.h"
#include "chrome/browser/url_fetcher.h"
#include "chrome/browser/url_fetcher_protect.h"
+#include "chrome/common/chrome_plugin_lib.h"
#include "net/base/ssl_test_util.h"
#include "net/url_request/url_request_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -33,6 +34,13 @@ class URLFetcherTest : public testing::Test, public URLFetcher::Delegate {
const std::string& data);
protected:
+ virtual void SetUp() {
+ testing::Test::SetUp();
+
+ // Ensure that any plugin operations done by other tests are cleaned up.
+ ChromePluginLib::UnloadAllPlugins();
+ }
+
// URLFetcher is designed to run on the main UI thread, but in our tests
// we assume that the current thread is the IO thread where the URLFetcher
// dispatches its requests to. When we wish to simulate being used from