OLD | NEW |
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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/search/search.h" | 8 #include "chrome/browser/search/search.h" |
9 #include "chrome/browser/ui/search/instant_test_utils.h" | 9 #include "chrome/browser/ui/search/instant_test_utils.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 FocusOmnibox(); | 36 FocusOmnibox(); |
37 | 37 |
38 ui_test_utils::NavigateToURLWithDisposition( | 38 ui_test_utils::NavigateToURLWithDisposition( |
39 browser(), | 39 browser(), |
40 ntp_url(), | 40 ntp_url(), |
41 NEW_FOREGROUND_TAB, | 41 NEW_FOREGROUND_TAB, |
42 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | | 42 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | |
43 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 43 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
44 content::WebContents* active_tab = | 44 content::WebContents* active_tab = |
45 browser()->tab_strip_model()->GetActiveWebContents(); | 45 browser()->tab_strip_model()->GetActiveWebContents(); |
46 ASSERT_TRUE(chrome::IsInstantNTP(active_tab)); | 46 ASSERT_TRUE(search::IsInstantNTP(active_tab)); |
47 bool success = false; | 47 bool success = false; |
48 ASSERT_TRUE(GetBoolFromJS(active_tab, "!!runTests()", &success)); | 48 ASSERT_TRUE(GetBoolFromJS(active_tab, "!!runTests()", &success)); |
49 EXPECT_TRUE(success); | 49 EXPECT_TRUE(success); |
50 } | 50 } |
51 | 51 |
52 IN_PROC_BROWSER_TEST_F(LocalNTPTest, | 52 IN_PROC_BROWSER_TEST_F(LocalNTPTest, |
53 NTPRespectsBrowserLanguageSetting) { | 53 NTPRespectsBrowserLanguageSetting) { |
54 // Make sure the default language is not French. | 54 // Make sure the default language is not French. |
55 std::string default_locale = g_browser_process->GetApplicationLocale(); | 55 std::string default_locale = g_browser_process->GetApplicationLocale(); |
56 EXPECT_NE("fr", default_locale); | 56 EXPECT_NE("fr", default_locale); |
(...skipping 22 matching lines...) Expand all Loading... |
79 GURL(chrome::kChromeUINewTabURL), | 79 GURL(chrome::kChromeUINewTabURL), |
80 NEW_FOREGROUND_TAB, | 80 NEW_FOREGROUND_TAB, |
81 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | | 81 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | |
82 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 82 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
83 | 83 |
84 // Verify that the NTP is in French. | 84 // Verify that the NTP is in French. |
85 content::WebContents* active_tab = | 85 content::WebContents* active_tab = |
86 browser()->tab_strip_model()->GetActiveWebContents(); | 86 browser()->tab_strip_model()->GetActiveWebContents(); |
87 EXPECT_EQ(base::ASCIIToUTF16("Nouvel onglet"), active_tab->GetTitle()); | 87 EXPECT_EQ(base::ASCIIToUTF16("Nouvel onglet"), active_tab->GetTitle()); |
88 } | 88 } |
OLD | NEW |