| 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 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 UpdateProviderPolicy(policies); | 1857 UpdateProviderPolicy(policies); |
| 1858 ui_test_utils::NavigateToURL(browser(), url); | 1858 ui_test_utils::NavigateToURL(browser(), url); |
| 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 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 |
| 1868 if (TranslateService::IsTranslateBubbleEnabled()) |
| 1869 return; |
| 1870 |
| 1867 test::ScopedCLDDynamicDataHarness dynamic_data_scope; | 1871 test::ScopedCLDDynamicDataHarness dynamic_data_scope; |
| 1868 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); | 1872 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); |
| 1869 TranslateService::SetUseInfobar(true); | |
| 1870 | 1873 |
| 1871 // Verifies that translate can be forced enabled or disabled by policy. | 1874 // Verifies that translate can be forced enabled or disabled by policy. |
| 1872 | 1875 |
| 1873 // Get the InfoBarService, and verify that there are no infobars on startup. | 1876 // Get the InfoBarService, and verify that there are no infobars on startup. |
| 1874 content::WebContents* contents = | 1877 content::WebContents* contents = |
| 1875 browser()->tab_strip_model()->GetActiveWebContents(); | 1878 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1876 ASSERT_TRUE(contents); | 1879 ASSERT_TRUE(contents); |
| 1877 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 1880 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
| 1878 ASSERT_TRUE(infobar_service); | 1881 ASSERT_TRUE(infobar_service); |
| 1879 EXPECT_EQ(0u, infobar_service->infobar_count()); | 1882 EXPECT_EQ(0u, infobar_service->infobar_count()); |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2971 PrefService* prefs = browser()->profile()->GetPrefs(); | 2974 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 2972 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2975 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2973 prefs, "host.name")); | 2976 prefs, "host.name")); |
| 2974 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2977 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2975 prefs, "other.host.name")); | 2978 prefs, "other.host.name")); |
| 2976 } | 2979 } |
| 2977 | 2980 |
| 2978 #endif // !defined(CHROME_OS) | 2981 #endif // !defined(CHROME_OS) |
| 2979 | 2982 |
| 2980 } // namespace policy | 2983 } // namespace policy |
| OLD | NEW |