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

Unified Diff: talk/media/base/videoengine_unittest.h

Issue 1309313008: Revert "Move test cases for more natural ordering" (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/base/videoengine_unittest.h
diff --git a/talk/media/base/videoengine_unittest.h b/talk/media/base/videoengine_unittest.h
index 5f00a0eca3c5399508667c93fc3c1257f265a6c5..8fc3729d87ddd318dd35751b43f5b06d3bc37dd7 100644
--- a/talk/media/base/videoengine_unittest.h
+++ b/talk/media/base/videoengine_unittest.h
@@ -40,6 +40,10 @@
#include "webrtc/base/gunit.h"
#include "webrtc/base/timeutils.h"
+#ifdef WIN32
+#include <objbase.h> // NOLINT
+#endif
+
#define EXPECT_FRAME_WAIT(c, w, h, t) \
EXPECT_EQ_WAIT((c), renderer_.num_rendered_frames(), (t)); \
EXPECT_EQ((w), renderer_.width()); \
@@ -135,6 +139,28 @@ class VideoEngineTest : public testing::Test {
engine_.Terminate();
}
+#ifdef WIN32
+ // Tests that the COM reference count is not munged by the engine.
+ // Test to make sure LMI does not munge the CoInitialize reference count.
+ void CheckCoInitialize() {
+ // Initial refcount should be 0.
+ EXPECT_EQ(S_OK, CoInitializeEx(NULL, COINIT_MULTITHREADED));
+
+ // Engine should start even with COM already inited.
+ EXPECT_TRUE(engine_.Init(rtc::Thread::Current()));
+ engine_.Terminate();
+ // Refcount after terminate should be 1; this tests if it is nonzero.
+ EXPECT_EQ(S_FALSE, CoInitializeEx(NULL, COINIT_MULTITHREADED));
+ // Decrement refcount to (hopefully) 0.
+ CoUninitialize();
+ CoUninitialize();
+
+ // Ensure refcount is 0.
+ EXPECT_EQ(S_OK, CoInitializeEx(NULL, COINIT_MULTITHREADED));
+ CoUninitialize();
+ }
+#endif
+
void ConstrainNewCodecBody() {
cricket::VideoCodec empty, in, out;
cricket::VideoCodec max_settings(engine_.codecs()[0].id,
« no previous file with comments | « no previous file | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698