| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(BrowsingDataRemover::LAST_HOUR), | 411 remover->Remove(BrowsingDataRemover::Period(browsing_data::LAST_HOUR), |
| 412 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); | 412 remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
| 413 completion_observer.BlockUntilCompletion(); | 413 completion_observer.BlockUntilCompletion(); |
| 414 } | 414 } |
| 415 | 415 |
| 416 // Something of a cheat; nuke the dictionaries off the SdchManager without | 416 // Something of a cheat; nuke the dictionaries off the SdchManager without |
| 417 // touching the cache (which browsing data remover would do). | 417 // touching the cache (which browsing data remover would do). |
| 418 void NukeSdchDictionaries() { | 418 void NukeSdchDictionaries() { |
| 419 base::RunLoop run_loop; | 419 base::RunLoop run_loop; |
| 420 content::BrowserThread::PostTaskAndReply( | 420 content::BrowserThread::PostTaskAndReply( |
| 421 content::BrowserThread::IO, FROM_HERE, | 421 content::BrowserThread::IO, FROM_HERE, |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 ASSERT_TRUE(SetupIncognitoBrowser()); | 709 ASSERT_TRUE(SetupIncognitoBrowser()); |
| 710 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); | 710 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); |
| 711 | 711 |
| 712 // Data fetches on main browser should not be SDCH encoded. | 712 // Data fetches on main browser should not be SDCH encoded. |
| 713 bool sdch_encoding_used = true; | 713 bool sdch_encoding_used = true; |
| 714 ASSERT_TRUE(GetData(&sdch_encoding_used)); | 714 ASSERT_TRUE(GetData(&sdch_encoding_used)); |
| 715 EXPECT_FALSE(sdch_encoding_used); | 715 EXPECT_FALSE(sdch_encoding_used); |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace | 718 } // namespace |
| OLD | NEW |