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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/chrome_translate_client.h" | 59 #include "chrome/browser/translate/chrome_translate_client.h" |
60 #include "chrome/browser/translate/translate_browser_test_utils.h" | 60 #include "chrome/browser/translate/cld_data_harness.h" |
61 #include "chrome/browser/translate/translate_service.h" | 61 #include "chrome/browser/translate/translate_service.h" |
62 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 62 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
63 #include "chrome/browser/ui/browser.h" | 63 #include "chrome/browser/ui/browser.h" |
64 #include "chrome/browser/ui/browser_commands.h" | 64 #include "chrome/browser/ui/browser_commands.h" |
65 #include "chrome/browser/ui/browser_list.h" | 65 #include "chrome/browser/ui/browser_list.h" |
66 #include "chrome/browser/ui/browser_tabstrip.h" | 66 #include "chrome/browser/ui/browser_tabstrip.h" |
67 #include "chrome/browser/ui/browser_window.h" | 67 #include "chrome/browser/ui/browser_window.h" |
68 #include "chrome/browser/ui/host_desktop.h" | 68 #include "chrome/browser/ui/host_desktop.h" |
69 #include "chrome/browser/ui/omnibox/location_bar.h" | 69 #include "chrome/browser/ui/omnibox/location_bar.h" |
70 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 70 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 ASSERT_EQ(1u, enumerator2.urls().size()); | 1863 ASSERT_EQ(1u, enumerator2.urls().size()); |
1864 EXPECT_EQ(url, enumerator2.urls()[0]); | 1864 EXPECT_EQ(url, enumerator2.urls()[0]); |
1865 } | 1865 } |
1866 | 1866 |
1867 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. | 1867 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. |
1868 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { | 1868 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { |
1869 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 | 1869 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 |
1870 if (TranslateService::IsTranslateBubbleEnabled()) | 1870 if (TranslateService::IsTranslateBubbleEnabled()) |
1871 return; | 1871 return; |
1872 | 1872 |
1873 test::ScopedCLDDynamicDataHarness dynamic_data_scope; | 1873 scoped_ptr<test::CldDataHarness> cld_data_scope = |
1874 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); | 1874 test::CreateCldDataHarness(); |
| 1875 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init()); |
1875 | 1876 |
1876 // Verifies that translate can be forced enabled or disabled by policy. | 1877 // Verifies that translate can be forced enabled or disabled by policy. |
1877 | 1878 |
1878 // Get the InfoBarService, and verify that there are no infobars on startup. | 1879 // Get the InfoBarService, and verify that there are no infobars on startup. |
1879 content::WebContents* contents = | 1880 content::WebContents* contents = |
1880 browser()->tab_strip_model()->GetActiveWebContents(); | 1881 browser()->tab_strip_model()->GetActiveWebContents(); |
1881 ASSERT_TRUE(contents); | 1882 ASSERT_TRUE(contents); |
1882 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 1883 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
1883 ASSERT_TRUE(infobar_service); | 1884 ASSERT_TRUE(infobar_service); |
1884 EXPECT_EQ(0u, infobar_service->infobar_count()); | 1885 EXPECT_EQ(0u, infobar_service->infobar_count()); |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3036 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3037 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3037 browser2->tab_strip_model()->GetActiveWebContents(), | 3038 browser2->tab_strip_model()->GetActiveWebContents(), |
3038 "domAutomationController.send(window.showModalDialog !== undefined);", | 3039 "domAutomationController.send(window.showModalDialog !== undefined);", |
3039 &result)); | 3040 &result)); |
3040 EXPECT_TRUE(result); | 3041 EXPECT_TRUE(result); |
3041 } | 3042 } |
3042 | 3043 |
3043 #endif // !defined(CHROME_OS) | 3044 #endif // !defined(CHROME_OS) |
3044 | 3045 |
3045 } // namespace policy | 3046 } // namespace policy |
OLD | NEW |