| 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 <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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 UpdateProviderPolicy(policies); | 1858 UpdateProviderPolicy(policies); |
| 1859 ui_test_utils::NavigateToURL(browser(), url); | 1859 ui_test_utils::NavigateToURL(browser(), url); |
| 1860 // Verify that the navigation was saved in the history. | 1860 // Verify that the navigation was saved in the history. |
| 1861 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); | 1861 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); |
| 1862 ASSERT_EQ(1u, enumerator2.urls().size()); | 1862 ASSERT_EQ(1u, enumerator2.urls().size()); |
| 1863 EXPECT_EQ(url, enumerator2.urls()[0]); | 1863 EXPECT_EQ(url, enumerator2.urls()[0]); |
| 1864 } | 1864 } |
| 1865 | 1865 |
| 1866 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. | 1866 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. |
| 1867 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { | 1867 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { |
| 1868 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 |
| 1869 if (TranslateService::IsTranslateBubbleEnabled()) |
| 1870 return; |
| 1871 |
| 1868 test::ScopedCLDDynamicDataHarness dynamic_data_scope; | 1872 test::ScopedCLDDynamicDataHarness dynamic_data_scope; |
| 1869 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); | 1873 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); |
| 1870 TranslateService::SetUseInfobar(true); | |
| 1871 | 1874 |
| 1872 // Verifies that translate can be forced enabled or disabled by policy. | 1875 // Verifies that translate can be forced enabled or disabled by policy. |
| 1873 | 1876 |
| 1874 // Get the InfoBarService, and verify that there are no infobars on startup. | 1877 // Get the InfoBarService, and verify that there are no infobars on startup. |
| 1875 content::WebContents* contents = | 1878 content::WebContents* contents = |
| 1876 browser()->tab_strip_model()->GetActiveWebContents(); | 1879 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1877 ASSERT_TRUE(contents); | 1880 ASSERT_TRUE(contents); |
| 1878 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 1881 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
| 1879 ASSERT_TRUE(infobar_service); | 1882 ASSERT_TRUE(infobar_service); |
| 1880 EXPECT_EQ(0u, infobar_service->infobar_count()); | 1883 EXPECT_EQ(0u, infobar_service->infobar_count()); |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2972 PrefService* prefs = browser()->profile()->GetPrefs(); | 2975 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 2973 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2976 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2974 prefs, "host.name")); | 2977 prefs, "host.name")); |
| 2975 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2978 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2976 prefs, "other.host.name")); | 2979 prefs, "other.host.name")); |
| 2977 } | 2980 } |
| 2978 | 2981 |
| 2979 #endif // !defined(CHROME_OS) | 2982 #endif // !defined(CHROME_OS) |
| 2980 | 2983 |
| 2981 } // namespace policy | 2984 } // namespace policy |
| OLD | NEW |