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" |
11 | 11 |
12 using content::InterstitialPage; | 12 using content::InterstitialPage; |
13 using content::WebContents; | 13 using content::WebContents; |
14 using content::WebContentsTester; | 14 using content::WebContentsTester; |
15 | 15 |
16 static const char* kURL1 = "http://www.google.com/"; | 16 static const char kURL1[] = "http://www.google.com/"; |
17 static const char* kURL2 = "http://www.gmail.com/"; | 17 static const char kURL2[] = "http://www.gmail.com/"; |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 class OfflineLoadPageTest; | 21 class OfflineLoadPageTest; |
22 | 22 |
23 // An OfflineLoadPage class that does not create windows. | 23 // An OfflineLoadPage class that does not create windows. |
24 class TestOfflineLoadPage : public chromeos::OfflineLoadPage { | 24 class TestOfflineLoadPage : public chromeos::OfflineLoadPage { |
25 public: | 25 public: |
26 TestOfflineLoadPage(WebContents* web_contents, | 26 TestOfflineLoadPage(WebContents* web_contents, |
27 const GURL& url, | 27 const GURL& url, |
(...skipping 108 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 |