Index: tools/json_schema_compiler/test/permission_features_unittest.cc |
diff --git a/tools/json_schema_compiler/test/permission_features_unittest.cc b/tools/json_schema_compiler/test/permission_features_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..113936ce89049e2dbe1a19081ef7b0656e3284a4 |
--- /dev/null |
+++ b/tools/json_schema_compiler/test/permission_features_unittest.cc |
@@ -0,0 +1,24 @@ |
+// Copyright (c) 2013 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 <string> |
not at google - send to devlin
2013/09/18 19:48:31
just features_unittest.cc
dhnishi (use Chromium)
2013/09/18 22:00:23
Done.
|
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+#include "tools/json_schema_compiler/test/test_permission_features.h" |
+ |
+using test::features::PermissionFeatures; |
+ |
+TEST(FeaturesGeneratorTest, FromString) { |
+ PermissionFeatures test_features = PermissionFeatures(); |
not at google - send to devlin
2013/09/18 19:48:31
just
PermissionFeatures test_features;
same belo
dhnishi (use Chromium)
2013/09/18 22:00:23
Done.
|
+ ASSERT_EQ(PermissionFeatures::kSimple, test_features.FromString("simple")); |
+ ASSERT_EQ(PermissionFeatures::kComplex, test_features.FromString("complex")); |
not at google - send to devlin
2013/09/18 19:48:31
for all, prefer EXPECT over ASSERT.
dhnishi (use Chromium)
2013/09/18 22:00:23
Done.
|
+} |
+ |
+TEST(FeaturesGeneratorTest, ToString) { |
+ PermissionFeatures test_features = PermissionFeatures(); |
+ ASSERT_EQ("simple", |
+ std::string(test_features.ToString(PermissionFeatures::kSimple))); |
+ ASSERT_EQ("complex", |
+ std::string(test_features.ToString(PermissionFeatures::kComplex))); |
not at google - send to devlin
2013/09/18 19:48:31
EXPECT_STREQ, no std::string-ifying.
dhnishi (use Chromium)
2013/09/18 22:00:23
Done.
|
+} |