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

Side by Side Diff: chrome/browser/prefs/chrome_command_line_pref_store_unittest.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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const base::Value* value = NULL; 50 const base::Value* value = NULL;
51 ASSERT_TRUE(GetValue(ssl_config::prefs::kCipherSuiteBlacklist, &value)); 51 ASSERT_TRUE(GetValue(ssl_config::prefs::kCipherSuiteBlacklist, &value));
52 ASSERT_EQ(base::Value::Type::LIST, value->GetType()); 52 ASSERT_EQ(base::Value::Type::LIST, value->GetType());
53 const base::ListValue* list_value = 53 const base::ListValue* list_value =
54 static_cast<const base::ListValue*>(value); 54 static_cast<const base::ListValue*>(value);
55 ASSERT_EQ(cipher_count, list_value->GetSize()); 55 ASSERT_EQ(cipher_count, list_value->GetSize());
56 56
57 std::string cipher_string; 57 std::string cipher_string;
58 for (base::ListValue::const_iterator it = list_value->begin(); 58 for (base::ListValue::const_iterator it = list_value->begin();
59 it != list_value->end(); ++it, ++ciphers) { 59 it != list_value->end(); ++it, ++ciphers) {
60 ASSERT_TRUE(it->GetAsString(&cipher_string)); 60 ASSERT_TRUE((*it)->GetAsString(&cipher_string));
61 EXPECT_EQ(*ciphers, cipher_string); 61 EXPECT_EQ(*ciphers, cipher_string);
62 } 62 }
63 } 63 }
64 64
65 private: 65 private:
66 ~TestCommandLinePrefStore() override {} 66 ~TestCommandLinePrefStore() override {}
67 }; 67 };
68 68
69 // Tests a simple string pref on the command line. 69 // Tests a simple string pref on the command line.
70 TEST(ChromeCommandLinePrefStoreTest, SimpleStringPref) { 70 TEST(ChromeCommandLinePrefStoreTest, SimpleStringPref) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 cl3.AppendSwitchASCII(switches::kCipherSuiteBlacklist, 217 cl3.AppendSwitchASCII(switches::kCipherSuiteBlacklist,
218 "0x0004;MOAR;0x0005"); 218 "0x0004;MOAR;0x0005");
219 scoped_refptr<TestCommandLinePrefStore> store3 = 219 scoped_refptr<TestCommandLinePrefStore> store3 =
220 new TestCommandLinePrefStore(&cl3); 220 new TestCommandLinePrefStore(&cl3);
221 const char* const expected_ciphers3[] = { 221 const char* const expected_ciphers3[] = {
222 "0x0004;MOAR;0x0005" 222 "0x0004;MOAR;0x0005"
223 }; 223 };
224 store3->VerifySSLCipherSuites(expected_ciphers3, 224 store3->VerifySSLCipherSuites(expected_ciphers3,
225 arraysize(expected_ciphers3)); 225 arraysize(expected_ciphers3));
226 } 226 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_prefs_browsertest.cc ('k') | chrome/browser/printing/cloud_print/cloud_print_printer_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698