Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 31 #include "chrome/test/base/in_process_browser_test.h" | 31 #include "chrome/test/base/in_process_browser_test.h" |
| 32 #include "chrome/test/base/ui_test_utils.h" | 32 #include "chrome/test/base/ui_test_utils.h" |
| 33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 34 #include "content/public/test/browser_test_utils.h" | 34 #include "content/public/test/browser_test_utils.h" |
| 35 #include "policy/policy_constants.h" | 35 #include "policy/policy_constants.h" |
| 36 #include "testing/gmock/include/gmock/gmock.h" | 36 #include "testing/gmock/include/gmock/gmock.h" |
| 37 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
| 38 #include "url/gurl.h" | 38 #include "url/gurl.h" |
| 39 | 39 |
| 40 using testing::AnyNumber; | 40 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.
| |
| 41 using testing::Return; | 41 using testing::Return; |
| 42 using testing::_; | 42 using testing::_; |
| 43 | 43 |
| 44 namespace policy { | 44 namespace policy { |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 const char kMainSettingsPage[] = "chrome://settings-frame"; | 48 const char kMainSettingsPage[] = "chrome://settings-frame"; |
| 49 | 49 |
| 50 const char kCrosSettingsPrefix[] = "cros."; | 50 const char kCrosSettingsPrefix[] = "cros."; |
| (...skipping 331 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()); | |
| 393 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 392 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 394 } | 393 } |
| 395 | 394 |
| 396 virtual void SetUpOnMainThread() OVERRIDE { | 395 virtual void SetUpOnMainThread() OVERRIDE { |
| 397 ui_test_utils::WaitForTemplateURLServiceToLoad( | 396 ui_test_utils::WaitForTemplateURLServiceToLoad( |
| 398 TemplateURLServiceFactory::GetForProfile(browser()->profile())); | 397 TemplateURLServiceFactory::GetForProfile(browser()->profile())); |
| 399 } | 398 } |
| 400 | 399 |
| 401 void UpdateProviderPolicy(const PolicyMap& policy) { | 400 void UpdateProviderPolicy(const PolicyMap& policy) { |
| 402 provider_.UpdateChromePolicy(policy); | 401 provider_.UpdateChromePolicy(policy); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 } | 565 } |
| 567 } | 566 } |
| 568 | 567 |
| 569 INSTANTIATE_TEST_CASE_P( | 568 INSTANTIATE_TEST_CASE_P( |
| 570 PolicyPrefsTestInstance, | 569 PolicyPrefsTestInstance, |
| 571 PolicyPrefsTest, | 570 PolicyPrefsTest, |
| 572 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, | 571 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, |
| 573 GetChromePolicyDefinitionList()->end)); | 572 GetChromePolicyDefinitionList()->end)); |
| 574 | 573 |
| 575 } // namespace policy | 574 } // namespace policy |
| OLD | NEW |