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

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

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Comment Updates Created 3 years, 9 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // and have the correct state while those not representing |value| are 448 // and have the correct state while those not representing |value| are
449 // invisible. 449 // invisible.
450 if (!controlled_by.empty()) { 450 if (!controlled_by.empty()) {
451 EXPECT_GT(indicators->GetSize(), 0u) 451 EXPECT_GT(indicators->GetSize(), 0u)
452 << "Expected to find at least one controlled setting indicator."; 452 << "Expected to find at least one controlled setting indicator.";
453 } 453 }
454 bool have_visible_indicators = false; 454 bool have_visible_indicators = false;
455 for (base::ListValue::const_iterator indicator = indicators->begin(); 455 for (base::ListValue::const_iterator indicator = indicators->begin();
456 indicator != indicators->end(); ++indicator) { 456 indicator != indicators->end(); ++indicator) {
457 const base::DictionaryValue* properties = NULL; 457 const base::DictionaryValue* properties = NULL;
458 ASSERT_TRUE((*indicator)->GetAsDictionary(&properties)); 458 ASSERT_TRUE(indicator->GetAsDictionary(&properties));
459 std::string indicator_value; 459 std::string indicator_value;
460 std::string indicator_controlled_by; 460 std::string indicator_controlled_by;
461 bool indicator_readonly; 461 bool indicator_readonly;
462 bool indicator_visible; 462 bool indicator_visible;
463 EXPECT_TRUE(properties->GetString("value", &indicator_value)); 463 EXPECT_TRUE(properties->GetString("value", &indicator_value));
464 EXPECT_TRUE(properties->GetString("controlledBy", 464 EXPECT_TRUE(properties->GetString("controlledBy",
465 &indicator_controlled_by)); 465 &indicator_controlled_by));
466 EXPECT_TRUE(properties->GetBoolean("readOnly", &indicator_readonly)); 466 EXPECT_TRUE(properties->GetBoolean("readOnly", &indicator_readonly));
467 EXPECT_TRUE(properties->GetBoolean("visible", &indicator_visible)); 467 EXPECT_TRUE(properties->GetBoolean("visible", &indicator_visible));
468 if (!controlled_by.empty() && (indicator_value == value)) { 468 if (!controlled_by.empty() && (indicator_value == value)) {
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 } 782 }
783 } 783 }
784 } 784 }
785 } 785 }
786 786
787 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, 787 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance,
788 PolicyPrefIndicatorTest, 788 PolicyPrefIndicatorTest,
789 testing::ValuesIn(SplitPoliciesIntoChunks(10))); 789 testing::ValuesIn(SplitPoliciesIntoChunks(10)));
790 790
791 } // namespace policy 791 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698