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

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

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge error in chrome/browser/BUILD.gn Created 6 years, 2 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 | Annotate | Revision Log
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "chrome/browser/policy/profile_policy_connector.h" 52 #include "chrome/browser/policy/profile_policy_connector.h"
53 #include "chrome/browser/policy/profile_policy_connector_factory.h" 53 #include "chrome/browser/policy/profile_policy_connector_factory.h"
54 #include "chrome/browser/prefs/session_startup_pref.h" 54 #include "chrome/browser/prefs/session_startup_pref.h"
55 #include "chrome/browser/profiles/profile.h" 55 #include "chrome/browser/profiles/profile.h"
56 #include "chrome/browser/search/instant_service.h" 56 #include "chrome/browser/search/instant_service.h"
57 #include "chrome/browser/search/instant_service_factory.h" 57 #include "chrome/browser/search/instant_service_factory.h"
58 #include "chrome/browser/search/search.h" 58 #include "chrome/browser/search/search.h"
59 #include "chrome/browser/search_engines/template_url_service_factory.h" 59 #include "chrome/browser/search_engines/template_url_service_factory.h"
60 #include "chrome/browser/translate/chrome_translate_client.h" 60 #include "chrome/browser/translate/chrome_translate_client.h"
61 #include "chrome/browser/translate/cld_data_harness.h" 61 #include "chrome/browser/translate/cld_data_harness.h"
62 #include "chrome/browser/translate/cld_data_harness_factory.h"
62 #include "chrome/browser/translate/translate_service.h" 63 #include "chrome/browser/translate/translate_service.h"
63 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 64 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
64 #include "chrome/browser/ui/browser.h" 65 #include "chrome/browser/ui/browser.h"
65 #include "chrome/browser/ui/browser_commands.h" 66 #include "chrome/browser/ui/browser_commands.h"
66 #include "chrome/browser/ui/browser_list.h" 67 #include "chrome/browser/ui/browser_list.h"
67 #include "chrome/browser/ui/browser_tabstrip.h" 68 #include "chrome/browser/ui/browser_tabstrip.h"
68 #include "chrome/browser/ui/browser_window.h" 69 #include "chrome/browser/ui/browser_window.h"
69 #include "chrome/browser/ui/host_desktop.h" 70 #include "chrome/browser/ui/host_desktop.h"
70 #include "chrome/browser/ui/location_bar/location_bar.h" 71 #include "chrome/browser/ui/location_bar/location_bar.h"
71 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" 72 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 EXPECT_EQ(url, enumerator2.urls()[0]); 2050 EXPECT_EQ(url, enumerator2.urls()[0]);
2050 } 2051 }
2051 2052
2052 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. 2053 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly.
2053 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { 2054 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
2054 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 2055 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235
2055 if (TranslateService::IsTranslateBubbleEnabled()) 2056 if (TranslateService::IsTranslateBubbleEnabled())
2056 return; 2057 return;
2057 2058
2058 scoped_ptr<test::CldDataHarness> cld_data_scope = 2059 scoped_ptr<test::CldDataHarness> cld_data_scope =
2059 test::CreateCldDataHarness(); 2060 test::CldDataHarnessFactory::Get()->CreateCldDataHarness();
2060 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init()); 2061 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init());
2061 2062
2062 // Verifies that translate can be forced enabled or disabled by policy. 2063 // Verifies that translate can be forced enabled or disabled by policy.
2063 2064
2064 // Get the InfoBarService, and verify that there are no infobars on startup. 2065 // Get the InfoBarService, and verify that there are no infobars on startup.
2065 content::WebContents* contents = 2066 content::WebContents* contents =
2066 browser()->tab_strip_model()->GetActiveWebContents(); 2067 browser()->tab_strip_model()->GetActiveWebContents();
2067 ASSERT_TRUE(contents); 2068 ASSERT_TRUE(contents);
2068 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); 2069 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
2069 ASSERT_TRUE(infobar_service); 2070 ASSERT_TRUE(infobar_service);
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3286 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( 3287 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
3287 browser2->tab_strip_model()->GetActiveWebContents(), 3288 browser2->tab_strip_model()->GetActiveWebContents(),
3288 "domAutomationController.send(window.showModalDialog !== undefined);", 3289 "domAutomationController.send(window.showModalDialog !== undefined);",
3289 &result)); 3290 &result));
3290 EXPECT_TRUE(result); 3291 EXPECT_TRUE(result);
3291 } 3292 }
3292 3293
3293 #endif // !defined(CHROME_OS) 3294 #endif // !defined(CHROME_OS)
3294 3295
3295 } // namespace policy 3296 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698