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

Side by Side Diff: chrome/browser/prefs/chrome_command_line_pref_store_unittest.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 <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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 cl3.AppendSwitchASCII(switches::kCipherSuiteBlacklist, 216 cl3.AppendSwitchASCII(switches::kCipherSuiteBlacklist,
217 "0x0004;MOAR;0x0005"); 217 "0x0004;MOAR;0x0005");
218 scoped_refptr<TestCommandLinePrefStore> store3 = 218 scoped_refptr<TestCommandLinePrefStore> store3 =
219 new TestCommandLinePrefStore(&cl3); 219 new TestCommandLinePrefStore(&cl3);
220 const char* const expected_ciphers3[] = { 220 const char* const expected_ciphers3[] = {
221 "0x0004;MOAR;0x0005" 221 "0x0004;MOAR;0x0005"
222 }; 222 };
223 store3->VerifySSLCipherSuites(expected_ciphers3, 223 store3->VerifySSLCipherSuites(expected_ciphers3,
224 arraysize(expected_ciphers3)); 224 arraysize(expected_ciphers3));
225 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698