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

Unified Diff: chrome/browser/ui/search/search_ipc_router_unittest.cc

Issue 2688453002: NTP: simplify mojo connection setup (Closed)
Patch Set: Merge Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router.cc ('k') | chrome/common/instant.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search_ipc_router_unittest.cc
diff --git a/chrome/browser/ui/search/search_ipc_router_unittest.cc b/chrome/browser/ui/search/search_ipc_router_unittest.cc
index cc5e03bcc9ebf253269d4c5332f4b2d88e696860..ebbc772b591778e60c1739c79afab65192e34359 100644
--- a/chrome/browser/ui/search/search_ipc_router_unittest.cc
+++ b/chrome/browser/ui/search/search_ipc_router_unittest.cc
@@ -183,21 +183,6 @@ class SearchIPCRouterTest : public BrowserWithTestWindowTest {
MockSearchBox mock_search_box_;
};
-TEST_F(SearchIPCRouterTest, IgnoreMessagesFromNonInstantRenderers) {
- NavigateAndCommitActiveTab(GURL("file://foo/bar"));
- SetupMockDelegateAndPolicy();
- EXPECT_CALL(*mock_delegate(), FocusOmnibox(OMNIBOX_FOCUS_VISIBLE)).Times(0);
- content::WebContents* contents = web_contents();
- bool is_active_tab = IsActiveTab(contents);
- EXPECT_TRUE(is_active_tab);
-
- MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
- EXPECT_CALL(*policy, ShouldProcessFocusOmnibox(is_active_tab)).Times(0);
-
- GetSearchIPCRouter().FocusOmnibox(GetSearchIPCRouterSeqNo(),
- OMNIBOX_FOCUS_VISIBLE);
-}
-
TEST_F(SearchIPCRouterTest, ProcessFocusOmniboxMsg) {
NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
SetupMockDelegateAndPolicy();
@@ -434,47 +419,6 @@ TEST_F(SearchIPCRouterTest, IgnoreUndoAllMostVisitedDeletionsMsg) {
GetSearchIPCRouter().UndoAllMostVisitedDeletions(GetSearchIPCRouterSeqNo());
}
-TEST_F(SearchIPCRouterTest, IgnoreMessageIfThePageIsNotActive) {
- NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
- SetupMockDelegateAndPolicy();
- MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy();
- int page_seq_no = GetSearchIPCRouterSeqNo();
-
- content::WebContents* contents = web_contents();
- bool is_active_tab = IsActiveTab(contents);
- GURL item_url("www.foo.com");
-
- // Navigate away from the NTP. Afterwards, all messages should be ignored.
- NavigateAndCommitActiveTab(item_url);
-
- EXPECT_CALL(*mock_delegate(), OnDeleteMostVisitedItem(item_url)).Times(0);
- EXPECT_CALL(*policy, ShouldProcessDeleteMostVisitedItem()).Times(0);
- GetSearchIPCRouter().DeleteMostVisitedItem(page_seq_no, item_url);
-
- EXPECT_CALL(*mock_delegate(), OnUndoMostVisitedDeletion(item_url)).Times(0);
- EXPECT_CALL(*policy, ShouldProcessUndoMostVisitedDeletion()).Times(0);
- GetSearchIPCRouter().UndoMostVisitedDeletion(page_seq_no, item_url);
-
- EXPECT_CALL(*mock_delegate(), OnUndoAllMostVisitedDeletions()).Times(0);
- EXPECT_CALL(*policy, ShouldProcessUndoAllMostVisitedDeletions()).Times(0);
- GetSearchIPCRouter().UndoAllMostVisitedDeletions(page_seq_no);
-
- EXPECT_CALL(*mock_delegate(), FocusOmnibox(OMNIBOX_FOCUS_VISIBLE)).Times(0);
- EXPECT_CALL(*policy, ShouldProcessFocusOmnibox(is_active_tab)).Times(0);
- GetSearchIPCRouter().FocusOmnibox(page_seq_no, OMNIBOX_FOCUS_VISIBLE);
-
- base::TimeDelta delta = base::TimeDelta::FromMilliseconds(123);
- EXPECT_CALL(*mock_delegate(), OnLogEvent(NTP_ALL_TILES_LOADED, delta))
- .Times(0);
- EXPECT_CALL(*policy, ShouldProcessLogEvent()).Times(0);
- GetSearchIPCRouter().LogEvent(page_seq_no, NTP_ALL_TILES_LOADED, delta);
-
- base::string16 text;
- EXPECT_CALL(*mock_delegate(), PasteIntoOmnibox(text)).Times(0);
- EXPECT_CALL(*policy, ShouldProcessPasteIntoOmnibox(is_active_tab)).Times(0);
- GetSearchIPCRouter().PasteAndOpenDropdown(page_seq_no, text);
-}
-
TEST_F(SearchIPCRouterTest, ProcessPasteAndOpenDropdownMsg) {
NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl));
SetupMockDelegateAndPolicy();
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router.cc ('k') | chrome/common/instant.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698