| 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 #include <limits.h> | 5 #include <limits.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 server_hash_1, | 511 server_hash_1, |
| 512 GURL("http://" + dictionary_domain_1 + "/random_url"), | 512 GURL("http://" + dictionary_domain_1 + "/random_url"), |
| 513 &dictionary); | 513 &dictionary); |
| 514 EXPECT_FALSE(dictionary.get()); | 514 EXPECT_FALSE(dictionary.get()); |
| 515 } | 515 } |
| 516 | 516 |
| 517 TEST_F(SdchManagerTest, HttpsCorrectlySupported) { | 517 TEST_F(SdchManagerTest, HttpsCorrectlySupported) { |
| 518 GURL url("http://www.google.com"); | 518 GURL url("http://www.google.com"); |
| 519 GURL secure_url("https://www.google.com"); | 519 GURL secure_url("https://www.google.com"); |
| 520 | 520 |
| 521 #if !defined(OS_IOS) |
| 522 // Workaround for http://crbug.com/418975; remove when fixed. |
| 523 bool expect_https_support = true; |
| 524 #else |
| 525 bool expect_https_support = false; |
| 526 #endif |
| 527 |
| 521 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(url)); | 528 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(url)); |
| 522 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(secure_url)); | 529 EXPECT_EQ(expect_https_support, |
| 530 sdch_manager()->IsInSupportedDomain(secure_url)); |
| 523 | 531 |
| 524 SdchManager::EnableSecureSchemeSupport(false); | 532 SdchManager::EnableSecureSchemeSupport(!expect_https_support); |
| 525 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(url)); | 533 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(url)); |
| 526 EXPECT_FALSE(sdch_manager()->IsInSupportedDomain(secure_url)); | 534 EXPECT_NE(expect_https_support, |
| 535 sdch_manager()->IsInSupportedDomain(secure_url)); |
| 527 } | 536 } |
| 528 | 537 |
| 529 TEST_F(SdchManagerTest, ClearDictionaryData) { | 538 TEST_F(SdchManagerTest, ClearDictionaryData) { |
| 530 std::string dictionary_domain("x.y.z.google.com"); | 539 std::string dictionary_domain("x.y.z.google.com"); |
| 531 GURL blacklist_url("http://bad.chromium.org"); | 540 GURL blacklist_url("http://bad.chromium.org"); |
| 532 | 541 |
| 533 std::string dictionary_text(NewSdchDictionary(dictionary_domain)); | 542 std::string dictionary_text(NewSdchDictionary(dictionary_domain)); |
| 534 std::string tmp_hash; | 543 std::string tmp_hash; |
| 535 std::string server_hash; | 544 std::string server_hash; |
| 536 | 545 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 554 dictionary = NULL; | 563 dictionary = NULL; |
| 555 sdch_manager()->GetVcdiffDictionary( | 564 sdch_manager()->GetVcdiffDictionary( |
| 556 server_hash, | 565 server_hash, |
| 557 GURL("http://" + dictionary_domain + "/random_url"), | 566 GURL("http://" + dictionary_domain + "/random_url"), |
| 558 &dictionary); | 567 &dictionary); |
| 559 EXPECT_FALSE(dictionary.get()); | 568 EXPECT_FALSE(dictionary.get()); |
| 560 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(blacklist_url)); | 569 EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(blacklist_url)); |
| 561 } | 570 } |
| 562 | 571 |
| 563 } // namespace net | 572 } // namespace net |
| OLD | NEW |