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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 11759019: Update other unittests to use newly added TestingBrowserProcess::GetGlobal(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler codez Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 profile->CreateRequestContext(); 224 profile->CreateRequestContext();
225 SetMonster(profile->GetRequestContext()->GetURLRequestContext()-> 225 SetMonster(profile->GetRequestContext()->GetURLRequestContext()->
226 cookie_store()->GetCookieMonster()); 226 cookie_store()->GetCookieMonster());
227 } 227 }
228 }; 228 };
229 229
230 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) 230 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING)
231 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { 231 class RemoveSafeBrowsingCookieTester : public RemoveCookieTester {
232 public: 232 public:
233 RemoveSafeBrowsingCookieTester() 233 RemoveSafeBrowsingCookieTester()
234 : browser_process_( 234 : browser_process_(TestingBrowserProcess::GetGlobal()) {
235 static_cast<TestingBrowserProcess*>(g_browser_process)) {
236 scoped_refptr<SafeBrowsingService> sb_service = 235 scoped_refptr<SafeBrowsingService> sb_service =
237 SafeBrowsingService::CreateSafeBrowsingService(); 236 SafeBrowsingService::CreateSafeBrowsingService();
238 browser_process_->SetSafeBrowsingService(sb_service); 237 browser_process_->SetSafeBrowsingService(sb_service);
239 sb_service->Initialize(); 238 sb_service->Initialize();
240 MessageLoop::current()->RunUntilIdle(); 239 MessageLoop::current()->RunUntilIdle();
241 240
242 // Create a cookiemonster that does not have persistant storage, and replace 241 // Create a cookiemonster that does not have persistant storage, and replace
243 // the SafeBrowsingService created one with it. 242 // the SafeBrowsingService created one with it.
244 net::CookieStore* monster = new net::CookieMonster(NULL, NULL); 243 net::CookieStore* monster = new net::CookieMonster(NULL, NULL);
245 sb_service->url_request_context()->GetURLRequestContext()-> 244 sb_service->url_request_context()->GetURLRequestContext()->
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 ASSERT_TRUE(tester.HasProfile()); 1234 ASSERT_TRUE(tester.HasProfile());
1236 1235
1237 BlockUntilBrowsingDataRemoved( 1236 BlockUntilBrowsingDataRemoved(
1238 BrowsingDataRemover::EVERYTHING, 1237 BrowsingDataRemover::EVERYTHING,
1239 BrowsingDataRemover::REMOVE_FORM_DATA, false); 1238 BrowsingDataRemover::REMOVE_FORM_DATA, false);
1240 1239
1241 EXPECT_EQ(BrowsingDataRemover::REMOVE_FORM_DATA, GetRemovalMask()); 1240 EXPECT_EQ(BrowsingDataRemover::REMOVE_FORM_DATA, GetRemovalMask());
1242 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask()); 1241 EXPECT_EQ(BrowsingDataHelper::UNPROTECTED_WEB, GetOriginSetMask());
1243 ASSERT_FALSE(tester.HasProfile()); 1242 ASSERT_FALSE(tester.HasProfile());
1244 } 1243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698