| 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 <list> | 5 #include <list> |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/safe_browsing/malware_details.h" | 10 #include "chrome/browser/safe_browsing/malware_details.h" |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // Now navigate to a bad page triggerring an interstitial. | 541 // Now navigate to a bad page triggerring an interstitial. |
| 542 controller().LoadURL(GURL(kBadURL), content::Referrer(), | 542 controller().LoadURL(GURL(kBadURL), content::Referrer(), |
| 543 ui::PAGE_TRANSITION_TYPED, std::string()); | 543 ui::PAGE_TRANSITION_TYPED, std::string()); |
| 544 int pending_id = controller().GetPendingEntry()->GetUniqueID(); | 544 int pending_id = controller().GetPendingEntry()->GetUniqueID(); |
| 545 ShowInterstitial(false, kBadURL); | 545 ShowInterstitial(false, kBadURL); |
| 546 SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); | 546 SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); |
| 547 ASSERT_TRUE(sb_interstitial); | 547 ASSERT_TRUE(sb_interstitial); |
| 548 | 548 |
| 549 // Proceed, then navigate back. | 549 // Proceed, then navigate back. |
| 550 ProceedThroughInterstitial(sb_interstitial); | 550 ProceedThroughInterstitial(sb_interstitial); |
| 551 Navigate(kBadURL, 2, pending_id, true); // Commit the navigation. | 551 NavigateCrossSite(kBadURL, 2, pending_id, true); // Commit the navigation. |
| 552 GoBack(true); | 552 GoBack(true); |
| 553 | 553 |
| 554 // We are back on the good page. | 554 // We are back on the good page. |
| 555 sb_interstitial = GetSafeBrowsingBlockingPage(); | 555 sb_interstitial = GetSafeBrowsingBlockingPage(); |
| 556 ASSERT_FALSE(sb_interstitial); | 556 ASSERT_FALSE(sb_interstitial); |
| 557 ASSERT_EQ(2, controller().GetEntryCount()); | 557 ASSERT_EQ(2, controller().GetEntryCount()); |
| 558 EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->GetURL().spec()); | 558 EXPECT_EQ(kGoodURL, controller().GetActiveEntry()->GetURL().spec()); |
| 559 | 559 |
| 560 // Navigate forward to the malware URL. | 560 // Navigate forward to the malware URL. |
| 561 web_contents()->GetController().GoForward(); | 561 web_contents()->GetController().GoForward(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 | 676 |
| 677 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 677 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
| 678 prefs::kSafeBrowsingExtendedReportingEnabled)); | 678 prefs::kSafeBrowsingExtendedReportingEnabled)); |
| 679 | 679 |
| 680 // Simulate the user uncheck the report agreement checkbox. | 680 // Simulate the user uncheck the report agreement checkbox. |
| 681 sb_interstitial->SetReportingPreference(false); | 681 sb_interstitial->SetReportingPreference(false); |
| 682 | 682 |
| 683 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 683 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
| 684 prefs::kSafeBrowsingExtendedReportingEnabled)); | 684 prefs::kSafeBrowsingExtendedReportingEnabled)); |
| 685 } | 685 } |
| OLD | NEW |