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

Side by Side Diff: chrome/common/ini_parser_unittest.cc

Issue 453703002: Move ini_parser from base to chrome/common (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/ini_parser.h" 8 #include "chrome/common/ini_parser.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace base {
12
13 namespace { 11 namespace {
14 12
15 struct TestTriplet { 13 struct TestTriplet {
16 TestTriplet(const std::string& section, 14 TestTriplet(const std::string& section,
17 const std::string& key, 15 const std::string& key,
18 const std::string& value) 16 const std::string& value)
19 : section(section), 17 : section(section),
20 key(key), 18 key(key),
21 value(value) { 19 value(value) {
22 } 20 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 EXPECT_TRUE(root.GetString("section1.key1", &value)); 118 EXPECT_TRUE(root.GetString("section1.key1", &value));
121 EXPECT_EQ("value1", value); 119 EXPECT_EQ("value1", value);
122 EXPECT_FALSE(root.GetString("section1.key.2", &value)); 120 EXPECT_FALSE(root.GetString("section1.key.2", &value));
123 EXPECT_TRUE(root.GetString("section1.key3", &value)); 121 EXPECT_TRUE(root.GetString("section1.key3", &value));
124 EXPECT_EQ("va.lue3", value); 122 EXPECT_EQ("va.lue3", value);
125 EXPECT_FALSE(root.GetString("se.ction2.key.4", &value)); 123 EXPECT_FALSE(root.GetString("se.ction2.key.4", &value));
126 EXPECT_FALSE(root.GetString("se.ction2.key5", &value)); 124 EXPECT_FALSE(root.GetString("se.ction2.key5", &value));
127 } 125 }
128 126
129 } // namespace 127 } // namespace
130
131 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698