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

Side by Side Diff: chrome/browser/net/sdch_browsertest.cc

Issue 2175703002: Implement a task scheduler for BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bdr-race-condition
Patch Set: Formatting. Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // End-to-end SDCH tests. Uses the embedded test server to return SDCH 5 // End-to-end SDCH tests. Uses the embedded test server to return SDCH
6 // results 6 // results
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <utility> 10 #include <utility>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 run_loop.QuitClosure()); 401 run_loop.QuitClosure());
402 run_loop.Run(); 402 run_loop.Run();
403 DCHECK_NE(-1, fetches); 403 DCHECK_NE(-1, fetches);
404 return fetches; 404 return fetches;
405 } 405 }
406 406
407 void BrowsingDataRemoveAndWait(int remove_mask) { 407 void BrowsingDataRemoveAndWait(int remove_mask) {
408 BrowsingDataRemover* remover = 408 BrowsingDataRemover* remover =
409 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); 409 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile());
410 BrowsingDataRemoverCompletionObserver completion_observer(remover); 410 BrowsingDataRemoverCompletionObserver completion_observer(remover);
411 remover->Remove(BrowsingDataRemover::Period(browsing_data::LAST_HOUR), 411 remover->RemoveAndReply(
412 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); 412 BrowsingDataRemover::Period(browsing_data::LAST_HOUR), remove_mask,
413 BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer);
413 completion_observer.BlockUntilCompletion(); 414 completion_observer.BlockUntilCompletion();
414 } 415 }
415 416
416 // Something of a cheat; nuke the dictionaries off the SdchManager without 417 // Something of a cheat; nuke the dictionaries off the SdchManager without
417 // touching the cache (which browsing data remover would do). 418 // touching the cache (which browsing data remover would do).
418 void NukeSdchDictionaries() { 419 void NukeSdchDictionaries() {
419 base::RunLoop run_loop; 420 base::RunLoop run_loop;
420 content::BrowserThread::PostTaskAndReply( 421 content::BrowserThread::PostTaskAndReply(
421 content::BrowserThread::IO, FROM_HERE, 422 content::BrowserThread::IO, FROM_HERE,
422 base::Bind(&SdchBrowserTest::NukeSdchDictionariesOnIOThread, 423 base::Bind(&SdchBrowserTest::NukeSdchDictionariesOnIOThread,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 ASSERT_TRUE(SetupIncognitoBrowser()); 710 ASSERT_TRUE(SetupIncognitoBrowser());
710 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); 711 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser()));
711 712
712 // Data fetches on main browser should not be SDCH encoded. 713 // Data fetches on main browser should not be SDCH encoded.
713 bool sdch_encoding_used = true; 714 bool sdch_encoding_used = true;
714 ASSERT_TRUE(GetData(&sdch_encoding_used)); 715 ASSERT_TRUE(GetData(&sdch_encoding_used));
715 EXPECT_FALSE(sdch_encoding_used); 716 EXPECT_FALSE(sdch_encoding_used);
716 } 717 }
717 718
718 } // namespace 719 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/browsing_data/browsing_data_api.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698