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

Side by Side Diff: chrome/browser/tab_contents/web_contents_unittest.cc

Issue 56135: Adding unit tests for the SafeBrowsingBlockingPage class (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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/tab_contents/interstitial_page.cc ('k') | chrome/test/unit/unittests.vcproj » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "chrome/browser/renderer_host/render_view_host.h" 6 #include "chrome/browser/renderer_host/render_view_host.h"
7 #include "chrome/browser/renderer_host/render_widget_host_view.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view.h"
8 #include "chrome/browser/renderer_host/test_render_view_host.h" 8 #include "chrome/browser/renderer_host/test_render_view_host.h"
9 #include "chrome/browser/tab_contents/interstitial_page.h" 9 #include "chrome/browser/tab_contents/interstitial_page.h"
10 #include "chrome/browser/tab_contents/navigation_controller.h" 10 #include "chrome/browser/tab_contents/navigation_controller.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 delegate_ = delegate; 143 delegate_ = delegate;
144 } 144 }
145 145
146 protected: 146 protected:
147 virtual RenderViewHost* CreateRenderViewHost() { 147 virtual RenderViewHost* CreateRenderViewHost() {
148 return new TestRenderViewHost( 148 return new TestRenderViewHost(
149 SiteInstance::CreateSiteInstance(tab()->profile()), 149 SiteInstance::CreateSiteInstance(tab()->profile()),
150 this, MSG_ROUTING_NONE, NULL); 150 this, MSG_ROUTING_NONE, NULL);
151 } 151 }
152 152
153 virtual WebContentsView* CreateWebContentsView() { return NULL; }
154
155
153 virtual void CommandReceived(const std::string& command) { 156 virtual void CommandReceived(const std::string& command) {
154 command_received_count_++; 157 command_received_count_++;
155 } 158 }
156 159
157 private: 160 private:
158 InterstitialState* state_; 161 InterstitialState* state_;
159 bool* deleted_; 162 bool* deleted_;
160 int command_received_count_; 163 int command_received_count_;
161 Delegate* delegate_; 164 Delegate* delegate_;
162 }; 165 };
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 interstitial = 1099 interstitial =
1097 new TestInterstitialPage(contents(), true, url, &state, &deleted); 1100 new TestInterstitialPage(contents(), true, url, &state, &deleted);
1098 interstitial->Show(); 1101 interstitial->Show();
1099 interstitial->TestDidNavigate(1, url); 1102 interstitial->TestDidNavigate(1, url);
1100 // Simulate a renderer crash. 1103 // Simulate a renderer crash.
1101 interstitial->TestRenderViewGone(); 1104 interstitial->TestRenderViewGone();
1102 // The interstitial should have been dismissed. 1105 // The interstitial should have been dismissed.
1103 EXPECT_TRUE(deleted); 1106 EXPECT_TRUE(deleted);
1104 EXPECT_EQ(TestInterstitialPage::CANCELED, state); 1107 EXPECT_EQ(TestInterstitialPage::CANCELED, state);
1105 } 1108 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/interstitial_page.cc ('k') | chrome/test/unit/unittests.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698