OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/app_installer/win/app_installer_util.h" |
| 6 |
| 7 #include <map> |
| 8 #include <string> |
| 9 |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace app_installer { |
| 13 |
| 14 TEST(AppInstallerUtilTest, ParseTag) { |
| 15 std::map<std::string, std::string> parsed_pairs; |
| 16 |
| 17 parsed_pairs.clear(); |
| 18 EXPECT_TRUE(ParseTag("key1=value1&key2=value2", &parsed_pairs)); |
| 19 EXPECT_EQ(2, parsed_pairs.size()); |
| 20 EXPECT_EQ("value1", parsed_pairs["key1"]); |
| 21 EXPECT_EQ("value2", parsed_pairs["key2"]); |
| 22 |
| 23 parsed_pairs.clear(); |
| 24 EXPECT_FALSE(ParseTag("a&b", &parsed_pairs)); |
| 25 |
| 26 parsed_pairs.clear(); |
| 27 EXPECT_FALSE(ParseTag("#=a", &parsed_pairs)); |
| 28 |
| 29 parsed_pairs.clear(); |
| 30 EXPECT_FALSE(ParseTag("a=\01", &parsed_pairs)); |
| 31 } |
| 32 |
| 33 } // namespace app_installer |
OLD | NEW |