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 "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 void UnsubscribeFromAllSdchNotifications() { | 634 void UnsubscribeFromAllSdchNotifications() { |
635 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 635 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
636 observers_.clear(); | 636 observers_.clear(); |
637 } | 637 } |
638 | 638 |
639 // URLFetcherDelegate | 639 // URLFetcherDelegate |
640 void OnURLFetchComplete(const net::URLFetcher* source) override { | 640 void OnURLFetchComplete(const net::URLFetcher* source) override { |
641 url_fetch_complete_ = true; | 641 url_fetch_complete_ = true; |
642 if (waiting_) | 642 if (waiting_) |
643 base::MessageLoopForUI::current()->Quit(); | 643 base::MessageLoopForUI::current()->QuitWhenIdle(); |
644 } | 644 } |
645 | 645 |
646 SdchResponseHandler response_handler_; | 646 SdchResponseHandler response_handler_; |
647 net::test_server::EmbeddedTestServer test_server_; | 647 net::test_server::EmbeddedTestServer test_server_; |
648 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 648 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
649 scoped_ptr<net::URLFetcher> fetcher_; | 649 scoped_ptr<net::URLFetcher> fetcher_; |
650 bool url_fetch_complete_; | 650 bool url_fetch_complete_; |
651 bool waiting_; | 651 bool waiting_; |
652 base::ScopedTempDir second_profile_data_dir_; | 652 base::ScopedTempDir second_profile_data_dir_; |
653 Profile* second_profile_; | 653 Profile* second_profile_; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 ASSERT_TRUE(SetupIncognitoBrowser()); | 706 ASSERT_TRUE(SetupIncognitoBrowser()); |
707 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); | 707 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); |
708 | 708 |
709 // Data fetches on main browser should not be SDCH encoded. | 709 // Data fetches on main browser should not be SDCH encoded. |
710 bool sdch_encoding_used = true; | 710 bool sdch_encoding_used = true; |
711 ASSERT_TRUE(GetData(&sdch_encoding_used)); | 711 ASSERT_TRUE(GetData(&sdch_encoding_used)); |
712 EXPECT_FALSE(sdch_encoding_used); | 712 EXPECT_FALSE(sdch_encoding_used); |
713 } | 713 } |
714 | 714 |
715 } // namespace | 715 } // namespace |
OLD | NEW |