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 "content/browser/tab_contents/test_tab_contents.h" | 5 #include "content/browser/tab_contents/test_tab_contents.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "content/browser/browser_url_handler.h" | 9 #include "content/browser/browser_url_handler.h" |
10 #include "content/browser/renderer_host/mock_render_process_host.h" | 10 #include "content/browser/renderer_host/mock_render_process_host.h" |
11 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
12 #include "content/browser/renderer_host/test_render_view_host.h" | 12 #include "content/browser/renderer_host/test_render_view_host.h" |
13 #include "content/browser/site_instance.h" | 13 #include "content/browser/site_instance.h" |
14 #include "content/common/view_messages.h" | 14 #include "content/common/view_messages.h" |
15 #include "content/public/common/page_transition_types.h" | 15 #include "content/public/common/page_transition_types.h" |
16 #include "webkit/glue/password_form.h" | |
17 #include "webkit/glue/webkit_glue.h" | 16 #include "webkit/glue/webkit_glue.h" |
| 17 #include "webkit/forms/password_form.h" |
18 | 18 |
19 TestTabContents::TestTabContents(content::BrowserContext* browser_context, | 19 TestTabContents::TestTabContents(content::BrowserContext* browser_context, |
20 SiteInstance* instance) | 20 SiteInstance* instance) |
21 : TabContents(browser_context, instance, MSG_ROUTING_NONE, NULL, NULL), | 21 : TabContents(browser_context, instance, MSG_ROUTING_NONE, NULL, NULL), |
22 transition_cross_site(false), | 22 transition_cross_site(false), |
23 delegate_view_override_(NULL), | 23 delegate_view_override_(NULL), |
24 expect_set_history_length_and_prune_(false), | 24 expect_set_history_length_and_prune_(false), |
25 expect_set_history_length_and_prune_site_instance_(NULL), | 25 expect_set_history_length_and_prune_site_instance_(NULL), |
26 expect_set_history_length_and_prune_history_length_(0), | 26 expect_set_history_length_and_prune_history_length_(0), |
27 expect_set_history_length_and_prune_min_page_id_(-1) { | 27 expect_set_history_length_and_prune_min_page_id_(-1) { |
(...skipping 27 matching lines...) Expand all Loading... |
55 ViewHostMsg_FrameNavigate_Params params; | 55 ViewHostMsg_FrameNavigate_Params params; |
56 | 56 |
57 params.page_id = page_id; | 57 params.page_id = page_id; |
58 params.url = url; | 58 params.url = url; |
59 params.referrer = referrer; | 59 params.referrer = referrer; |
60 params.transition = transition; | 60 params.transition = transition; |
61 params.redirects = std::vector<GURL>(); | 61 params.redirects = std::vector<GURL>(); |
62 params.should_update_history = false; | 62 params.should_update_history = false; |
63 params.searchable_form_url = GURL(); | 63 params.searchable_form_url = GURL(); |
64 params.searchable_form_encoding = std::string(); | 64 params.searchable_form_encoding = std::string(); |
65 params.password_form = webkit_glue::PasswordForm(); | 65 params.password_form = webkit::forms::PasswordForm(); |
66 params.security_info = std::string(); | 66 params.security_info = std::string(); |
67 params.gesture = NavigationGestureUser; | 67 params.gesture = NavigationGestureUser; |
68 params.was_within_same_page = false; | 68 params.was_within_same_page = false; |
69 params.is_post = false; | 69 params.is_post = false; |
70 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); | 70 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); |
71 | 71 |
72 DidNavigate(render_view_host, params); | 72 DidNavigate(render_view_host, params); |
73 } | 73 } |
74 | 74 |
75 bool TestTabContents::CreateRenderViewForRenderManager( | 75 bool TestTabContents::CreateRenderViewForRenderManager( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 void TestTabContents::SetHistoryLengthAndPrune( | 152 void TestTabContents::SetHistoryLengthAndPrune( |
153 const SiteInstance* site_instance, int history_length, int32 min_page_id) { | 153 const SiteInstance* site_instance, int history_length, int32 min_page_id) { |
154 EXPECT_TRUE(expect_set_history_length_and_prune_); | 154 EXPECT_TRUE(expect_set_history_length_and_prune_); |
155 expect_set_history_length_and_prune_ = false; | 155 expect_set_history_length_and_prune_ = false; |
156 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); | 156 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); |
157 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, | 157 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, |
158 history_length); | 158 history_length); |
159 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); | 159 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); |
160 } | 160 } |
OLD | NEW |