OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 public: | 37 public: |
38 explicit LoadFailObserver(content::WebContents* contents) | 38 explicit LoadFailObserver(content::WebContents* contents) |
39 : content::WebContentsObserver(contents), | 39 : content::WebContentsObserver(contents), |
40 failed_load_(false), | 40 failed_load_(false), |
41 error_code_(net::OK) { } | 41 error_code_(net::OK) { } |
42 | 42 |
43 void DidFailProvisionalLoad( | 43 void DidFailProvisionalLoad( |
44 content::RenderFrameHost* render_frame_host, | 44 content::RenderFrameHost* render_frame_host, |
45 const GURL& validated_url, | 45 const GURL& validated_url, |
46 int error_code, | 46 int error_code, |
47 const base::string16& error_description) override { | 47 const base::string16& error_description, |
| 48 bool was_ignored_by_handler) override { |
48 failed_load_ = true; | 49 failed_load_ = true; |
49 error_code_ = static_cast<net::Error>(error_code); | 50 error_code_ = static_cast<net::Error>(error_code); |
50 validated_url_ = validated_url; | 51 validated_url_ = validated_url; |
51 } | 52 } |
52 | 53 |
53 bool failed_load() const { return failed_load_; } | 54 bool failed_load() const { return failed_load_; } |
54 net::Error error_code() const { return error_code_; } | 55 net::Error error_code() const { return error_code_; } |
55 const GURL& validated_url() const { return validated_url_; } | 56 const GURL& validated_url() const { return validated_url_; } |
56 | 57 |
57 private: | 58 private: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 ASSERT_TRUE(NavigateToURL(kFailHTML)); | 135 ASSERT_TRUE(NavigateToURL(kFailHTML)); |
135 | 136 |
136 std::string test_result; | 137 std::string test_result; |
137 EXPECT_FALSE(RunAccessibilityChecks(&test_result)); | 138 EXPECT_FALSE(RunAccessibilityChecks(&test_result)); |
138 | 139 |
139 // Error should NOT be empty on failure. | 140 // Error should NOT be empty on failure. |
140 EXPECT_NE("", test_result); | 141 EXPECT_NE("", test_result); |
141 } | 142 } |
142 | 143 |
143 } // namespace | 144 } // namespace |
OLD | NEW |