Chromium Code Reviews| Index: chrome/browser/ui/search/instant_extended_interactive_uitest.cc |
| diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc |
| index c9a66666bec172e9b272fa08090c8b1459b654b3..40f79f3e1fba83e937904c2786609cc9eb4d883e 100644 |
| --- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc |
| +++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc |
| @@ -22,6 +22,7 @@ |
| #include "chrome/browser/autocomplete/search_provider.h" |
| #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| #include "chrome/browser/bookmarks/bookmark_utils.h" |
| +#include "chrome/browser/browser_process.h" |
| #include "chrome/browser/extensions/extension_browsertest.h" |
| #include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/browser/favicon/favicon_tab_helper.h" |
| @@ -78,6 +79,7 @@ |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "third_party/skia/include/core/SkBitmap.h" |
| #include "ui/base/l10n/l10n_util.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| using testing::HasSubstr; |
| @@ -2897,3 +2899,42 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoMostVisitedChangedOnTabSwitch) { |
| EXPECT_TRUE(UpdateSearchState(active_tab)); |
| EXPECT_EQ(2, on_most_visited_change_calls_); |
| } |
| + |
| +// Flaky on Linux Tests bot. |
| +#if defined(OS_LINUX) |
| +#define MAYBE_NTPRespectsBrowserLanguageSetting DISABLED_NTPRespectsBrowserLanguageSetting |
| +#else |
| +#define MAYBE_NTPRespectsBrowserLanguageSetting NTPRespectsBrowserLanguageSetting |
| +#endif |
| +IN_PROC_BROWSER_TEST_F(InstantExtendedTest, |
| + MAYBE_NTPRespectsBrowserLanguageSetting) { |
|
Jered
2013/06/19 22:29:32
Put this test in local_ntp_browsertest.
kmadhusu
2013/06/21 18:27:58
Done.
|
| + std::string default_locale = g_browser_process->GetApplicationLocale(); |
| + EXPECT_EQ("en-US", default_locale); |
|
Jered
2013/06/19 22:29:32
Why do we need to test the default locale?
kmadhusu
2013/06/21 18:27:58
Before loading "fr" as application locale, I wante
|
| + |
| + // Switch browser language. |
| + std::string loaded_locale = |
| + ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources("fr"); |
| + EXPECT_EQ("fr", loaded_locale); |
| + g_browser_process->SetApplicationLocale(loaded_locale); |
| + PrefService* prefs = g_browser_process->local_state(); |
| + prefs->SetString(prefs::kApplicationLocale, loaded_locale); |
| + |
| + // Setup Instant. |
| + ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| + |
| + // The second argument says to use only the local overlay and NTP. |
| + instant()->SetInstantEnabled(false, true); |
| + FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); |
| + |
| + // Open a new tab. |
| + ui_test_utils::NavigateToURLWithDisposition( |
| + browser(), |
| + GURL(chrome::kChromeUINewTabURL), |
| + NEW_FOREGROUND_TAB, |
| + ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
| + |
| + // Verify that the NTP is in French. |
| + content::WebContents* active_tab = |
| + browser()->tab_strip_model()->GetActiveWebContents(); |
| + EXPECT_EQ(ASCIIToUTF16("Nouvel onglet"), active_tab->GetTitle()); |
| +} |