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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 56623005: Policy providers all get a SchemaRegistry to work with. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-9-purge-with-callback
Patch Set: rebase Created 7 years, 1 month 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
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 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
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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 #if defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) 1030 #if defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD)
1032 // Set a policy that prevents the first-run dialog from being shown. 1031 // Set a policy that prevents the first-run dialog from being shown.
1033 policy_map_.Set(policy::key::kMetricsReportingEnabled, 1032 policy_map_.Set(policy::key::kMetricsReportingEnabled,
1034 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, 1033 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
1035 base::Value::CreateBooleanValue(false), NULL); 1034 base::Value::CreateBooleanValue(false), NULL);
1036 provider_.UpdateChromePolicy(policy_map_); 1035 provider_.UpdateChromePolicy(policy_map_);
1037 #endif // defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) 1036 #endif // defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD)
1038 1037
1039 EXPECT_CALL(provider_, IsInitializationComplete(_)) 1038 EXPECT_CALL(provider_, IsInitializationComplete(_))
1040 .WillRepeatedly(Return(true)); 1039 .WillRepeatedly(Return(true));
1041 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber());
1042 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); 1040 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
1043 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1041 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1044 } 1042 }
1045 1043
1046 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) 1044 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX)
1047 // http://crbug.com/314819 1045 // http://crbug.com/314819
1048 #define MAYBE_SyncPromoForbidden DISABLED_SyncPromoForbidden 1046 #define MAYBE_SyncPromoForbidden DISABLED_SyncPromoForbidden
1049 #else 1047 #else
1050 #define MAYBE_SyncPromoForbidden SyncPromoForbidden 1048 #define MAYBE_SyncPromoForbidden SyncPromoForbidden
1051 #endif 1049 #endif
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 ASSERT_EQ(1, tab_strip->count()); 1402 ASSERT_EQ(1, tab_strip->count());
1405 EXPECT_EQ("title1.html", 1403 EXPECT_EQ("title1.html",
1406 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1404 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1407 } 1405 }
1408 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1406 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1409 1407
1410 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1408 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1411 // defined(ENABLE_CONFIGURATION_POLICY) 1409 // defined(ENABLE_CONFIGURATION_POLICY)
1412 1410
1413 #endif // !defined(OS_CHROMEOS) 1411 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698