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

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: Fixed mac tests 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; 60 using testing::AnyNumber;
bartfab (slow) 2013/11/05 15:53:04 Nit: No longer used.
Joao da Silva 2013/11/07 13:15:00 Done.
61 using testing::Return; 61 using testing::Return;
62 #endif // defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) 62 #endif // defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
63 63
64 using extensions::Extension; 64 using extensions::Extension;
65 65
66 namespace { 66 namespace {
67 67
68 // Check that there are two browsers. Find the one that is not |browser|. 68 // Check that there are two browsers. Find the one that is not |browser|.
69 Browser* FindOneOtherBrowser(Browser* browser) { 69 Browser* FindOneOtherBrowser(Browser* browser) {
70 // There should only be one other browser. 70 // There should only be one other browser.
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 #if defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) 1019 #if defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD)
1020 // Set a policy that prevents the first-run dialog from being shown. 1020 // Set a policy that prevents the first-run dialog from being shown.
1021 policy_map_.Set(policy::key::kMetricsReportingEnabled, 1021 policy_map_.Set(policy::key::kMetricsReportingEnabled,
1022 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, 1022 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
1023 base::Value::CreateBooleanValue(false), NULL); 1023 base::Value::CreateBooleanValue(false), NULL);
1024 provider_.UpdateChromePolicy(policy_map_); 1024 provider_.UpdateChromePolicy(policy_map_);
1025 #endif // defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD) 1025 #endif // defined(OS_LINUX) && defined(GOOGLE_CHROME_BUILD)
1026 1026
1027 EXPECT_CALL(provider_, IsInitializationComplete(_)) 1027 EXPECT_CALL(provider_, IsInitializationComplete(_))
1028 .WillRepeatedly(Return(true)); 1028 .WillRepeatedly(Return(true));
1029 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber());
1030 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); 1029 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
1031 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1030 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1032 } 1031 }
1033 1032
1034 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, SyncPromoForbidden) { 1033 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, SyncPromoForbidden) {
1035 // Consistently enable the welcome page on all platforms. 1034 // Consistently enable the welcome page on all platforms.
1036 first_run::SetShouldShowWelcomePage(); 1035 first_run::SetShouldShowWelcomePage();
1037 1036
1038 // Simulate the following master_preferences: 1037 // Simulate the following master_preferences:
1039 // { 1038 // {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 ASSERT_EQ(1, tab_strip->count()); 1333 ASSERT_EQ(1, tab_strip->count());
1335 EXPECT_EQ("title1.html", 1334 EXPECT_EQ("title1.html",
1336 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1335 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1337 } 1336 }
1338 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1337 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1339 1338
1340 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1339 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1341 // defined(ENABLE_CONFIGURATION_POLICY) 1340 // defined(ENABLE_CONFIGURATION_POLICY)
1342 1341
1343 #endif // !defined(OS_CHROMEOS) 1342 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698