Chromium Code Reviews| Index: chrome/app_installer/win/app_installer_util_unittest.cc |
| diff --git a/chrome/app_installer/win/app_installer_util_unittest.cc b/chrome/app_installer/win/app_installer_util_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..91884e31ce5a2500c0c25cab38a7d2d4b898c24a |
| --- /dev/null |
| +++ b/chrome/app_installer/win/app_installer_util_unittest.cc |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/app_installer/win/app_installer_util.h" |
| + |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace app_installer { |
| + |
| +TEST(AppInstallerUtilTest, ParseTag) { |
| + std::map<std::string, std::string> parsed_pairs; |
|
grt (UTC plus 2)
2014/11/07 03:13:36
#include <map>
#include <string>
jackhou1
2014/11/07 05:37:53
Done.
|
| + |
| + parsed_pairs.clear(); |
| + EXPECT_TRUE(ParseTag("key1=value1&key2=value2", &parsed_pairs)); |
| + EXPECT_EQ(2, parsed_pairs.size()); |
| + EXPECT_EQ("value1", parsed_pairs["key1"]); |
| + EXPECT_EQ("value2", parsed_pairs["key2"]); |
| + |
| + parsed_pairs.clear(); |
| + EXPECT_FALSE(ParseTag("a&b", &parsed_pairs)); |
| + |
| + parsed_pairs.clear(); |
| + EXPECT_FALSE(ParseTag("#=a", &parsed_pairs)); |
| + |
| + parsed_pairs.clear(); |
| + EXPECT_FALSE(ParseTag("a=\01", &parsed_pairs)); |
| +} |
| + |
| +} // namespace app_installer |