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

Unified Diff: content/common/manifest_util_unittest.cc

Issue 2138973002: Initial CL for talking to the WebAPK server to generate WebAPK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl2 Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/common/manifest_util_unittest.cc
diff --git a/content/common/manifest_util_unittest.cc b/content/common/manifest_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7a24b69c4fba2328df66dc9689ed06961ff47ddb
--- /dev/null
+++ b/content/common/manifest_util_unittest.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 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 "content/public/common/manifest_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace content {
+
+TEST(ManifestUtilTest, WebDisplayModeToString) {
+ for (int display = 0; display < blink::WebDisplayModeLast; ++display) {
+ std::string display_string =
+ WebDisplayModeToString(static_cast<blink::WebDisplayMode>(display));
+ blink::WebDisplayMode converted_display_enum =
+ WebDisplayModeFromString(display_string);
mlamouri (slow - plz ping) 2016/08/04 13:04:26 I don't think this test is working. If you wrote y
pkotwicz 2016/08/04 13:39:37 I am banking on ManifestParserTest#OrientationPars
+ EXPECT_EQ(converted_display_enum, display)
+ << "Incorrect conversion from display enum value to string: " << display
+ << " " << display_string;
+ }
+}
+
+TEST(ManifestUtilTest, WebScreenOrientationLockTypeToString) {
+ for (int orientation = 0;
+ orientation < blink::WebScreenOrientationLockNatural; ++orientation) {
+ std::string orientation_string = WebScreenOrientationLockTypeToString(
+ static_cast<blink::WebScreenOrientationLockType>(orientation));
+ blink::WebScreenOrientationLockType converted_orientation_enum =
+ WebScreenOrientationLockTypeFromString(orientation_string);
+ EXPECT_EQ(converted_orientation_enum, orientation)
+ << "Incorrect conversion from orientation enum value to string: "
+ << orientation << " " << orientation_string;
+ }
+}
+
+// manifest_parser_unittest.cc has additional tests.
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698