diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-08 23:05:43 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-08 23:05:43 +0000 |
commit | c173403c93026f09a74dfd0e2d579191e2fa3ecd (patch) | |
tree | 992d24d577d2a0e3f35c771f4dea7cd514c7efa6 /chrome/browser | |
parent | 0926012e76f40fa2f45e7a37bb4edf8d7b05783d (diff) | |
download | chromium_src-c173403c93026f09a74dfd0e2d579191e2fa3ecd.zip chromium_src-c173403c93026f09a74dfd0e2d579191e2fa3ecd.tar.gz chromium_src-c173403c93026f09a74dfd0e2d579191e2fa3ecd.tar.bz2 |
Switch GTK's cookie_view_unittest.cc to use the TestingProfile's new Create/GetRequestContext()
BUG=None
TEST=Unit tests
Review URL: http://codereview.chromium.org/529003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/gtk/options/cookies_view_unittest.cc | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/chrome/browser/gtk/options/cookies_view_unittest.cc b/chrome/browser/gtk/options/cookies_view_unittest.cc index 21bde83..935f6c2 100644 --- a/chrome/browser/gtk/options/cookies_view_unittest.cc +++ b/chrome/browser/gtk/options/cookies_view_unittest.cc @@ -15,50 +15,6 @@ #include "net/url_request/url_request_context.h" #include "testing/gtest/include/gtest/gtest.h" -namespace { - -class TestURLRequestContext : public URLRequestContext { - public: - TestURLRequestContext() { - cookie_store_ = new net::CookieMonster(); - } - - private: - ~TestURLRequestContext() {} -}; - -class TestURLRequestContextGetter : public URLRequestContextGetter { - public: - virtual URLRequestContext* GetURLRequestContext() { - if (!context_) - context_ = new TestURLRequestContext(); - return context_; - } - private: - ~TestURLRequestContextGetter() {} - - scoped_refptr<URLRequestContext> context_; -}; - -class CookieTestingProfile : public TestingProfile { - public: - virtual URLRequestContextGetter* GetRequestContext() { - if (!url_request_context_getter_.get()) - url_request_context_getter_ = new TestURLRequestContextGetter; - return url_request_context_getter_.get(); - } - virtual ~CookieTestingProfile() {} - - net::CookieMonster* GetCookieMonster() { - return GetRequestContext()->GetCookieStore()->GetCookieMonster(); - } - - private: - scoped_refptr<URLRequestContextGetter> url_request_context_getter_; -}; - -} // namespace - class CookiesViewTest : public testing::Test { public: CookiesViewTest() : io_thread_(ChromeThread::IO, &message_loop_) { @@ -68,7 +24,8 @@ class CookiesViewTest : public testing::Test { } virtual void SetUp() { - profile_.reset(new CookieTestingProfile()); + profile_.reset(new TestingProfile()); + profile_->CreateRequestContext(); } void CheckDetailsSensitivity(gboolean expected, @@ -190,7 +147,7 @@ class CookiesViewTest : public testing::Test { MessageLoop message_loop_; ChromeThread io_thread_; - scoped_ptr<CookieTestingProfile> profile_; + scoped_ptr<TestingProfile> profile_; }; TEST_F(CookiesViewTest, Empty) { |