| OLD | NEW |
| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 run_loop.QuitClosure()); | 402 run_loop.QuitClosure()); |
| 403 run_loop.Run(); | 403 run_loop.Run(); |
| 404 DCHECK_NE(-1, fetches); | 404 DCHECK_NE(-1, fetches); |
| 405 return fetches; | 405 return fetches; |
| 406 } | 406 } |
| 407 | 407 |
| 408 void BrowsingDataRemoveAndWait(int remove_mask) { | 408 void BrowsingDataRemoveAndWait(int remove_mask) { |
| 409 BrowsingDataRemover* remover = | 409 BrowsingDataRemover* remover = |
| 410 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); | 410 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); |
| 411 BrowsingDataRemoverCompletionObserver completion_observer(remover); | 411 BrowsingDataRemoverCompletionObserver completion_observer(remover); |
| 412 remover->RemoveAndReply( | 412 remover->RemoveAndReply(browsing_data::CalculateBeginDeleteTime( |
| 413 browsing_data::CalculateBeginDeleteTime(browsing_data::LAST_HOUR), | 413 browsing_data::TimePeriod::LAST_HOUR), |
| 414 browsing_data::CalculateEndDeleteTime(browsing_data::LAST_HOUR), | 414 browsing_data::CalculateEndDeleteTime( |
| 415 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB, &completion_observer); | 415 browsing_data::TimePeriod::LAST_HOUR), |
| 416 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB, |
| 417 &completion_observer); |
| 416 completion_observer.BlockUntilCompletion(); | 418 completion_observer.BlockUntilCompletion(); |
| 417 } | 419 } |
| 418 | 420 |
| 419 // Something of a cheat; nuke the dictionaries off the SdchManager without | 421 // Something of a cheat; nuke the dictionaries off the SdchManager without |
| 420 // touching the cache (which browsing data remover would do). | 422 // touching the cache (which browsing data remover would do). |
| 421 void NukeSdchDictionaries() { | 423 void NukeSdchDictionaries() { |
| 422 base::RunLoop run_loop; | 424 base::RunLoop run_loop; |
| 423 content::BrowserThread::PostTaskAndReply( | 425 content::BrowserThread::PostTaskAndReply( |
| 424 content::BrowserThread::IO, FROM_HERE, | 426 content::BrowserThread::IO, FROM_HERE, |
| 425 base::Bind(&SdchBrowserTest::NukeSdchDictionariesOnIOThread, | 427 base::Bind(&SdchBrowserTest::NukeSdchDictionariesOnIOThread, |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 ASSERT_TRUE(SetupIncognitoBrowser()); | 714 ASSERT_TRUE(SetupIncognitoBrowser()); |
| 713 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); | 715 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); |
| 714 | 716 |
| 715 // Data fetches on main browser should not be SDCH encoded. | 717 // Data fetches on main browser should not be SDCH encoded. |
| 716 bool sdch_encoding_used = true; | 718 bool sdch_encoding_used = true; |
| 717 ASSERT_TRUE(GetData(&sdch_encoding_used)); | 719 ASSERT_TRUE(GetData(&sdch_encoding_used)); |
| 718 EXPECT_FALSE(sdch_encoding_used); | 720 EXPECT_FALSE(sdch_encoding_used); |
| 719 } | 721 } |
| 720 | 722 |
| 721 } // namespace | 723 } // namespace |
| OLD | NEW |