OLD | NEW |
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 Loading... |
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 |
OLD | NEW |