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

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

Issue 290413002: Fix browser test to work with dynamic CLD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cld_browsertest
Patch Set: Add call to Init() to workaround gtest macro issues Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "chrome/browser/policy/profile_policy_connector.h" 49 #include "chrome/browser/policy/profile_policy_connector.h"
50 #include "chrome/browser/policy/profile_policy_connector_factory.h" 50 #include "chrome/browser/policy/profile_policy_connector_factory.h"
51 #include "chrome/browser/prefs/session_startup_pref.h" 51 #include "chrome/browser/prefs/session_startup_pref.h"
52 #include "chrome/browser/profiles/profile.h" 52 #include "chrome/browser/profiles/profile.h"
53 #include "chrome/browser/search/instant_service.h" 53 #include "chrome/browser/search/instant_service.h"
54 #include "chrome/browser/search/instant_service_factory.h" 54 #include "chrome/browser/search/instant_service_factory.h"
55 #include "chrome/browser/search/search.h" 55 #include "chrome/browser/search/search.h"
56 #include "chrome/browser/search_engines/template_url.h" 56 #include "chrome/browser/search_engines/template_url.h"
57 #include "chrome/browser/search_engines/template_url_service.h" 57 #include "chrome/browser/search_engines/template_url_service.h"
58 #include "chrome/browser/search_engines/template_url_service_factory.h" 58 #include "chrome/browser/search_engines/template_url_service_factory.h"
59 #include "chrome/browser/translate/translate_browser_test_utils.h"
59 #include "chrome/browser/translate/translate_infobar_delegate.h" 60 #include "chrome/browser/translate/translate_infobar_delegate.h"
60 #include "chrome/browser/translate/translate_service.h" 61 #include "chrome/browser/translate/translate_service.h"
61 #include "chrome/browser/translate/translate_tab_helper.h" 62 #include "chrome/browser/translate/translate_tab_helper.h"
62 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 63 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
63 #include "chrome/browser/ui/browser.h" 64 #include "chrome/browser/ui/browser.h"
64 #include "chrome/browser/ui/browser_commands.h" 65 #include "chrome/browser/ui/browser_commands.h"
65 #include "chrome/browser/ui/browser_list.h" 66 #include "chrome/browser/ui/browser_list.h"
66 #include "chrome/browser/ui/browser_tabstrip.h" 67 #include "chrome/browser/ui/browser_tabstrip.h"
67 #include "chrome/browser/ui/browser_window.h" 68 #include "chrome/browser/ui/browser_window.h"
68 #include "chrome/browser/ui/host_desktop.h" 69 #include "chrome/browser/ui/host_desktop.h"
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 UpdateProviderPolicy(policies); 1856 UpdateProviderPolicy(policies);
1856 ui_test_utils::NavigateToURL(browser(), url); 1857 ui_test_utils::NavigateToURL(browser(), url);
1857 // Verify that the navigation was saved in the history. 1858 // Verify that the navigation was saved in the history.
1858 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); 1859 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile());
1859 ASSERT_EQ(1u, enumerator2.urls().size()); 1860 ASSERT_EQ(1u, enumerator2.urls().size());
1860 EXPECT_EQ(url, enumerator2.urls()[0]); 1861 EXPECT_EQ(url, enumerator2.urls()[0]);
1861 } 1862 }
1862 1863
1863 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. 1864 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly.
1864 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { 1865 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
1866 test::ScopedCLDDynamicDataHarness dynamic_data_scope;
1867 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init());
1865 TranslateService::SetUseInfobar(true); 1868 TranslateService::SetUseInfobar(true);
1866 1869
1867 // Verifies that translate can be forced enabled or disabled by policy. 1870 // Verifies that translate can be forced enabled or disabled by policy.
1868 1871
1869 // 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.
1870 content::WebContents* contents = 1873 content::WebContents* contents =
1871 browser()->tab_strip_model()->GetActiveWebContents(); 1874 browser()->tab_strip_model()->GetActiveWebContents();
1872 ASSERT_TRUE(contents); 1875 ASSERT_TRUE(contents);
1873 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); 1876 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
1874 ASSERT_TRUE(infobar_service); 1877 ASSERT_TRUE(infobar_service);
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 PrefService* prefs = browser()->profile()->GetPrefs(); 2970 PrefService* prefs = browser()->profile()->GetPrefs();
2968 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2971 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2969 prefs, "host.name")); 2972 prefs, "host.name"));
2970 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2973 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2971 prefs, "other.host.name")); 2974 prefs, "other.host.name"));
2972 } 2975 }
2973 2976
2974 #endif // !defined(CHROME_OS) 2977 #endif // !defined(CHROME_OS)
2975 2978
2976 } // namespace policy 2979 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698