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

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

Issue 325443002: Move about://-related constants from //content to //url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android ifx Created 6 years, 6 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
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/search_ipc_router.h" 5 #include "chrome/browser/ui/search/search_ipc_router.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 OnMessageReceived(*message); 264 OnMessageReceived(*message);
265 } 265 }
266 266
267 TEST_F(SearchIPCRouterTest, HandleTabChangedEvents) { 267 TEST_F(SearchIPCRouterTest, HandleTabChangedEvents) {
268 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 268 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
269 content::WebContents* contents = web_contents(); 269 content::WebContents* contents = web_contents();
270 EXPECT_EQ(0, browser()->tab_strip_model()->GetIndexOfWebContents(contents)); 270 EXPECT_EQ(0, browser()->tab_strip_model()->GetIndexOfWebContents(contents));
271 EXPECT_TRUE(IsActiveTab(contents)); 271 EXPECT_TRUE(IsActiveTab(contents));
272 272
273 // Add a new tab to deactivate the current tab. 273 // Add a new tab to deactivate the current tab.
274 AddTab(browser(), GURL(content::kAboutBlankURL)); 274 AddTab(browser(), GURL(url::kAboutBlankURL));
275 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 275 EXPECT_EQ(2, browser()->tab_strip_model()->count());
276 EXPECT_EQ(1, browser()->tab_strip_model()->GetIndexOfWebContents(contents)); 276 EXPECT_EQ(1, browser()->tab_strip_model()->GetIndexOfWebContents(contents));
277 EXPECT_EQ(0, browser()->tab_strip_model()->active_index()); 277 EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
278 EXPECT_FALSE(IsActiveTab(contents)); 278 EXPECT_FALSE(IsActiveTab(contents));
279 279
280 // Activate the first tab. 280 // Activate the first tab.
281 browser()->tab_strip_model()->ActivateTabAt(1, false); 281 browser()->tab_strip_model()->ActivateTabAt(1, false);
282 EXPECT_EQ(browser()->tab_strip_model()->active_index(), 282 EXPECT_EQ(browser()->tab_strip_model()->active_index(),
283 browser()->tab_strip_model()->GetIndexOfWebContents(contents)); 283 browser()->tab_strip_model()->GetIndexOfWebContents(contents));
284 EXPECT_TRUE(IsActiveTab(contents)); 284 EXPECT_TRUE(IsActiveTab(contents));
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); 908 NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar"));
909 SetupMockDelegateAndPolicy(); 909 SetupMockDelegateAndPolicy();
910 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); 910 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
911 EXPECT_CALL(*policy, ShouldSendToggleVoiceSearch()).Times(1) 911 EXPECT_CALL(*policy, ShouldSendToggleVoiceSearch()).Times(1)
912 .WillOnce(testing::Return(false)); 912 .WillOnce(testing::Return(false));
913 913
914 process()->sink().ClearMessages(); 914 process()->sink().ClearMessages();
915 GetSearchIPCRouter().ToggleVoiceSearch(); 915 GetSearchIPCRouter().ToggleVoiceSearch();
916 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxToggleVoiceSearch::ID)); 916 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxToggleVoiceSearch::ID));
917 } 917 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_search_prerenderer_unittest.cc ('k') | chrome/browser/ui/singleton_tabs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698