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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool result = false; | 73 bool result = false; |
74 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 74 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
75 browser->tab_strip_model()->GetActiveWebContents(), command, &result)); | 75 browser->tab_strip_model()->GetActiveWebContents(), command, &result)); |
76 return result; | 76 return result; |
77 } | 77 } |
78 | 78 |
79 // Expands the more box on the currently displayed error page. | 79 // Expands the more box on the currently displayed error page. |
80 void ToggleHelpBox(Browser* browser) { | 80 void ToggleHelpBox(Browser* browser) { |
81 EXPECT_TRUE(content::ExecuteScript( | 81 EXPECT_TRUE(content::ExecuteScript( |
82 browser->tab_strip_model()->GetActiveWebContents(), | 82 browser->tab_strip_model()->GetActiveWebContents(), |
83 "document.getElementById('more-less-button').click();")); | 83 "document.getElementById('details-button').click();")); |
84 } | 84 } |
85 | 85 |
86 // Returns true if |browser| is displaying the text representation of | 86 // Returns true if |browser| is displaying the text representation of |
87 // |error_code| on the current page. | 87 // |error_code| on the current page. |
88 bool WARN_UNUSED_RESULT IsDisplayingNetError(Browser* browser, | 88 bool WARN_UNUSED_RESULT IsDisplayingNetError(Browser* browser, |
89 net::Error error_code) { | 89 net::Error error_code) { |
90 // Get the error as a string, and remove the leading "net::", which is not | 90 // Get the error as a string, and remove the leading "net::", which is not |
91 // included on error pages. | 91 // included on error pages. |
92 std::string error_string(net::ErrorToString(error_code)); | 92 std::string error_string(net::ErrorToString(error_code)); |
93 DCHECK(StartsWithASCII(error_string, "net::", true)); | 93 DCHECK(StartsWithASCII(error_string, "net::", true)); |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |