OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/base/chrome_render_view_host_test_harness.h" | 6 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
7 #include "content/public/browser/interstitial_page.h" | 7 #include "content/public/browser/interstitial_page.h" |
8 #include "content/public/browser/navigation_controller.h" | 8 #include "content/public/browser/navigation_controller.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/test/web_contents_tester.h" | 10 #include "content/public/test/web_contents_tester.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 TestOfflineLoadPage(WebContents* web_contents, | 26 TestOfflineLoadPage(WebContents* web_contents, |
27 const GURL& url, | 27 const GURL& url, |
28 OfflineLoadPageTest* test_page) | 28 OfflineLoadPageTest* test_page) |
29 : chromeos::OfflineLoadPage(web_contents, url, CompletionCallback()), | 29 : chromeos::OfflineLoadPage(web_contents, url, CompletionCallback()), |
30 test_page_(test_page) { | 30 test_page_(test_page) { |
31 interstitial_page_->DontCreateViewForTesting(); | 31 interstitial_page_->DontCreateViewForTesting(); |
32 } | 32 } |
33 | 33 |
34 // chromeos::OfflineLoadPage override. | 34 // chromeos::OfflineLoadPage override. |
35 virtual void NotifyBlockingPageComplete(bool proceed) OVERRIDE; | 35 virtual void NotifyBlockingPageComplete(bool proceed) override; |
36 | 36 |
37 private: | 37 private: |
38 OfflineLoadPageTest* test_page_; | 38 OfflineLoadPageTest* test_page_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(TestOfflineLoadPage); | 40 DISALLOW_COPY_AND_ASSIGN(TestOfflineLoadPage); |
41 }; | 41 }; |
42 | 42 |
43 class OfflineLoadPageTest : public ChromeRenderViewHostTestHarness { | 43 class OfflineLoadPageTest : public ChromeRenderViewHostTestHarness { |
44 public: | 44 public: |
45 // The decision the user made. | 45 // The decision the user made. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // The interstitial should be gone. | 136 // The interstitial should be gone. |
137 EXPECT_EQ(CANCEL, user_response()); | 137 EXPECT_EQ(CANCEL, user_response()); |
138 EXPECT_FALSE(GetOfflineLoadPage()); | 138 EXPECT_FALSE(GetOfflineLoadPage()); |
139 // We did not proceed, the pending entry should be gone. | 139 // We did not proceed, the pending entry should be gone. |
140 EXPECT_FALSE(controller().GetPendingEntry()); | 140 EXPECT_FALSE(controller().GetPendingEntry()); |
141 // the URL is set back to kURL1. | 141 // the URL is set back to kURL1. |
142 EXPECT_EQ(kURL1, web_contents()->GetLastCommittedURL().spec()); | 142 EXPECT_EQ(kURL1, web_contents()->GetLastCommittedURL().spec()); |
143 } | 143 } |
144 | 144 |
145 } // namespace chromeos | 145 } // namespace chromeos |
OLD | NEW |