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

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

Issue 10837240: Search state transitions not working (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE Created 8 years, 4 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 (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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_tabstrip.h" 7 #include "chrome/browser/ui/browser_tabstrip.h"
8 #include "chrome/browser/ui/search/search_model.h" 8 #include "chrome/browser/ui/search/search_model.h"
9 #include "chrome/browser/ui/search/search_tab_helper.h" 9 #include "chrome/browser/ui/search/search_tab_helper.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" 10 #include "chrome/browser/ui/tab_contents/tab_contents.h"
(...skipping 19 matching lines...) Expand all
30 TabContents* contents = chrome::GetTabContentsAt(browser(), 0); 30 TabContents* contents = chrome::GetTabContentsAt(browser(), 0);
31 contents->search_tab_helper()->model()->SetMode(Mode(Mode::MODE_NTP, false)); 31 contents->search_tab_helper()->model()->SetMode(Mode(Mode::MODE_NTP, false));
32 EXPECT_TRUE(browser()->search_model()->mode().is_ntp()); 32 EXPECT_TRUE(browser()->search_model()->mode().is_ntp());
33 33
34 // Add second tab, make it active, and make sure its mode changes 34 // Add second tab, make it active, and make sure its mode changes
35 // propagate to the browser's search model. 35 // propagate to the browser's search model.
36 AddTab(browser(), GURL("http://foo/1")); 36 AddTab(browser(), GURL("http://foo/1"));
37 chrome::ActivateTabAt(browser(), 1, true); 37 chrome::ActivateTabAt(browser(), 1, true);
38 contents = chrome::GetTabContentsAt(browser(), 1); 38 contents = chrome::GetTabContentsAt(browser(), 1);
39 contents->search_tab_helper()->model()->SetMode( 39 contents->search_tab_helper()->model()->SetMode(
40 Mode(Mode::MODE_SEARCH, false)); 40 Mode(Mode::MODE_SEARCH_RESULTS, false));
41 EXPECT_TRUE(browser()->search_model()->mode().is_search()); 41 EXPECT_TRUE(browser()->search_model()->mode().is_search());
42 42
43 // The first tab is not active so changes should not propagate. 43 // The first tab is not active so changes should not propagate.
44 contents = chrome::GetTabContentsAt(browser(), 0); 44 contents = chrome::GetTabContentsAt(browser(), 0);
45 contents->search_tab_helper()->model()->SetMode(Mode(Mode::MODE_NTP, false)); 45 contents->search_tab_helper()->model()->SetMode(Mode(Mode::MODE_NTP, false));
46 EXPECT_TRUE(browser()->search_model()->mode().is_search()); 46 EXPECT_TRUE(browser()->search_model()->mode().is_search());
47 } 47 }
48 48
49 } // namespace search 49 } // namespace search
50 } // namespace chrome 50 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_edit_model.cc ('k') | chrome/browser/ui/search/search_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698