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

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: Fix app shell gyp/gn 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 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 // Verify that the navigation was saved in the history. 2378 // Verify that the navigation was saved in the history.
2381 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); 2379 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile());
2382 ASSERT_EQ(1u, enumerator2.urls().size()); 2380 ASSERT_EQ(1u, enumerator2.urls().size());
2383 EXPECT_EQ(url, enumerator2.urls()[0]); 2381 EXPECT_EQ(url, enumerator2.urls()[0]);
2384 } 2382 }
2385 2383
2386 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 2384 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235
2387 #if !defined(USE_AURA) 2385 #if !defined(USE_AURA)
2388 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. 2386 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly.
2389 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { 2387 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
2390 std::unique_ptr<test::CldDataHarness> cld_data_scope =
2391 test::CldDataHarnessFactory::Get()->CreateCldDataHarness();
2392 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init());
2393
2394 // Verifies that translate can be forced enabled or disabled by policy. 2388 // Verifies that translate can be forced enabled or disabled by policy.
2395 2389
2396 // Get the InfoBarService, and verify that there are no infobars on startup. 2390 // Get the InfoBarService, and verify that there are no infobars on startup.
2397 content::WebContents* contents = 2391 content::WebContents* contents =
2398 browser()->tab_strip_model()->GetActiveWebContents(); 2392 browser()->tab_strip_model()->GetActiveWebContents();
2399 ASSERT_TRUE(contents); 2393 ASSERT_TRUE(contents);
2400 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); 2394 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
2401 ASSERT_TRUE(infobar_service); 2395 ASSERT_TRUE(infobar_service);
2402 EXPECT_EQ(0u, infobar_service->infobar_count()); 2396 EXPECT_EQ(0u, infobar_service->infobar_count());
2403 2397
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
4105 4099
4106 SetEmptyPolicy(); 4100 SetEmptyPolicy();
4107 // Policy not set. 4101 // Policy not set.
4108 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4102 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4109 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4103 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4110 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4104 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4111 } 4105 }
4112 #endif // defined(OS_CHROMEOS) 4106 #endif // defined(OS_CHROMEOS)
4113 4107
4114 } // namespace policy 4108 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698