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

Unified Diff: third_party/WebKit/Source/modules/mediasession/MediaSessionTest.cpp

Issue 1412933005: Revert of Introduce WebMediaSession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: third_party/WebKit/Source/modules/mediasession/MediaSessionTest.cpp
diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSessionTest.cpp b/third_party/WebKit/Source/modules/mediasession/MediaSessionTest.cpp
deleted file mode 100644
index 215dadbd7affa8bd64f5f37f56192f9b4d61b7ec..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/modules/mediasession/MediaSessionTest.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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 "config.h"
-#include "modules/mediasession/MediaSession.h"
-
-#include "core/dom/Document.h"
-#include "core/testing/DummyPageHolder.h"
-#include "public/platform/modules/mediasession/WebMediaSession.h"
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using testing::_;
-
-namespace blink {
-
-class MediaSessionTest : public ::testing::Test {
-protected:
- MediaSessionTest()
- : m_page(DummyPageHolder::create(IntSize(1, 1)))
- {}
-
- MediaSession* createMediaSession(WebMediaSession* webMediaSession)
- {
- // The MediaSession takes ownership of the WebMediaSession, and the
- // caller must take care to not end up with a stale pointer.
- return new MediaSession(adoptPtr(webMediaSession));
- }
-
- Document& document() { return m_page->document(); }
- ScriptState* mainScriptState() { return ScriptState::forMainWorld(document().frame()); }
-private:
- OwnPtr<DummyPageHolder> m_page;
-};
-
-namespace {
-
-class MockWebMediaSession : public WebMediaSession {
-public:
- MOCK_METHOD1(activate, void(WebMediaSessionActivateCallback*));
- MOCK_METHOD1(deactivate, void(WebMediaSessionDeactivateCallback*));
-};
-
-TEST_F(MediaSessionTest, Activate)
-{
- ScriptState::Scope scope(mainScriptState());
- MockWebMediaSession* mockWebMediaSession = new MockWebMediaSession;
- MediaSession* mediaSession = createMediaSession(mockWebMediaSession);
-
- EXPECT_CALL(*mockWebMediaSession, activate(_));
- mediaSession->activate(mainScriptState());
-}
-
-TEST_F(MediaSessionTest, Deactivate)
-{
- ScriptState::Scope scope(mainScriptState());
- MockWebMediaSession* mockWebMediaSession = new MockWebMediaSession;
- MediaSession* mediaSession = createMediaSession(mockWebMediaSession);
-
- EXPECT_CALL(*mockWebMediaSession, deactivate(_));
- mediaSession->deactivate(mainScriptState());
-}
-
-} // namespace
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/mediasession/MediaSessionError.cpp ('k') | third_party/WebKit/Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698