Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc

Issue 6713084: Move the rest of the renderer->browser messages that belong in content. Also do a bunch of cleanup: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_unittest.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 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 // This test creates a fake safebrowsing service, where we can inject 5 // This test creates a fake safebrowsing service, where we can inject
6 // malware and phishing urls. It then uses a real browser to go to 6 // malware and phishing urls. It then uses a real browser to go to
7 // these urls, and sends "goback" or "proceed" commands and verifies 7 // these urls, and sends "goback" or "proceed" commands and verifies
8 // they work. 8 // they work.
9 9
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // A MalwareDetails class lets us intercept calls from the renderer. 96 // A MalwareDetails class lets us intercept calls from the renderer.
97 class FakeMalwareDetails : public MalwareDetails { 97 class FakeMalwareDetails : public MalwareDetails {
98 public: 98 public:
99 FakeMalwareDetails(TabContents* tab_contents, 99 FakeMalwareDetails(TabContents* tab_contents,
100 const SafeBrowsingService::UnsafeResource& unsafe_resource) 100 const SafeBrowsingService::UnsafeResource& unsafe_resource)
101 : MalwareDetails(tab_contents, unsafe_resource) { } 101 : MalwareDetails(tab_contents, unsafe_resource) { }
102 102
103 virtual ~FakeMalwareDetails() {} 103 virtual ~FakeMalwareDetails() {}
104 104
105 virtual void AddDOMDetails( 105 virtual void AddDOMDetails(
106 const ViewHostMsg_MalwareDOMDetails_Params& params) { 106 const std::vector<SafeBrowsingHostMsg_MalwareDOMDetails_Node>& params) {
107 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 107 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
108 MalwareDetails::AddDOMDetails(params); 108 MalwareDetails::AddDOMDetails(params);
109 109
110 // Notify the UI thread that we got the dom details. 110 // Notify the UI thread that we got the dom details.
111 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 111 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
112 NewRunnableMethod(this, 112 NewRunnableMethod(this,
113 &FakeMalwareDetails::OnDOMDetailsDone)); 113 &FakeMalwareDetails::OnDOMDetailsDone));
114 } 114 }
115 115
116 void OnDOMDetailsDone() { 116 void OnDOMDetailsDone() {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 prefs::kSafeBrowsingReportingEnabled)); 407 prefs::kSafeBrowsingReportingEnabled));
408 408
409 SendCommand("\"proceed\""); // Simulate the user clicking "back" 409 SendCommand("\"proceed\""); // Simulate the user clicking "back"
410 AssertNoInterstitial(); // Assert the interstitial is gone 410 AssertNoInterstitial(); // Assert the interstitial is gone
411 411
412 EXPECT_EQ(url, browser()->GetSelectedTabContents()->GetURL()); 412 EXPECT_EQ(url, browser()->GetSelectedTabContents()->GetURL());
413 AssertReportSent(); 413 AssertReportSent();
414 } 414 }
415 415
416 } // namespace 416 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_unittest.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698