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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "chrome/browser/policy/profile_policy_connector.h" | 54 #include "chrome/browser/policy/profile_policy_connector.h" |
55 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 55 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
56 #include "chrome/browser/prefs/session_startup_pref.h" | 56 #include "chrome/browser/prefs/session_startup_pref.h" |
57 #include "chrome/browser/profiles/profile.h" | 57 #include "chrome/browser/profiles/profile.h" |
58 #include "chrome/browser/search/instant_service.h" | 58 #include "chrome/browser/search/instant_service.h" |
59 #include "chrome/browser/search/instant_service_factory.h" | 59 #include "chrome/browser/search/instant_service_factory.h" |
60 #include "chrome/browser/search/search.h" | 60 #include "chrome/browser/search/search.h" |
61 #include "chrome/browser/search_engines/template_url_service_factory.h" | 61 #include "chrome/browser/search_engines/template_url_service_factory.h" |
62 #include "chrome/browser/translate/chrome_translate_client.h" | 62 #include "chrome/browser/translate/chrome_translate_client.h" |
63 #include "chrome/browser/translate/cld_data_harness.h" | 63 #include "chrome/browser/translate/cld_data_harness.h" |
| 64 #include "chrome/browser/translate/cld_data_harness_factory.h" |
64 #include "chrome/browser/translate/translate_service.h" | 65 #include "chrome/browser/translate/translate_service.h" |
65 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 66 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
66 #include "chrome/browser/ui/browser.h" | 67 #include "chrome/browser/ui/browser.h" |
67 #include "chrome/browser/ui/browser_commands.h" | 68 #include "chrome/browser/ui/browser_commands.h" |
68 #include "chrome/browser/ui/browser_list.h" | 69 #include "chrome/browser/ui/browser_list.h" |
69 #include "chrome/browser/ui/browser_tabstrip.h" | 70 #include "chrome/browser/ui/browser_tabstrip.h" |
70 #include "chrome/browser/ui/browser_window.h" | 71 #include "chrome/browser/ui/browser_window.h" |
71 #include "chrome/browser/ui/host_desktop.h" | 72 #include "chrome/browser/ui/host_desktop.h" |
72 #include "chrome/browser/ui/location_bar/location_bar.h" | 73 #include "chrome/browser/ui/location_bar/location_bar.h" |
73 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 74 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
(...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2132 EXPECT_EQ(url, enumerator2.urls()[0]); | 2133 EXPECT_EQ(url, enumerator2.urls()[0]); |
2133 } | 2134 } |
2134 | 2135 |
2135 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. | 2136 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. |
2136 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { | 2137 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { |
2137 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 | 2138 // TODO(port): Test corresponding bubble translate UX: http://crbug.com/383235 |
2138 if (TranslateService::IsTranslateBubbleEnabled()) | 2139 if (TranslateService::IsTranslateBubbleEnabled()) |
2139 return; | 2140 return; |
2140 | 2141 |
2141 scoped_ptr<test::CldDataHarness> cld_data_scope = | 2142 scoped_ptr<test::CldDataHarness> cld_data_scope = |
2142 test::CreateCldDataHarness(); | 2143 test::CldDataHarnessFactory::Get()->CreateCldDataHarness(); |
2143 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init()); | 2144 ASSERT_NO_FATAL_FAILURE(cld_data_scope->Init()); |
2144 | 2145 |
2145 // Verifies that translate can be forced enabled or disabled by policy. | 2146 // Verifies that translate can be forced enabled or disabled by policy. |
2146 | 2147 |
2147 // Get the InfoBarService, and verify that there are no infobars on startup. | 2148 // Get the InfoBarService, and verify that there are no infobars on startup. |
2148 content::WebContents* contents = | 2149 content::WebContents* contents = |
2149 browser()->tab_strip_model()->GetActiveWebContents(); | 2150 browser()->tab_strip_model()->GetActiveWebContents(); |
2150 ASSERT_TRUE(contents); | 2151 ASSERT_TRUE(contents); |
2151 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 2152 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
2152 ASSERT_TRUE(infobar_service); | 2153 ASSERT_TRUE(infobar_service); |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3426 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3427 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3427 browser2->tab_strip_model()->GetActiveWebContents(), | 3428 browser2->tab_strip_model()->GetActiveWebContents(), |
3428 "domAutomationController.send(window.showModalDialog !== undefined);", | 3429 "domAutomationController.send(window.showModalDialog !== undefined);", |
3429 &result)); | 3430 &result)); |
3430 EXPECT_TRUE(result); | 3431 EXPECT_TRUE(result); |
3431 } | 3432 } |
3432 | 3433 |
3433 #endif // !defined(CHROME_OS) | 3434 #endif // !defined(CHROME_OS) |
3434 | 3435 |
3435 } // namespace policy | 3436 } // namespace policy |
OLD | NEW |