Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8684)

Unified Diff: chrome/browser/website_settings_unittest.cc

Issue 10440092: Remove any platform specific code from the chrome/browser/website_settings.* . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/browser/website_settings.h ('K') | « chrome/browser/website_settings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/website_settings_unittest.cc
diff --git a/chrome/browser/website_settings_unittest.cc b/chrome/browser/website_settings_unittest.cc
index 9081f0fabdba5b11c7e0e7fcf0cc03dd4f71bb61..8fd6e3a9e6af711767cc94d6518014ebc636f98e 100644
--- a/chrome/browser/website_settings_unittest.cc
+++ b/chrome/browser/website_settings_unittest.cc
@@ -57,7 +57,6 @@ class MockCertStore : public content::CertStore {
class MockWebsiteSettingsUI : public WebsiteSettingsUI {
public:
virtual ~MockWebsiteSettingsUI() {}
- MOCK_METHOD1(SetPresenter, void(WebsiteSettings* presenter));
MOCK_METHOD1(SetCookieInfo, void(const CookieInfoList& cookie_info_list));
MOCK_METHOD1(SetPermissionInfo,
void(const PermissionInfoList& permission_info_list));
@@ -107,18 +106,16 @@ class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
}
virtual void TearDown() {
- ASSERT_TRUE(website_settings_) << "No WebsiteSettings instance created.";
- // Call OnUIClosing to destroy the |website_settings| object.
- EXPECT_CALL(*mock_ui_, SetPresenter(NULL));
- website_settings_->OnUIClosing();
+ ASSERT_TRUE(website_settings_.get())
+ << "No WebsiteSettings instance created.";
RenderViewHostTestHarness::TearDown();
+ website_settings_.reset(NULL);
}
void SetDefaultUIExpectations(MockWebsiteSettingsUI* mock_ui) {
// During creation |WebsiteSettings| makes the following calls to the ui.
EXPECT_CALL(*mock_ui, SetPermissionInfo(_));
EXPECT_CALL(*mock_ui, SetIdentityInfo(_));
- EXPECT_CALL(*mock_ui, SetPresenter(_));
EXPECT_CALL(*mock_ui, SetCookieInfo(_));
EXPECT_CALL(*mock_ui, SetFirstVisit(string16()));
}
@@ -133,20 +130,18 @@ class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
}
WebsiteSettings* website_settings() {
- if (!website_settings_) {
- website_settings_ = new WebsiteSettings(
+ if (!website_settings_.get()) {
+ website_settings_.reset(new WebsiteSettings(
mock_ui(), profile(), tab_specific_content_settings_.get(), url(),
- ssl(), cert_store());
+ ssl(), cert_store()));
}
- return website_settings_;
+ return website_settings_.get();
}
SSLStatus ssl_;
private:
- // The |Website_settings| object deletes itself after the OnUIClosing()
- // method is called.
- WebsiteSettings* website_settings_; // Weak pointer.
+ scoped_ptr<WebsiteSettings> website_settings_;
// The UI is owned by |web_site_settings_|.
MockWebsiteSettingsUI* mock_ui_; // Weak pointer.
int cert_id_;
@@ -206,7 +201,6 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
TEST_F(WebsiteSettingsTest, OnSiteDataAccessed) {
EXPECT_CALL(*mock_ui(), SetPermissionInfo(_));
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
- EXPECT_CALL(*mock_ui(), SetPresenter(_));
EXPECT_CALL(*mock_ui(), SetFirstVisit(string16()));
EXPECT_CALL(*mock_ui(), SetCookieInfo(_)).Times(2);
« chrome/browser/website_settings.h ('K') | « chrome/browser/website_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698