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

Unified Diff: chrome/browser/ui/find_bar/find_backend_unittest.cc

Issue 9706012: Add abstractions that let embedders drive tests of WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove CONTENT_EXPORT on statically linked functions. Merge to head for commit. 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/ui/find_bar/find_backend_unittest.cc
diff --git a/chrome/browser/ui/find_bar/find_backend_unittest.cc b/chrome/browser/ui/find_bar/find_backend_unittest.cc
index ec2ba02c7393398ab5408bdbd18e79d3737f7943..3b761b9a4310a1d23c47fc80de8b379b01b8f1c3 100644
--- a/chrome/browser/ui/find_bar/find_backend_unittest.cc
+++ b/chrome/browser/ui/find_bar/find_backend_unittest.cc
@@ -12,10 +12,13 @@
#include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/tab_contents/test_tab_contents.h"
+#include "content/public/browser/web_contents.h"
#include "content/test/test_browser_thread.h"
+#include "content/test/web_contents_tester.h"
using content::BrowserThread;
+using content::WebContents;
+using content::WebContentsTester;
class FindBackendTest : public TabContentsWrapperTestHarness {
public:
@@ -29,7 +32,7 @@ class FindBackendTest : public TabContentsWrapperTestHarness {
namespace {
-string16 FindPrepopulateText(TabContents* contents) {
+string16 FindPrepopulateText(WebContents* contents) {
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
return FindBarStateFactory::GetLastPrepopulateText(profile);
}
@@ -45,7 +48,8 @@ TEST_F(FindBackendTest, InternalState) {
EXPECT_EQ(string16(), find_tab_helper->find_text());
// Get another TabContents object ready.
- TestTabContents* contents2 = new TestTabContents(profile(), NULL);
+ WebContents* contents2 =
+ WebContentsTester::CreateTestWebContents(profile(), NULL);
TabContentsWrapper wrapper2(contents2);
FindTabHelper* find_tab_helper2 = wrapper2.find_tab_helper();
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_image_model_unittest.cc ('k') | chrome/browser/ui/fullscreen_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698