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

Side by Side Diff: chrome/browser/policy/policy_prefs_browsertest.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 years, 3 months 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 <cstdlib> 6 #include <cstdlib>
7 #include <map> 7 #include <map>
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/ui/browser.h" 29 #include "chrome/browser/ui/browser.h"
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 "components/policy/core/browser/browser_policy_connector.h" 33 #include "components/policy/core/browser/browser_policy_connector.h"
34 #include "components/policy/core/common/external_data_fetcher.h" 34 #include "components/policy/core/common/external_data_fetcher.h"
35 #include "components/policy/core/common/external_data_manager.h" 35 #include "components/policy/core/common/external_data_manager.h"
36 #include "components/policy/core/common/mock_configuration_policy_provider.h" 36 #include "components/policy/core/common/mock_configuration_policy_provider.h"
37 #include "components/policy/core/common/policy_details.h" 37 #include "components/policy/core/common/policy_details.h"
38 #include "components/policy/core/common/policy_map.h" 38 #include "components/policy/core/common/policy_map.h"
39 #include "components/policy/core/common/policy_types.h"
39 #include "components/policy/core/common/schema.h" 40 #include "components/policy/core/common/schema.h"
40 #include "content/public/browser/web_contents.h" 41 #include "content/public/browser/web_contents.h"
41 #include "content/public/test/browser_test_utils.h" 42 #include "content/public/test/browser_test_utils.h"
42 #include "policy/policy_constants.h" 43 #include "policy/policy_constants.h"
43 #include "testing/gmock/include/gmock/gmock.h" 44 #include "testing/gmock/include/gmock/gmock.h"
44 #include "testing/gtest/include/gtest/gtest.h" 45 #include "testing/gtest/include/gtest/gtest.h"
45 #include "url/gurl.h" 46 #include "url/gurl.h"
46 47
47 using testing::Return; 48 using testing::Return;
48 using testing::_; 49 using testing::_;
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 PolicyLevel level) { 513 PolicyLevel level) {
513 PolicyMap policy_map; 514 PolicyMap policy_map;
514 for (base::DictionaryValue::Iterator it(policies); 515 for (base::DictionaryValue::Iterator it(policies);
515 !it.IsAtEnd(); it.Advance()) { 516 !it.IsAtEnd(); it.Advance()) {
516 const PolicyDetails* policy_details = GetChromePolicyDetails(it.key()); 517 const PolicyDetails* policy_details = GetChromePolicyDetails(it.key());
517 ASSERT_TRUE(policy_details); 518 ASSERT_TRUE(policy_details);
518 policy_map.Set( 519 policy_map.Set(
519 it.key(), 520 it.key(),
520 level, 521 level,
521 POLICY_SCOPE_USER, 522 POLICY_SCOPE_USER,
523 POLICY_SOURCE_CLOUD,
522 it.value().DeepCopy(), 524 it.value().DeepCopy(),
523 policy_details->max_external_data_size ? 525 policy_details->max_external_data_size ?
524 new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(), 526 new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(),
525 it.key()) : 527 it.key()) :
526 NULL); 528 NULL);
527 } 529 }
528 provider_.UpdateChromePolicy(policy_map); 530 provider_.UpdateChromePolicy(policy_map);
529 base::RunLoop().RunUntilIdle(); 531 base::RunLoop().RunUntilIdle();
530 } 532 }
531 533
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 } 754 }
753 } 755 }
754 } 756 }
755 } 757 }
756 758
757 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, 759 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance,
758 PolicyPrefIndicatorTest, 760 PolicyPrefIndicatorTest,
759 testing::ValuesIn(SplitPoliciesIntoChunks(10))); 761 testing::ValuesIn(SplitPoliciesIntoChunks(10)));
760 762
761 } // namespace policy 763 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_network_browsertest.cc ('k') | chrome/browser/policy/policy_startup_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698