| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 TabContents* TestTabContents::Clone() { | 42 TabContents* TestTabContents::Clone() { |
| 43 TabContents* tc = new TestTabContents( | 43 TabContents* tc = new TestTabContents( |
| 44 browser_context(), SiteInstance::CreateSiteInstance(browser_context())); | 44 browser_context(), SiteInstance::CreateSiteInstance(browser_context())); |
| 45 tc->controller().CopyStateFrom(controller_); | 45 tc->controller().CopyStateFrom(controller_); |
| 46 return tc; | 46 return tc; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void TestTabContents::NavigateAndCommit(const GURL& url) { | 49 void TestTabContents::NavigateAndCommit(const GURL& url) { |
| 50 controller().LoadURL( | 50 controller().LoadURL( |
| 51 url, GURL(), content::PAGE_TRANSITION_LINK, std::string()); | 51 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); |
| 52 GURL loaded_url(url); | 52 GURL loaded_url(url); |
| 53 bool reverse_on_redirect = false; | 53 bool reverse_on_redirect = false; |
| 54 BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 54 BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 55 &loaded_url, browser_context(), &reverse_on_redirect); | 55 &loaded_url, browser_context(), &reverse_on_redirect); |
| 56 | 56 |
| 57 // LoadURL created a navigation entry, now simulate the RenderView sending | 57 // LoadURL created a navigation entry, now simulate the RenderView sending |
| 58 // a notification that it actually navigated. | 58 // a notification that it actually navigated. |
| 59 CommitPendingNavigation(); | 59 CommitPendingNavigation(); |
| 60 } | 60 } |
| 61 | 61 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 void TestTabContents::SetHistoryLengthAndPrune( | 112 void TestTabContents::SetHistoryLengthAndPrune( |
| 113 const SiteInstance* site_instance, int history_length, int32 min_page_id) { | 113 const SiteInstance* site_instance, int history_length, int32 min_page_id) { |
| 114 EXPECT_TRUE(expect_set_history_length_and_prune_); | 114 EXPECT_TRUE(expect_set_history_length_and_prune_); |
| 115 expect_set_history_length_and_prune_ = false; | 115 expect_set_history_length_and_prune_ = false; |
| 116 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); | 116 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); |
| 117 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, | 117 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, |
| 118 history_length); | 118 history_length); |
| 119 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); | 119 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); |
| 120 } | 120 } |
| OLD | NEW |