summaryrefslogtreecommitdiffstats
path: root/chrome/browser/find_backend_unittest.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 19:52:40 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 19:52:40 +0000
commit1ef5ad42064c8ef0d1503b68a7fbac01887ca093 (patch)
tree34a32b11a9db6f69fef27e7e81863d82a29bcd2d /chrome/browser/find_backend_unittest.cc
parent59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919 (diff)
downloadchromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.zip
chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.gz
chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.bz2
Reverting 14005.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/find_backend_unittest.cc')
-rw-r--r--chrome/browser/find_backend_unittest.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/chrome/browser/find_backend_unittest.cc b/chrome/browser/find_backend_unittest.cc
index 260e897..2a2dba4 100644
--- a/chrome/browser/find_backend_unittest.cc
+++ b/chrome/browser/find_backend_unittest.cc
@@ -15,13 +15,16 @@ TEST_F(FindBackendTest, InternalState) {
EXPECT_EQ(string16(), contents()->find_text());
// Get another WebContents object ready.
- TestWebContents contents2(profile_.get(), NULL);
+ WebContents* contents2 = new TestWebContents(profile_.get(), NULL);
+ NavigationController* controller2 =
+ new NavigationController(contents2, profile_.get());
+ contents2->set_controller(controller2);
// No search has still been issued, strings should be blank.
EXPECT_EQ(string16(), contents()->find_prepopulate_text());
EXPECT_EQ(string16(), contents()->find_text());
- EXPECT_EQ(string16(), contents2.find_prepopulate_text());
- EXPECT_EQ(string16(), contents2.find_text());
+ EXPECT_EQ(string16(), contents2->find_prepopulate_text());
+ EXPECT_EQ(string16(), contents2->find_text());
string16 search_term1 = L" I had a 401K ";
string16 search_term2 = L" but the economy ";
@@ -34,18 +37,18 @@ TEST_F(FindBackendTest, InternalState) {
// should not.
EXPECT_EQ(search_term1, contents()->find_prepopulate_text());
EXPECT_EQ(search_term1, contents()->find_text());
- EXPECT_EQ(search_term1, contents2.find_prepopulate_text());
- EXPECT_EQ(string16(), contents2.find_text());
+ EXPECT_EQ(search_term1, contents2->find_prepopulate_text());
+ EXPECT_EQ(string16(), contents2->find_text());
// Now search in the other WebContents.
- contents2.StartFinding(search_term2, true); // true=forward.
+ contents2->StartFinding(search_term2, true); // true=forward.
// Again, pre-populate string should always match between the two, but
// find_text should not.
EXPECT_EQ(search_term2, contents()->find_prepopulate_text());
EXPECT_EQ(search_term1, contents()->find_text());
- EXPECT_EQ(search_term2, contents2.find_prepopulate_text());
- EXPECT_EQ(search_term2, contents2.find_text());
+ EXPECT_EQ(search_term2, contents2->find_prepopulate_text());
+ EXPECT_EQ(search_term2, contents2->find_text());
// Search again in the first WebContents.
contents()->StartFinding(search_term3, true); // true=forward.
@@ -54,6 +57,8 @@ TEST_F(FindBackendTest, InternalState) {
// find_text should not.
EXPECT_EQ(search_term3, contents()->find_prepopulate_text());
EXPECT_EQ(search_term3, contents()->find_text());
- EXPECT_EQ(search_term3, contents2.find_prepopulate_text());
- EXPECT_EQ(search_term2, contents2.find_text());
+ EXPECT_EQ(search_term3, contents2->find_prepopulate_text());
+ EXPECT_EQ(search_term2, contents2->find_text());
+
+ contents2->CloseContents();
}