| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer_host/test/test_render_view_host.h" | 5 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_thread.h" | 7 #include "chrome/browser/chrome_thread.h" |
| 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 9 #include "chrome/browser/tab_contents/navigation_entry.h" | 9 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 | 11 |
| 12 using webkit_glue::PasswordForm; | 12 using webkit_glue::PasswordForm; |
| 13 | 13 |
| 14 static const char* kGoogleURL = "http://www.google.com/"; | 14 static const char* kGoogleURL = "http://www.google.com/"; |
| 15 static const char* kGoodURL = "http://www.goodguys.com/"; | 15 static const char* kGoodURL = "http://www.goodguys.com/"; |
| 16 static const char* kBadURL = "http://www.badguys.com/"; | 16 static const char* kBadURL = "http://www.badguys.com/"; |
| 17 static const char* kBadURL2 = "http://www.badguys2.com/"; | 17 static const char* kBadURL2 = "http://www.badguys2.com/"; |
| 18 static const char* kBadURL3 = "http://www.badguys3.com/"; | 18 static const char* kBadURL3 = "http://www.badguys3.com/"; |
| 19 | 19 |
| 20 static void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, | 20 static void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
| 21 int page_id, | 21 int page_id, |
| 22 const GURL& url) { | 22 const GURL& url) { |
| 23 params->page_id = page_id; | 23 params->page_id = page_id; |
| 24 params->url = url; | 24 params->url = url; |
| 25 params->referrer = GURL::EmptyGURL(); | 25 params->referrer = GURL(); |
| 26 params->transition = PageTransition::TYPED; | 26 params->transition = PageTransition::TYPED; |
| 27 params->redirects = std::vector<GURL>(); | 27 params->redirects = std::vector<GURL>(); |
| 28 params->should_update_history = false; | 28 params->should_update_history = false; |
| 29 params->searchable_form_url = GURL::EmptyGURL(); | 29 params->searchable_form_url = GURL(); |
| 30 params->searchable_form_encoding = std::string(); | 30 params->searchable_form_encoding = std::string(); |
| 31 params->password_form = PasswordForm(); | 31 params->password_form = PasswordForm(); |
| 32 params->security_info = std::string(); | 32 params->security_info = std::string(); |
| 33 params->gesture = NavigationGestureUser; | 33 params->gesture = NavigationGestureUser; |
| 34 params->is_post = false; | 34 params->is_post = false; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // A SafeBrowingBlockingPage class that does not create windows. | 37 // A SafeBrowingBlockingPage class that does not create windows. |
| 38 class TestSafeBrowsingBlockingPage : public SafeBrowsingBlockingPage { | 38 class TestSafeBrowsingBlockingPage : public SafeBrowsingBlockingPage { |
| 39 public: | 39 public: |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 ASSERT_TRUE(sb_interstitial); | 399 ASSERT_TRUE(sb_interstitial); |
| 400 | 400 |
| 401 // Let's proceed and make sure everything is OK (bug 17627). | 401 // Let's proceed and make sure everything is OK (bug 17627). |
| 402 ProceedThroughInterstitial(sb_interstitial); | 402 ProceedThroughInterstitial(sb_interstitial); |
| 403 Navigate(kBadURL, 2); // Commit the navigation. | 403 Navigate(kBadURL, 2); // Commit the navigation. |
| 404 sb_interstitial = GetSafeBrowsingBlockingPage(); | 404 sb_interstitial = GetSafeBrowsingBlockingPage(); |
| 405 ASSERT_FALSE(sb_interstitial); | 405 ASSERT_FALSE(sb_interstitial); |
| 406 ASSERT_EQ(2, controller().entry_count()); | 406 ASSERT_EQ(2, controller().entry_count()); |
| 407 EXPECT_EQ(kBadURL, controller().GetActiveEntry()->url().spec()); | 407 EXPECT_EQ(kBadURL, controller().GetActiveEntry()->url().spec()); |
| 408 } | 408 } |
| OLD | NEW |