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

Unified Diff: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc

Issue 9645003: Introduce abstractions to allow embedders to test RenderViewHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index da3100c8a2b4f9631f7d52c4aed8449f2fa2aae0..5e77a1dd22d32db602efeccc0ad5416647f74eb5 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -16,9 +16,10 @@
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/test_render_view_host.h"
+#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/tab_contents/test_tab_contents.h"
#include "content/test/test_browser_thread.h"
+#include "content/test/test_renderer_host.h"
#include "googleurl/src/gurl.h"
#include "ipc/ipc_test_sink.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -38,6 +39,7 @@ using ::testing::SaveArg;
using ::testing::SetArgumentPointee;
using ::testing::StrictMock;
using content::BrowserThread;
+using content::RenderViewHostTester;
namespace {
const bool kFalse = false;
@@ -657,7 +659,7 @@ TEST_F(ClientSideDetectionHostTest, ShouldClassifyUrl) {
// same domain as the previous URL, otherwise it will create a new
// RenderViewHost that won't have the mime type set.
url = GURL("http://host.com/xhtml");
- rvh()->set_contents_mime_type("application/xhtml+xml");
+ rvh_tester()->SetContentsMimeType("application/xhtml+xml");
ExpectPreClassificationChecks(url, &kFalse, &kFalse, &kFalse, &kFalse,
&kFalse, &kFalse);
NavigateAndCommit(url);
@@ -689,7 +691,7 @@ TEST_F(ClientSideDetectionHostTest, ShouldClassifyUrl) {
// same domain as the previous URL, otherwise it will create a new
// RenderViewHost that won't have the mime type set.
url = GURL("http://host2.com/image.jpg");
- rvh()->set_contents_mime_type("image/jpeg");
+ rvh_tester()->SetContentsMimeType("image/jpeg");
ExpectPreClassificationChecks(url, NULL, NULL, NULL, NULL, NULL, NULL);
NavigateAndCommit(url);
WaitAndCheckPreClassificationChecks();
« no previous file with comments | « chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698