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

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

Issue 2515823002: Remove WebContents::GetRoutingID(). (Closed)
Patch Set: add render_view_host.h include in resource_dispatcher_host_unittest.cc Created 4 years 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
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_tab_helper.h" 5 #include "chrome/browser/ui/search/search_tab_helper.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 SearchTabHelper* search_tab_helper = 139 SearchTabHelper* search_tab_helper =
140 SearchTabHelper::FromWebContents(web_contents()); 140 SearchTabHelper::FromWebContents(web_contents());
141 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); 141 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper);
142 search_tab_helper->ipc_router().set_delegate_for_testing(mock_delegate()); 142 search_tab_helper->ipc_router().set_delegate_for_testing(mock_delegate());
143 search_tab_helper->DetermineIfPageSupportsInstant(); 143 search_tab_helper->DetermineIfPageSupportsInstant();
144 ASSERT_TRUE(MessageWasSent(ChromeViewMsg_DetermineIfPageSupportsInstant::ID)); 144 ASSERT_TRUE(MessageWasSent(ChromeViewMsg_DetermineIfPageSupportsInstant::ID));
145 145
146 std::unique_ptr<IPC::Message> response( 146 std::unique_ptr<IPC::Message> response(
147 new ChromeViewHostMsg_InstantSupportDetermined( 147 new ChromeViewHostMsg_InstantSupportDetermined(
148 web_contents()->GetRoutingID(), 148 web_contents()->GetRenderViewHost()->GetRoutingID(),
149 search_tab_helper->ipc_router().page_seq_no_for_testing(), true)); 149 search_tab_helper->ipc_router().page_seq_no_for_testing(), true));
150 search_tab_helper->ipc_router().OnMessageReceived(*response); 150 search_tab_helper->ipc_router().OnMessageReceived(*response);
151 } 151 }
152 152
153 TEST_F(SearchTabHelperTest, PageURLDoesntBelongToInstantRenderer) { 153 TEST_F(SearchTabHelperTest, PageURLDoesntBelongToInstantRenderer) {
154 // Navigate to a page URL that doesn't belong to Instant renderer. 154 // Navigate to a page URL that doesn't belong to Instant renderer.
155 // SearchTabHelper::DeterminerIfPageSupportsInstant() should return 155 // SearchTabHelper::DeterminerIfPageSupportsInstant() should return
156 // immediately without dispatching any message to the renderer. 156 // immediately without dispatching any message to the renderer.
157 NavigateAndCommit(GURL("http://www.example.com")); 157 NavigateAndCommit(GURL("http://www.example.com"));
158 process()->sink().ClearMessages(); 158 process()->sink().ClearMessages();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 }; 338 };
339 339
340 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { 340 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) {
341 TabTitleObserver title_observer(web_contents()); 341 TabTitleObserver title_observer(web_contents());
342 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); 342 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL));
343 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); 343 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE);
344 EXPECT_EQ(title, title_observer.title_on_start()); 344 EXPECT_EQ(title, title_observer.title_on_start());
345 EXPECT_EQ(title, title_observer.title_on_commit()); 345 EXPECT_EQ(title, title_observer.title_on_commit());
346 EXPECT_EQ(title, web_contents()->GetTitle()); 346 EXPECT_EQ(title, web_contents()->GetTitle());
347 } 347 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router_unittest.cc ('k') | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698