Commit cfad5a90 authored by mattm@google.com's avatar mattm@google.com

Fix tests that were setting safebrowsing factories without unsetting them.

BUG=313141
R=shess@chromium.org, tburkard@chromium.org

Review URL: https://codereview.chromium.org/55323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232882 0039d316-1c4b-4281-b951-d872f2087c98
parent bcfef7a0
...@@ -726,6 +726,12 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest { ...@@ -726,6 +726,12 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
#endif #endif
} }
virtual void TearDownInProcessBrowserTestFixture() OVERRIDE {
#if defined(FULL_SAFE_BROWSING)
SafeBrowsingService::RegisterFactory(NULL);
#endif
}
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitchASCII(switches::kPrerenderMode, command_line->AppendSwitchASCII(switches::kPrerenderMode,
switches::kPrerenderModeSwitchValueEnabled); switches::kPrerenderModeSwitchValueEnabled);
......
...@@ -39,10 +39,16 @@ class TestSafeBrowsingServiceFactory : public SafeBrowsingServiceFactory { ...@@ -39,10 +39,16 @@ class TestSafeBrowsingServiceFactory : public SafeBrowsingServiceFactory {
class SafeBrowsingDatabaseManagerTest : public PlatformTest { class SafeBrowsingDatabaseManagerTest : public PlatformTest {
public: public:
virtual void SetUp() { virtual void SetUp() OVERRIDE {
PlatformTest::SetUp(); PlatformTest::SetUp();
SafeBrowsingService::RegisterFactory(&factory_); SafeBrowsingService::RegisterFactory(&factory_);
} }
virtual void TearDown() OVERRIDE {
SafeBrowsingService::RegisterFactory(NULL);
PlatformTest::TearDown();
}
bool RunSBHashTest(const safe_browsing_util::ListType list_type, bool RunSBHashTest(const safe_browsing_util::ListType list_type,
const std::vector<SBThreatType>& expected_threats, const std::vector<SBThreatType>& expected_threats,
const std::string& result_list); const std::string& result_list);
......
...@@ -126,16 +126,18 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { ...@@ -126,16 +126,18 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness {
ui_manager_ = new TestSafeBrowsingUIManager(NULL); ui_manager_ = new TestSafeBrowsingUIManager(NULL);
} }
virtual void SetUp() { virtual void SetUp() OVERRIDE {
ChromeRenderViewHostTestHarness::SetUp(); ChromeRenderViewHostTestHarness::SetUp();
SafeBrowsingBlockingPage::RegisterFactory(&factory_); SafeBrowsingBlockingPage::RegisterFactory(&factory_);
MalwareDetails::RegisterFactory(NULL); // Create it fresh each time.
ResetUserResponse(); ResetUserResponse();
} }
virtual void TearDown() { virtual void TearDown() OVERRIDE {
// Release the UI manager before the BrowserThreads are destroyed. // Release the UI manager before the BrowserThreads are destroyed.
ui_manager_ = NULL; ui_manager_ = NULL;
SafeBrowsingBlockingPage::RegisterFactory(NULL);
// Clean up singleton reference (crbug.com/110594).
MalwareDetails::RegisterFactory(NULL);
ChromeRenderViewHostTestHarness::TearDown(); ChromeRenderViewHostTestHarness::TearDown();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment