Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 8142032: Add error description to the DidFailProvisionalLoad callback. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/mock_content_renderer_client.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 6
7 #include "base/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/test/base/render_view_test.h" 10 #include "chrome/test/base/render_view_test.h"
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 } 887 }
888 #else 888 #else
889 NOTIMPLEMENTED(); 889 NOTIMPLEMENTED();
890 #endif 890 #endif
891 } 891 }
892 892
893 // Crashy, http://crbug.com/53247. 893 // Crashy, http://crbug.com/53247.
894 TEST_F(RenderViewImplTest, DISABLED_DidFailProvisionalLoadWithErrorForError) { 894 TEST_F(RenderViewImplTest, DISABLED_DidFailProvisionalLoadWithErrorForError) {
895 GetMainFrame()->enableViewSourceMode(true); 895 GetMainFrame()->enableViewSourceMode(true);
896 WebURLError error; 896 WebURLError error;
897 error.domain.fromUTF8("test_domain"); 897 error.domain = WebString::fromUTF8(net::kErrorDomain);
898 error.reason = net::ERR_FILE_NOT_FOUND; 898 error.reason = net::ERR_FILE_NOT_FOUND;
899 error.unreachableURL = GURL("http://foo"); 899 error.unreachableURL = GURL("http://foo");
900 WebFrame* web_frame = GetMainFrame(); 900 WebFrame* web_frame = GetMainFrame();
901 // An error occurred. 901 // An error occurred.
902 view()->didFailProvisionalLoad(web_frame, error); 902 view()->didFailProvisionalLoad(web_frame, error);
903 // Frame should exit view-source mode. 903 // Frame should exit view-source mode.
904 EXPECT_FALSE(web_frame->isViewSourceModeEnabled()); 904 EXPECT_FALSE(web_frame->isViewSourceModeEnabled());
905 } 905 }
906 906
907 TEST_F(RenderViewImplTest, DidFailProvisionalLoadWithErrorForCancellation) { 907 TEST_F(RenderViewImplTest, DidFailProvisionalLoadWithErrorForCancellation) {
908 GetMainFrame()->enableViewSourceMode(true); 908 GetMainFrame()->enableViewSourceMode(true);
909 WebURLError error; 909 WebURLError error;
910 error.domain.fromUTF8("test_domain"); 910 error.domain = WebString::fromUTF8(net::kErrorDomain);
911 error.reason = net::ERR_ABORTED; 911 error.reason = net::ERR_ABORTED;
912 error.unreachableURL = GURL("http://foo"); 912 error.unreachableURL = GURL("http://foo");
913 WebFrame* web_frame = GetMainFrame(); 913 WebFrame* web_frame = GetMainFrame();
914 // A cancellation occurred. 914 // A cancellation occurred.
915 view()->didFailProvisionalLoad(web_frame, error); 915 view()->didFailProvisionalLoad(web_frame, error);
916 // Frame should stay in view-source mode. 916 // Frame should stay in view-source mode.
917 EXPECT_TRUE(web_frame->isViewSourceModeEnabled()); 917 EXPECT_TRUE(web_frame->isViewSourceModeEnabled());
918 } 918 }
919 919
920 // Regression test for http://crbug.com/41562 920 // Regression test for http://crbug.com/41562
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 expected_page_id_2 = view()->page_id_; 1076 expected_page_id_2 = view()->page_id_;
1077 EXPECT_GT(expected_page_id_2, expected_page_id); 1077 EXPECT_GT(expected_page_id_2, expected_page_id);
1078 view()->OnSetHistoryLengthAndPrune(2, -1); 1078 view()->OnSetHistoryLengthAndPrune(2, -1);
1079 EXPECT_EQ(4, view()->history_list_length_); 1079 EXPECT_EQ(4, view()->history_list_length_);
1080 EXPECT_EQ(3, view()->history_list_offset_); 1080 EXPECT_EQ(3, view()->history_list_offset_);
1081 EXPECT_EQ(-1, view()->history_page_ids_[0]); 1081 EXPECT_EQ(-1, view()->history_page_ids_[0]);
1082 EXPECT_EQ(-1, view()->history_page_ids_[1]); 1082 EXPECT_EQ(-1, view()->history_page_ids_[1]);
1083 EXPECT_EQ(expected_page_id, view()->history_page_ids_[2]); 1083 EXPECT_EQ(expected_page_id, view()->history_page_ids_[2]);
1084 EXPECT_EQ(expected_page_id_2, view()->history_page_ids_[3]); 1084 EXPECT_EQ(expected_page_id_2, view()->history_page_ids_[3]);
1085 } 1085 }
OLDNEW
« no previous file with comments | « content/renderer/mock_content_renderer_client.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698