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

Unified Diff: extensions/browser/api/media_perception_private/media_perception_private_apitest.cc

Issue 2858353002: MediaPerceptionPrivate API impl and testing. (Closed)
Patch Set: Addressing comments on API implementation. Created 3 years, 7 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: extensions/browser/api/media_perception_private/media_perception_private_apitest.cc
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc b/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a0483ed43f751a9aaabe3d270164557c5f320d57
--- /dev/null
+++ b/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc
@@ -0,0 +1,36 @@
+// Copyright 2017 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/browser/extensions/extension_apitest.h"
+#include "extensions/browser/api/media_perception_private/media_perception_private_api.h"
+#include "extensions/test/extension_test_message_listener.h"
+
+namespace extensions {
+
+class MediaPerceptionPrivateApiTest : public ExtensionApiTest {
+ public:
+ MediaPerceptionPrivateApiTest() {}
+
+ ~MediaPerceptionPrivateApiTest() override {}
+};
+
+// Verify that we can set and get mediaPerception system state.
+IN_PROC_BROWSER_TEST_F(MediaPerceptionPrivateApiTest, State) {
+ ASSERT_TRUE(RunExtensionTest("media_perception_private/state")) << message_;
tbarzic 2017/05/09 01:28:37 can you run this as platform app test? given that
Luke Sorenson 2017/05/09 21:05:45 Done.
+}
+
+// Verify that we can request Diagnostics.
+IN_PROC_BROWSER_TEST_F(MediaPerceptionPrivateApiTest, GetDiagnostics) {
+ ASSERT_TRUE(RunExtensionTest("media_perception_private/diagnostics"))
+ << message_;
+}
+
+// Verify that we can listen for MediaPerceptionDetection signals and handle
+// them.
+IN_PROC_BROWSER_TEST_F(MediaPerceptionPrivateApiTest, MediaPerception) {
+ ASSERT_TRUE(RunExtensionTest("media_perception_private/media_perception"))
+ << message_;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698