| 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 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "base/values.h" | 50 #include "base/values.h" |
| 51 #include "chrome/browser/policy/browser_policy_connector.h" | 51 #include "chrome/browser/policy/browser_policy_connector.h" |
| 52 #include "chrome/browser/policy/external_data_fetcher.h" | 52 #include "chrome/browser/policy/external_data_fetcher.h" |
| 53 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 53 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
| 54 #include "chrome/browser/policy/policy_map.h" | 54 #include "chrome/browser/policy/policy_map.h" |
| 55 #include "chrome/browser/policy/policy_types.h" | 55 #include "chrome/browser/policy/policy_types.h" |
| 56 #include "policy/policy_constants.h" | 56 #include "policy/policy_constants.h" |
| 57 #include "testing/gmock/include/gmock/gmock.h" | 57 #include "testing/gmock/include/gmock/gmock.h" |
| 58 | 58 |
| 59 using testing::_; | 59 using testing::_; |
| 60 using testing::AnyNumber; | |
| 61 using testing::Return; | 60 using testing::Return; |
| 62 #endif // defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) | 61 #endif // defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) |
| 63 | 62 |
| 64 using extensions::Extension; | 63 using extensions::Extension; |
| 65 | 64 |
| 66 namespace { | 65 namespace { |
| 67 | 66 |
| 68 // Check that there are two browsers. Find the one that is not |browser|. | 67 // Check that there are two browsers. Find the one that is not |browser|. |
| 69 Browser* FindOneOtherBrowser(Browser* browser) { | 68 Browser* FindOneOtherBrowser(Browser* browser) { |
| 70 // There should only be one other browser. | 69 // There should only be one other browser. |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 #if defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) | 1018 #if defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) |
| 1020 // Set a policy that prevents the first-run dialog from being shown. | 1019 // Set a policy that prevents the first-run dialog from being shown. |
| 1021 policy_map_.Set(policy::key::kMetricsReportingEnabled, | 1020 policy_map_.Set(policy::key::kMetricsReportingEnabled, |
| 1022 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, | 1021 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
| 1023 base::Value::CreateBooleanValue(false), NULL); | 1022 base::Value::CreateBooleanValue(false), NULL); |
| 1024 provider_.UpdateChromePolicy(policy_map_); | 1023 provider_.UpdateChromePolicy(policy_map_); |
| 1025 #endif // defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) | 1024 #endif // defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) |
| 1026 | 1025 |
| 1027 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 1026 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 1028 .WillRepeatedly(Return(true)); | 1027 .WillRepeatedly(Return(true)); |
| 1029 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); | |
| 1030 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 1028 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 1031 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 1029 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 1032 } | 1030 } |
| 1033 | 1031 |
| 1034 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | 1032 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) |
| 1035 // http://crbug.com/314819 | 1033 // http://crbug.com/314819 |
| 1036 #define MAYBE_SyncPromoForbidden DISABLED_SyncPromoForbidden | 1034 #define MAYBE_SyncPromoForbidden DISABLED_SyncPromoForbidden |
| 1037 #else | 1035 #else |
| 1038 #define MAYBE_SyncPromoForbidden SyncPromoForbidden | 1036 #define MAYBE_SyncPromoForbidden SyncPromoForbidden |
| 1039 #endif | 1037 #endif |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 ASSERT_EQ(1, tab_strip->count()); | 1390 ASSERT_EQ(1, tab_strip->count()); |
| 1393 EXPECT_EQ("title1.html", | 1391 EXPECT_EQ("title1.html", |
| 1394 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 1392 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 1395 } | 1393 } |
| 1396 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 1394 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 1397 | 1395 |
| 1398 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || | 1396 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || |
| 1399 // defined(ENABLE_CONFIGURATION_POLICY) | 1397 // defined(ENABLE_CONFIGURATION_POLICY) |
| 1400 | 1398 |
| 1401 #endif // !defined(OS_CHROMEOS) | 1399 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |