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

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

Issue 178253008: Redoing Issue 36073011: Allowing file:/// in Instant Extended's Most Visited links. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding and using logNavigation(); updating tests; removing ping and the log.html page. Created 6 years, 9 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_tab_helper.h" 5 #include "chrome/browser/ui/search/search_tab_helper.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 "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/search/search.h" 10 #include "chrome/browser/search/search.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 MOCK_METHOD1(OnInstantSupportDetermined, void(bool supports_instant)); 45 MOCK_METHOD1(OnInstantSupportDetermined, void(bool supports_instant));
46 MOCK_METHOD1(OnSetVoiceSearchSupport, void(bool supports_voice_search)); 46 MOCK_METHOD1(OnSetVoiceSearchSupport, void(bool supports_voice_search));
47 MOCK_METHOD1(FocusOmnibox, void(OmniboxFocusState state)); 47 MOCK_METHOD1(FocusOmnibox, void(OmniboxFocusState state));
48 MOCK_METHOD3(NavigateToURL, void(const GURL&, WindowOpenDisposition, bool)); 48 MOCK_METHOD3(NavigateToURL, void(const GURL&, WindowOpenDisposition, bool));
49 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); 49 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url));
50 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); 50 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url));
51 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); 51 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void());
52 MOCK_METHOD1(OnLogEvent, void(NTPLoggingEventType event)); 52 MOCK_METHOD1(OnLogEvent, void(NTPLoggingEventType event));
53 MOCK_METHOD2(OnLogImpression, void(int position, 53 MOCK_METHOD2(OnLogImpression, void(int position,
54 const base::string16& provider)); 54 const base::string16& provider));
55 MOCK_METHOD2(OnLogNavigation, void(int position,
56 const base::string16& provider));
55 MOCK_METHOD1(PasteIntoOmnibox, void(const base::string16&)); 57 MOCK_METHOD1(PasteIntoOmnibox, void(const base::string16&));
56 MOCK_METHOD1(OnChromeIdentityCheck, void(const base::string16& identity)); 58 MOCK_METHOD1(OnChromeIdentityCheck, void(const base::string16& identity));
57 }; 59 };
58 60
59 } // namespace 61 } // namespace
60 62
61 class SearchTabHelperTest : public ChromeRenderViewHostTestHarness { 63 class SearchTabHelperTest : public ChromeRenderViewHostTestHarness {
62 public: 64 public:
63 virtual void SetUp() { 65 virtual void SetUp() {
64 ChromeRenderViewHostTestHarness::SetUp(); 66 ChromeRenderViewHostTestHarness::SetUp();
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 SearchTabHelper::FromWebContents(contents); 333 SearchTabHelper::FromWebContents(contents);
332 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); 334 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper);
333 335
334 // Any other web page shouldn't be redirected when provisional load fails. 336 // Any other web page shouldn't be redirected when provisional load fails.
335 search_tab_helper->DidFailProvisionalLoad(1, base::string16(), true, 337 search_tab_helper->DidFailProvisionalLoad(1, base::string16(), true,
336 GURL("http://www.example.com"), 1, base::string16(), NULL); 338 GURL("http://www.example.com"), 1, base::string16(), NULL);
337 CommitPendingLoad(controller); 339 CommitPendingLoad(controller);
338 EXPECT_NE(GURL(chrome::kChromeSearchLocalNtpUrl), 340 EXPECT_NE(GURL(chrome::kChromeSearchLocalNtpUrl),
339 controller->GetLastCommittedEntry()->GetURL()); 341 controller->GetLastCommittedEntry()->GetURL());
340 } 342 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698