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

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

Issue 2269933002: Instant cleanup: remove MODE_SEARCH_RESULTS and ORIGIN_SEARCH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_url_replacement
Patch Set: review Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 #include "chrome/browser/ui/search/search_model.h" 6 #include "chrome/browser/ui/search/search_model.h"
7 #include "chrome/browser/ui/search/search_tab_helper.h" 7 #include "chrome/browser/ui/search/search_tab_helper.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/test/base/browser_with_test_window_test.h" 9 #include "chrome/test/base/browser_with_test_window_test.h"
10 10
(...skipping 12 matching lines...) Expand all
23 SearchTabHelper::FromWebContents(web_contents)->model()-> 23 SearchTabHelper::FromWebContents(web_contents)->model()->
24 SetMode(SearchMode(SearchMode::MODE_NTP, SearchMode::ORIGIN_NTP)); 24 SetMode(SearchMode(SearchMode::MODE_NTP, SearchMode::ORIGIN_NTP));
25 EXPECT_TRUE(browser()->search_model()->mode().is_ntp()); 25 EXPECT_TRUE(browser()->search_model()->mode().is_ntp());
26 26
27 // Add second tab, make it active, and make sure its mode changes 27 // Add second tab, make it active, and make sure its mode changes
28 // propagate to the browser's search model. 28 // propagate to the browser's search model.
29 AddTab(browser(), GURL("http://foo/1")); 29 AddTab(browser(), GURL("http://foo/1"));
30 browser()->tab_strip_model()->ActivateTabAt(1, true); 30 browser()->tab_strip_model()->ActivateTabAt(1, true);
31 web_contents = browser()->tab_strip_model()->GetWebContentsAt(1); 31 web_contents = browser()->tab_strip_model()->GetWebContentsAt(1);
32 SearchTabHelper::FromWebContents(web_contents)->model()-> 32 SearchTabHelper::FromWebContents(web_contents)->model()->
33 SetMode(SearchMode(SearchMode::MODE_SEARCH_RESULTS, 33 SetMode(SearchMode(SearchMode::MODE_SEARCH_SUGGESTIONS,
34 SearchMode::ORIGIN_DEFAULT)); 34 SearchMode::ORIGIN_DEFAULT));
35 EXPECT_TRUE(browser()->search_model()->mode().is_search()); 35 EXPECT_TRUE(browser()->search_model()->mode().is_search_suggestions());
36 36
37 // The first tab is not active so changes should not propagate. 37 // The first tab is not active so changes should not propagate.
38 web_contents = browser()->tab_strip_model()->GetWebContentsAt(0); 38 web_contents = browser()->tab_strip_model()->GetWebContentsAt(0);
39 SearchTabHelper::FromWebContents(web_contents)->model()-> 39 SearchTabHelper::FromWebContents(web_contents)->model()->
40 SetMode(SearchMode(SearchMode::MODE_NTP, SearchMode::ORIGIN_NTP)); 40 SetMode(SearchMode(SearchMode::MODE_NTP, SearchMode::ORIGIN_NTP));
41 EXPECT_TRUE(browser()->search_model()->mode().is_search()); 41 EXPECT_TRUE(browser()->search_model()->mode().is_search_suggestions());
42 } 42 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/search_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698