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

Side by Side Diff: chrome/browser/ui/search/instant_page_unittest.cc

Issue 73613002: InstantExtended: remove old flags, add new flag for query extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/search/instant_page.h" 5 #include "chrome/browser/ui/search/instant_page.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/search/search_tab_helper.h" 9 #include "chrome/browser/ui/search/search_tab_helper.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 bool MessageWasSent(uint32 id) { 55 bool MessageWasSent(uint32 id) {
56 return process()->sink().GetFirstMessageMatching(id) != NULL; 56 return process()->sink().GetFirstMessageMatching(id) != NULL;
57 } 57 }
58 58
59 scoped_ptr<InstantPage> page; 59 scoped_ptr<InstantPage> page;
60 FakePageDelegate delegate; 60 FakePageDelegate delegate;
61 }; 61 };
62 62
63 void InstantPageTest::SetUp() { 63 void InstantPageTest::SetUp() {
64 CommandLine::ForCurrentProcess()->AppendSwitch(
65 switches::kEnableInstantExtendedAPI);
66 ChromeRenderViewHostTestHarness::SetUp(); 64 ChromeRenderViewHostTestHarness::SetUp();
67 SearchTabHelper::CreateForWebContents(web_contents()); 65 SearchTabHelper::CreateForWebContents(web_contents());
68 } 66 }
69 67
70 TEST_F(InstantPageTest, IsLocal) { 68 TEST_F(InstantPageTest, IsLocal) {
71 page.reset(new InstantPage(&delegate, "", NULL, false)); 69 page.reset(new InstantPage(&delegate, "", NULL, false));
72 EXPECT_FALSE(page->supports_instant()); 70 EXPECT_FALSE(page->supports_instant());
73 EXPECT_FALSE(page->IsLocal()); 71 EXPECT_FALSE(page->IsLocal());
74 page->SetContents(web_contents()); 72 page->SetContents(web_contents());
75 NavigateAndCommit(GURL(chrome::kChromeSearchLocalNtpUrl)); 73 NavigateAndCommit(GURL(chrome::kChromeSearchLocalNtpUrl));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); 165 EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID));
168 166
169 // Incognito pages should not get any others. 167 // Incognito pages should not get any others.
170 page->sender()->FocusChanged( 168 page->sender()->FocusChanged(
171 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT); 169 OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT);
172 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID)); 170 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxFocusChanged::ID));
173 171
174 page->sender()->SetInputInProgress(false); 172 page->sender()->SetInputInProgress(false);
175 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID)); 173 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSetInputInProgress::ID));
176 } 174 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc ('k') | chrome/browser/ui/search/local_ntp_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698