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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 policies.Set(key::kSavingBrowserHistoryDisabled, POLICY_LEVEL_MANDATORY, | 1369 policies.Set(key::kSavingBrowserHistoryDisabled, POLICY_LEVEL_MANDATORY, |
1370 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false)); | 1370 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false)); |
1371 UpdateProviderPolicy(policies); | 1371 UpdateProviderPolicy(policies); |
1372 ui_test_utils::NavigateToURL(browser(), url); | 1372 ui_test_utils::NavigateToURL(browser(), url); |
1373 // Verify that the navigation was saved in the history. | 1373 // Verify that the navigation was saved in the history. |
1374 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); | 1374 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); |
1375 ASSERT_EQ(1u, enumerator2.urls().size()); | 1375 ASSERT_EQ(1u, enumerator2.urls().size()); |
1376 EXPECT_EQ(url, enumerator2.urls()[0]); | 1376 EXPECT_EQ(url, enumerator2.urls()[0]); |
1377 } | 1377 } |
1378 | 1378 |
1379 IN_PROC_BROWSER_TEST_F(PolicyTest, TranslateEnabled) { | 1379 // Flaky on win7: crbug.com/175439. |
| 1380 #if defined(OS_WIN) |
| 1381 #define MAYBE_TranslateEnabled DISABLED_TranslateEnabled |
| 1382 #else |
| 1383 #define MAYBE_TranslateEnabled TranslateEnabled |
| 1384 #endif |
| 1385 IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_TranslateEnabled) { |
1380 // Verifies that translate can be forced enabled or disabled by policy. | 1386 // Verifies that translate can be forced enabled or disabled by policy. |
1381 | 1387 |
1382 // Get the InfoBarService, and verify that there are no infobars on startup. | 1388 // Get the InfoBarService, and verify that there are no infobars on startup. |
1383 content::WebContents* contents = | 1389 content::WebContents* contents = |
1384 browser()->tab_strip_model()->GetActiveWebContents(); | 1390 browser()->tab_strip_model()->GetActiveWebContents(); |
1385 ASSERT_TRUE(contents); | 1391 ASSERT_TRUE(contents); |
1386 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 1392 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
1387 ASSERT_TRUE(infobar_service); | 1393 ASSERT_TRUE(infobar_service); |
1388 EXPECT_EQ(0u, infobar_service->GetInfoBarCount()); | 1394 EXPECT_EQ(0u, infobar_service->GetInfoBarCount()); |
1389 | 1395 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 this)); | 1881 this)); |
1876 | 1882 |
1877 MessageLoop::current()->Run(); | 1883 MessageLoop::current()->Run(); |
1878 } | 1884 } |
1879 | 1885 |
1880 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, | 1886 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, |
1881 MediaStreamDevicesControllerBrowserTest, | 1887 MediaStreamDevicesControllerBrowserTest, |
1882 testing::Bool()); | 1888 testing::Bool()); |
1883 | 1889 |
1884 } // namespace policy | 1890 } // namespace policy |
OLD | NEW |