| OLD | NEW |
| 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/offline/offline_load_page.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 6 #include "content/browser/browser_thread.h" | 6 #include "content/browser/browser_thread.h" |
| 7 #include "content/browser/renderer_host/test_render_view_host.h" | 7 #include "content/browser/renderer_host/test_render_view_host.h" |
| 8 #include "content/browser/tab_contents/navigation_entry.h" | 8 #include "content/browser/tab_contents/navigation_entry.h" |
| 9 #include "content/browser/tab_contents/test_tab_contents.h" | 9 #include "content/browser/tab_contents/test_tab_contents.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| 11 | 11 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void OnBlockingPageComplete(bool proceed) { | 58 virtual void OnBlockingPageComplete(bool proceed) { |
| 59 if (proceed) | 59 if (proceed) |
| 60 user_response_ = OK; | 60 user_response_ = OK; |
| 61 else | 61 else |
| 62 user_response_ = CANCEL; | 62 user_response_ = CANCEL; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void Navigate(const char* url, int page_id) { | 65 void Navigate(const char* url, int page_id) { |
| 66 ViewHostMsg_FrameNavigate_Params params; | 66 ViewHostMsg_FrameNavigate_Params params; |
| 67 InitNavigateParams(¶ms, page_id, GURL(url), PageTransition::TYPED); | 67 InitNavigateParams(¶ms, page_id, GURL(url), PageTransition::TYPED); |
| 68 contents()->TestDidNavigate(contents_->render_view_host(), params); | 68 contents()->TestDidNavigate(contents()->render_view_host(), params); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ShowInterstitial(const char* url) { | 71 void ShowInterstitial(const char* url) { |
| 72 (new TestOfflineLoadPage(contents(), GURL(url), this))->Show(); | 72 (new TestOfflineLoadPage(contents(), GURL(url), this))->Show(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Returns the OfflineLoadPage currently showing or NULL if none is | 75 // Returns the OfflineLoadPage currently showing or NULL if none is |
| 76 // showing. | 76 // showing. |
| 77 InterstitialPage* GetOfflineLoadPage() { | 77 InterstitialPage* GetOfflineLoadPage() { |
| 78 return InterstitialPage::GetInterstitialPage(contents()); | 78 return InterstitialPage::GetInterstitialPage(contents()); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // The interstitial should be gone. | 132 // The interstitial should be gone. |
| 133 EXPECT_EQ(CANCEL, user_response()); | 133 EXPECT_EQ(CANCEL, user_response()); |
| 134 EXPECT_FALSE(GetOfflineLoadPage()); | 134 EXPECT_FALSE(GetOfflineLoadPage()); |
| 135 // We did not proceed, the pending entry should be gone. | 135 // We did not proceed, the pending entry should be gone. |
| 136 EXPECT_FALSE(controller().pending_entry()); | 136 EXPECT_FALSE(controller().pending_entry()); |
| 137 // the URL is set back to kURL1. | 137 // the URL is set back to kURL1. |
| 138 EXPECT_EQ(kURL1, contents()->GetURL().spec()); | 138 EXPECT_EQ(kURL1, contents()->GetURL().spec()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace chromeos | 141 } // namespace chromeos |
| OLD | NEW |