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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 325483003: Remove unused Views Translate InfoBar code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove test-only infobar toggle; no-op tests for incompatible UX. Created 6 years, 6 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 // Verify that the navigation was saved in the history. 1859 // Verify that the navigation was saved in the history.
1860 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); 1860 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile());
1861 ASSERT_EQ(1u, enumerator2.urls().size()); 1861 ASSERT_EQ(1u, enumerator2.urls().size());
1862 EXPECT_EQ(url, enumerator2.urls()[0]); 1862 EXPECT_EQ(url, enumerator2.urls()[0]);
1863 } 1863 }
1864 1864
1865 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. 1865 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly.
1866 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { 1866 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
1867 test::ScopedCLDDynamicDataHarness dynamic_data_scope; 1867 test::ScopedCLDDynamicDataHarness dynamic_data_scope;
1868 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); 1868 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init());
1869 TranslateService::SetUseInfobar(true);
1870 1869
1871 // Verifies that translate can be forced enabled or disabled by policy. 1870 // Verifies that translate can be forced enabled or disabled by policy.
1872 1871
1873 // Get the InfoBarService, and verify that there are no infobars on startup. 1872 // Get the InfoBarService, and verify that there are no infobars on startup.
1874 content::WebContents* contents = 1873 content::WebContents* contents =
1875 browser()->tab_strip_model()->GetActiveWebContents(); 1874 browser()->tab_strip_model()->GetActiveWebContents();
1876 ASSERT_TRUE(contents); 1875 ASSERT_TRUE(contents);
1877 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); 1876 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
1878 ASSERT_TRUE(infobar_service); 1877 ASSERT_TRUE(infobar_service);
1879 EXPECT_EQ(0u, infobar_service->infobar_count()); 1878 EXPECT_EQ(0u, infobar_service->infobar_count());
(...skipping 21 matching lines...) Expand all
1901 ChromeTranslateClient* chrome_translate_client = 1900 ChromeTranslateClient* chrome_translate_client =
1902 ChromeTranslateClient::FromWebContents(contents); 1901 ChromeTranslateClient::FromWebContents(contents);
1903 ASSERT_TRUE(chrome_translate_client); 1902 ASSERT_TRUE(chrome_translate_client);
1904 LanguageState& language_state = chrome_translate_client->GetLanguageState(); 1903 LanguageState& language_state = chrome_translate_client->GetLanguageState();
1905 EXPECT_EQ("fr", language_state.original_language()); 1904 EXPECT_EQ("fr", language_state.original_language());
1906 EXPECT_TRUE(language_state.page_needs_translation()); 1905 EXPECT_TRUE(language_state.page_needs_translation());
1907 EXPECT_FALSE(language_state.translation_pending()); 1906 EXPECT_FALSE(language_state.translation_pending());
1908 EXPECT_FALSE(language_state.translation_declined()); 1907 EXPECT_FALSE(language_state.translation_declined());
1909 EXPECT_FALSE(language_state.IsPageTranslated()); 1908 EXPECT_FALSE(language_state.IsPageTranslated());
1910 1909
1911 // Verify that the translate infobar showed up. 1910 // Verify that the translate infobar showed up.
Takashi Toyoshima 2014/06/11 04:54:32 This test has been disabled because it was flaky,
msw 2014/06/11 07:31:20 Yeah, this also depends on the old infobar UI that
1912 ASSERT_EQ(1u, infobar_service->infobar_count()); 1911 ASSERT_EQ(1u, infobar_service->infobar_count());
1913 infobars::InfoBar* infobar = infobar_service->infobar_at(0); 1912 infobars::InfoBar* infobar = infobar_service->infobar_at(0);
1914 TranslateInfoBarDelegate* translate_infobar_delegate = 1913 TranslateInfoBarDelegate* translate_infobar_delegate =
1915 infobar->delegate()->AsTranslateInfoBarDelegate(); 1914 infobar->delegate()->AsTranslateInfoBarDelegate();
1916 ASSERT_TRUE(translate_infobar_delegate); 1915 ASSERT_TRUE(translate_infobar_delegate);
1917 EXPECT_EQ(translate::TRANSLATE_STEP_BEFORE_TRANSLATE, 1916 EXPECT_EQ(translate::TRANSLATE_STEP_BEFORE_TRANSLATE,
1918 translate_infobar_delegate->translate_step()); 1917 translate_infobar_delegate->translate_step());
1919 EXPECT_EQ("fr", translate_infobar_delegate->original_language_code()); 1918 EXPECT_EQ("fr", translate_infobar_delegate->original_language_code());
1920 1919
1921 // Now force disable translate. 1920 // Now force disable translate.
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 PrefService* prefs = browser()->profile()->GetPrefs(); 2970 PrefService* prefs = browser()->profile()->GetPrefs();
2972 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2971 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2973 prefs, "host.name")); 2972 prefs, "host.name"));
2974 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2973 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2975 prefs, "other.host.name")); 2974 prefs, "other.host.name"));
2976 } 2975 }
2977 2976
2978 #endif // !defined(CHROME_OS) 2977 #endif // !defined(CHROME_OS)
2979 2978
2980 } // namespace policy 2979 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698