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 <map> | 6 #include <map> |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 // Base class for tests that change policy and are parameterized with a policy | 383 // Base class for tests that change policy and are parameterized with a policy |
384 // definition. | 384 // definition. |
385 class PolicyPrefsTest | 385 class PolicyPrefsTest |
386 : public InProcessBrowserTest, | 386 : public InProcessBrowserTest, |
387 public testing::WithParamInterface<PolicyDefinitionList::Entry> { | 387 public testing::WithParamInterface<PolicyDefinitionList::Entry> { |
388 protected: | 388 protected: |
389 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 389 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
390 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 390 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
391 .WillRepeatedly(Return(true)); | 391 .WillRepeatedly(Return(true)); |
392 EXPECT_CALL(provider_, RegisterPolicyDomain(_, _)).Times(AnyNumber()); | 392 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); |
393 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 393 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
394 } | 394 } |
395 | 395 |
396 virtual void SetUpOnMainThread() OVERRIDE { | 396 virtual void SetUpOnMainThread() OVERRIDE { |
397 ui_test_utils::WaitForTemplateURLServiceToLoad( | 397 ui_test_utils::WaitForTemplateURLServiceToLoad( |
398 TemplateURLServiceFactory::GetForProfile(browser()->profile())); | 398 TemplateURLServiceFactory::GetForProfile(browser()->profile())); |
399 } | 399 } |
400 | 400 |
401 void UpdateProviderPolicy(const PolicyMap& policy) { | 401 void UpdateProviderPolicy(const PolicyMap& policy) { |
402 provider_.UpdateChromePolicy(policy); | 402 provider_.UpdateChromePolicy(policy); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 INSTANTIATE_TEST_CASE_P( | 569 INSTANTIATE_TEST_CASE_P( |
570 PolicyPrefsTestInstance, | 570 PolicyPrefsTestInstance, |
571 PolicyPrefsTest, | 571 PolicyPrefsTest, |
572 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, | 572 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, |
573 GetChromePolicyDefinitionList()->end)); | 573 GetChromePolicyDefinitionList()->end)); |
574 | 574 |
575 } // namespace policy | 575 } // namespace policy |
OLD | NEW |