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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 // validate the right page is being displayed. | 958 // validate the right page is being displayed. |
959 class ErrorPageNavigationCorrectionsFailTest : public ErrorPageTest { | 959 class ErrorPageNavigationCorrectionsFailTest : public ErrorPageTest { |
960 public: | 960 public: |
961 // InProcessBrowserTest: | 961 // InProcessBrowserTest: |
962 virtual void SetUpOnMainThread() OVERRIDE { | 962 virtual void SetUpOnMainThread() OVERRIDE { |
963 BrowserThread::PostTask( | 963 BrowserThread::PostTask( |
964 BrowserThread::IO, FROM_HERE, | 964 BrowserThread::IO, FROM_HERE, |
965 base::Bind(&ErrorPageNavigationCorrectionsFailTest::AddFilters)); | 965 base::Bind(&ErrorPageNavigationCorrectionsFailTest::AddFilters)); |
966 } | 966 } |
967 | 967 |
968 virtual void CleanUpOnMainThread() OVERRIDE { | 968 virtual void TearDownOnMainThread() OVERRIDE { |
969 BrowserThread::PostTask( | 969 BrowserThread::PostTask( |
970 BrowserThread::IO, FROM_HERE, | 970 BrowserThread::IO, FROM_HERE, |
971 base::Bind(&ErrorPageNavigationCorrectionsFailTest::RemoveFilters)); | 971 base::Bind(&ErrorPageNavigationCorrectionsFailTest::RemoveFilters)); |
972 } | 972 } |
973 | 973 |
974 private: | 974 private: |
975 // Adds a filter that causes all correction service requests to fail with | 975 // Adds a filter that causes all correction service requests to fail with |
976 // ERR_ADDRESS_UNREACHABLE. | 976 // ERR_ADDRESS_UNREACHABLE. |
977 // | 977 // |
978 // Also adds the content::URLRequestFailedJob filter. | 978 // Also adds the content::URLRequestFailedJob filter. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 // InProcessBrowserTest: | 1061 // InProcessBrowserTest: |
1062 virtual void SetUpOnMainThread() OVERRIDE { | 1062 virtual void SetUpOnMainThread() OVERRIDE { |
1063 // Clear AcceptLanguages to force punycode decoding. | 1063 // Clear AcceptLanguages to force punycode decoding. |
1064 browser()->profile()->GetPrefs()->SetString(prefs::kAcceptLanguages, | 1064 browser()->profile()->GetPrefs()->SetString(prefs::kAcceptLanguages, |
1065 std::string()); | 1065 std::string()); |
1066 BrowserThread::PostTask( | 1066 BrowserThread::PostTask( |
1067 BrowserThread::IO, FROM_HERE, | 1067 BrowserThread::IO, FROM_HERE, |
1068 base::Bind(&ErrorPageForIDNTest::AddFilters)); | 1068 base::Bind(&ErrorPageForIDNTest::AddFilters)); |
1069 } | 1069 } |
1070 | 1070 |
1071 virtual void CleanUpOnMainThread() OVERRIDE { | 1071 virtual void TearDownOnMainThread() OVERRIDE { |
1072 BrowserThread::PostTask( | 1072 BrowserThread::PostTask( |
1073 BrowserThread::IO, FROM_HERE, | 1073 BrowserThread::IO, FROM_HERE, |
1074 base::Bind(&ErrorPageForIDNTest::RemoveFilters)); | 1074 base::Bind(&ErrorPageForIDNTest::RemoveFilters)); |
1075 } | 1075 } |
1076 | 1076 |
1077 private: | 1077 private: |
1078 static void AddFilters() { | 1078 static void AddFilters() { |
1079 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1079 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1080 content::URLRequestFailedJob::AddUrlHandlerForHostname(kHostname); | 1080 content::URLRequestFailedJob::AddUrlHandlerForHostname(kHostname); |
1081 } | 1081 } |
(...skipping 17 matching lines...) Expand all Loading... |
1099 browser(), | 1099 browser(), |
1100 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, | 1100 URLRequestFailedJob::GetMockHttpUrlForHostname(net::ERR_UNSAFE_PORT, |
1101 kHostname), | 1101 kHostname), |
1102 1); | 1102 1); |
1103 | 1103 |
1104 ToggleHelpBox(browser()); | 1104 ToggleHelpBox(browser()); |
1105 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); | 1105 EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); |
1106 } | 1106 } |
1107 | 1107 |
1108 } // namespace | 1108 } // namespace |
OLD | NEW |