| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 // Make sure error page shows correct unicode for IDN. | 1487 // Make sure error page shows correct unicode for IDN. |
| 1488 IN_PROC_BROWSER_TEST_F(ErrorPageForIDNTest, IDN) { | 1488 IN_PROC_BROWSER_TEST_F(ErrorPageForIDNTest, IDN) { |
| 1489 // ERR_UNSAFE_PORT will not trigger navigation corrections. | 1489 // ERR_UNSAFE_PORT will not trigger navigation corrections. |
| 1490 ui_test_utils::NavigateToURL( | 1490 ui_test_utils::NavigateToURL( |
| 1491 browser(), | 1491 browser(), |
| 1492 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, | 1492 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, |
| 1493 kHostname)); | 1493 kHostname)); |
| 1494 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); | 1494 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); |
| 1495 } | 1495 } |
| 1496 | 1496 |
| 1497 // Make sure HTTP/0.9 is disabled on non-default ports by default. | 1497 // Make sure HTTP/0.9 is enabled on non-default ports by default. |
| 1498 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Http09WeirdPort) { | 1498 IN_PROC_BROWSER_TEST_F(ErrorPageTest, Http09WeirdPort) { |
| 1499 const char kHttp09Response[] = "JumboShrimp"; |
| 1499 ASSERT_TRUE(embedded_test_server()->Start()); | 1500 ASSERT_TRUE(embedded_test_server()->Start()); |
| 1500 ui_test_utils::NavigateToURL( | 1501 ui_test_utils::NavigateToURL( |
| 1501 browser(), embedded_test_server()->GetURL("/echo-raw?spam")); | 1502 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + |
| 1502 ExpectDisplayingLocalErrorPage(browser(), net::ERR_INVALID_HTTP_RESPONSE); | 1503 kHttp09Response)); |
| 1504 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); |
| 1503 } | 1505 } |
| 1504 | 1506 |
| 1505 class ErrorPageWithHttp09OnNonDefaultPortsTest : public InProcessBrowserTest { | 1507 class ErrorPageWithHttp09OnNonDefaultPortsTest : public InProcessBrowserTest { |
| 1506 public: | 1508 public: |
| 1507 // InProcessBrowserTest: | 1509 // InProcessBrowserTest: |
| 1508 void SetUp() override { | 1510 void SetUp() override { |
| 1509 EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_)) | 1511 EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_)) |
| 1510 .WillRepeatedly(testing::Return(true)); | 1512 .WillRepeatedly(testing::Return(true)); |
| 1511 policy::PolicyMap values; | 1513 policy::PolicyMap values; |
| 1512 values.Set(policy::key::kHttp09OnNonDefaultPortsEnabled, | 1514 values.Set(policy::key::kHttp09OnNonDefaultPortsEnabled, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1529 Http09WeirdPortEnabled) { | 1531 Http09WeirdPortEnabled) { |
| 1530 const char kHttp09Response[] = "JumboShrimp"; | 1532 const char kHttp09Response[] = "JumboShrimp"; |
| 1531 ASSERT_TRUE(embedded_test_server()->Start()); | 1533 ASSERT_TRUE(embedded_test_server()->Start()); |
| 1532 ui_test_utils::NavigateToURL( | 1534 ui_test_utils::NavigateToURL( |
| 1533 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + | 1535 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + |
| 1534 kHttp09Response)); | 1536 kHttp09Response)); |
| 1535 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); | 1537 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); |
| 1536 } | 1538 } |
| 1537 | 1539 |
| 1538 } // namespace | 1540 } // namespace |
| OLD | NEW |