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

Unified Diff: chrome/app_installer/win/app_installer_util_unittest.cc

Issue 689903003: [app_installer] Refactor and add app_installer_unittests target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app_installer/win/app_installer_util.cc ('k') | testing/buildbot/chromium.win.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..68a2e909719db12f03aebf933eb115f6a61647e8
--- /dev/null
+++ b/chrome/app_installer/win/app_installer_util_unittest.cc
@@ -0,0 +1,33 @@
+// 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 <map>
+#include <string>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace app_installer {
+
+TEST(AppInstallerUtilTest, ParseTag) {
+ std::map<std::string, std::string> parsed_pairs;
+
+ 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
« no previous file with comments | « chrome/app_installer/win/app_installer_util.cc ('k') | testing/buildbot/chromium.win.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698