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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdlib> 8 #include <cstdlib>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // and have the correct state while those not representing |value| are 445 // and have the correct state while those not representing |value| are
446 // invisible. 446 // invisible.
447 if (!controlled_by.empty()) { 447 if (!controlled_by.empty()) {
448 EXPECT_GT(indicators->GetSize(), 0u) 448 EXPECT_GT(indicators->GetSize(), 0u)
449 << "Expected to find at least one controlled setting indicator."; 449 << "Expected to find at least one controlled setting indicator.";
450 } 450 }
451 bool have_visible_indicators = false; 451 bool have_visible_indicators = false;
452 for (base::ListValue::const_iterator indicator = indicators->begin(); 452 for (base::ListValue::const_iterator indicator = indicators->begin();
453 indicator != indicators->end(); ++indicator) { 453 indicator != indicators->end(); ++indicator) {
454 const base::DictionaryValue* properties = NULL; 454 const base::DictionaryValue* properties = NULL;
455 ASSERT_TRUE(indicator->GetAsDictionary(&properties)); 455 ASSERT_TRUE((*indicator)->GetAsDictionary(&properties));
456 std::string indicator_value; 456 std::string indicator_value;
457 std::string indicator_controlled_by; 457 std::string indicator_controlled_by;
458 bool indicator_readonly; 458 bool indicator_readonly;
459 bool indicator_visible; 459 bool indicator_visible;
460 EXPECT_TRUE(properties->GetString("value", &indicator_value)); 460 EXPECT_TRUE(properties->GetString("value", &indicator_value));
461 EXPECT_TRUE(properties->GetString("controlledBy", 461 EXPECT_TRUE(properties->GetString("controlledBy",
462 &indicator_controlled_by)); 462 &indicator_controlled_by));
463 EXPECT_TRUE(properties->GetBoolean("readOnly", &indicator_readonly)); 463 EXPECT_TRUE(properties->GetBoolean("readOnly", &indicator_readonly));
464 EXPECT_TRUE(properties->GetBoolean("visible", &indicator_visible)); 464 EXPECT_TRUE(properties->GetBoolean("visible", &indicator_visible));
465 if (!controlled_by.empty() && (indicator_value == value)) { 465 if (!controlled_by.empty() && (indicator_value == value)) {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 766 }
767 } 767 }
768 } 768 }
769 } 769 }
770 770
771 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, 771 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance,
772 PolicyPrefIndicatorTest, 772 PolicyPrefIndicatorTest,
773 testing::ValuesIn(SplitPoliciesIntoChunks(10))); 773 testing::ValuesIn(SplitPoliciesIntoChunks(10)));
774 774
775 } // namespace policy 775 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698