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

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

Issue 2034413003: Delete the non-static CLD data source logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to latest master Created 4 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "chrome/browser/policy/profile_policy_connector_factory.h" 67 #include "chrome/browser/policy/profile_policy_connector_factory.h"
68 #include "chrome/browser/prefs/session_startup_pref.h" 68 #include "chrome/browser/prefs/session_startup_pref.h"
69 #include "chrome/browser/profiles/profile.h" 69 #include "chrome/browser/profiles/profile.h"
70 #include "chrome/browser/search/instant_service.h" 70 #include "chrome/browser/search/instant_service.h"
71 #include "chrome/browser/search/instant_service_factory.h" 71 #include "chrome/browser/search/instant_service_factory.h"
72 #include "chrome/browser/search/search.h" 72 #include "chrome/browser/search/search.h"
73 #include "chrome/browser/search_engines/template_url_service_factory.h" 73 #include "chrome/browser/search_engines/template_url_service_factory.h"
74 #include "chrome/browser/ssl/ssl_blocking_page.h" 74 #include "chrome/browser/ssl/ssl_blocking_page.h"
75 #include "chrome/browser/task_management/task_manager_interface.h" 75 #include "chrome/browser/task_management/task_manager_interface.h"
76 #include "chrome/browser/translate/chrome_translate_client.h" 76 #include "chrome/browser/translate/chrome_translate_client.h"
77 #include "chrome/browser/translate/cld_data_harness.h"
78 #include "chrome/browser/translate/cld_data_harness_factory.h"
79 #include "chrome/browser/translate/translate_service.h" 77 #include "chrome/browser/translate/translate_service.h"
80 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 78 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
81 #include "chrome/browser/ui/browser.h" 79 #include "chrome/browser/ui/browser.h"
82 #include "chrome/browser/ui/browser_commands.h" 80 #include "chrome/browser/ui/browser_commands.h"
83 #include "chrome/browser/ui/browser_list.h" 81 #include "chrome/browser/ui/browser_list.h"
84 #include "chrome/browser/ui/browser_tabstrip.h" 82 #include "chrome/browser/ui/browser_tabstrip.h"
85 #include "chrome/browser/ui/browser_window.h" 83 #include "chrome/browser/ui/browser_window.h"
86 #include "chrome/browser/ui/location_bar/location_bar.h" 84 #include "chrome/browser/ui/location_bar/location_bar.h"
87 #include "chrome/browser/ui/tabs/tab_strip_model.h" 85 #include "chrome/browser/ui/tabs/tab_strip_model.h"
88 #include "chrome/common/chrome_paths.h" 86 #include "chrome/common/chrome_paths.h"
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 // Verify that the navigation was saved in the history. 2380 // Verify that the navigation was saved in the history.
2383 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); 2381 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile());
2384 ASSERT_EQ(1u, enumerator2.urls().size()); 2382 ASSERT_EQ(1u, enumerator2.urls().size());
2385 EXPECT_EQ(url, enumerator2.urls()[0]); 2383 EXPECT_EQ(url, enumerator2.urls()[0]);
2386 } 2384 }
2387 2385
2388 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 2386 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235
2389 #if !defined(USE_AURA) 2387 #if !defined(USE_AURA)
2390 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. 2388 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly.
2391 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { 2389 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
2392 std::unique_ptr<test::CldDataHarness> cld_data_scope =
2393 test::CldDataHarnessFactory::Get()->CreateCldDataHarness();
2394 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init());
2395
2396 // Verifies that translate can be forced enabled or disabled by policy. 2390 // Verifies that translate can be forced enabled or disabled by policy.
2397 2391
2398 // Get the InfoBarService, and verify that there are no infobars on startup. 2392 // Get the InfoBarService, and verify that there are no infobars on startup.
2399 content::WebContents* contents = 2393 content::WebContents* contents =
2400 browser()->tab_strip_model()->GetActiveWebContents(); 2394 browser()->tab_strip_model()->GetActiveWebContents();
2401 ASSERT_TRUE(contents); 2395 ASSERT_TRUE(contents);
2402 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); 2396 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
2403 ASSERT_TRUE(infobar_service); 2397 ASSERT_TRUE(infobar_service);
2404 EXPECT_EQ(0u, infobar_service->infobar_count()); 2398 EXPECT_EQ(0u, infobar_service->infobar_count());
2405 2399
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
4103 4097
4104 SetEmptyPolicy(); 4098 SetEmptyPolicy();
4105 // Policy not set. 4099 // Policy not set.
4106 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4100 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4107 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4101 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4108 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4102 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4109 } 4103 }
4110 #endif // defined(OS_CHROMEOS) 4104 #endif // defined(OS_CHROMEOS)
4111 4105
4112 } // namespace policy 4106 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698