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

Unified Diff: content/browser/presentation/presentation_type_converters_unittest.cc

Issue 979413002: [Presentation API] Additional plumbing for PresentationServiceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@REAL-NEW-MASTER
Patch Set: rm presentation_session.mojom Created 5 years, 9 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
« no previous file with comments | « content/browser/presentation/presentation_type_converters.cc ('k') | content/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/presentation/presentation_type_converters_unittest.cc
diff --git a/content/browser/presentation/presentation_type_converters_unittest.cc b/content/browser/presentation/presentation_type_converters_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3107aff3d03fc32c376acbcfa8edabd7d937092b
--- /dev/null
+++ b/content/browser/presentation/presentation_type_converters_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright 2015 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>
+
+#include "content/browser/presentation/presentation_type_converters.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace content {
+
+TEST(PresentationTypeConvertersTest, PresentationSessionInfo) {
+ std::string presentation_url("http://fooUrl");
+ std::string presentation_id("presentationId");
+ PresentationSessionInfo session(presentation_url, presentation_id);
+ presentation::PresentationSessionInfoPtr session_mojo(
+ presentation::PresentationSessionInfo::From(session));
+ EXPECT_FALSE(session_mojo.is_null());
+ EXPECT_EQ(presentation_url, session_mojo->url);
+ EXPECT_EQ(presentation_id, session_mojo->id);
+}
+
+TEST(PresentationTypeConvertersTest, PresentationError) {
+ std::string message("Error message");
+ PresentationError error(PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, message);
+ presentation::PresentationErrorPtr error_mojo(
+ presentation::PresentationError::From(error));
+ EXPECT_FALSE(error_mojo.is_null());
+ EXPECT_EQ(presentation::PRESENTATION_ERROR_TYPE_NO_AVAILABLE_SCREENS,
+ error_mojo->error_type);
+ EXPECT_EQ(message, error_mojo->message);
+}
+
+} // namespace content
« no previous file with comments | « content/browser/presentation/presentation_type_converters.cc ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698