Commit 3204c8d1 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Renaming unit_test class StubLocalFrameClient to not collide.

ElementVisibilityObserverTest, HTMLMediaElementEventListenersTest and
VideoPainterTest all use a local StubLocalFrameClient class for
testing. That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the classes
will collide. This patch gives the classes unique prefixes.

R=fs@opera.com

Change-Id: I47c7088486456e22ca776419a836f4e5d18be39c
Reviewed-on: https://chromium-review.googlesource.com/574605Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487122}
parent 75d530de
...@@ -21,7 +21,7 @@ namespace { ...@@ -21,7 +21,7 @@ namespace {
// alow callers to set the parent/top frames by calling |setParent|. It is used // alow callers to set the parent/top frames by calling |setParent|. It is used
// in ElementVisibilityObserverTest in order to mock a RemoteFrame parent of a // in ElementVisibilityObserverTest in order to mock a RemoteFrame parent of a
// LocalFrame. // LocalFrame.
class StubLocalFrameClient final : public EmptyLocalFrameClient { class DOMStubLocalFrameClient final : public EmptyLocalFrameClient {
public: public:
Frame* Parent() const override { return parent_; } Frame* Parent() const override { return parent_; }
Frame* Top() const override { return parent_; } Frame* Top() const override { return parent_; }
...@@ -40,7 +40,7 @@ class StubLocalFrameClient final : public EmptyLocalFrameClient { ...@@ -40,7 +40,7 @@ class StubLocalFrameClient final : public EmptyLocalFrameClient {
class ElementVisibilityObserverTest : public ::testing::Test { class ElementVisibilityObserverTest : public ::testing::Test {
protected: protected:
void SetUp() override { void SetUp() override {
local_frame_client_ = new StubLocalFrameClient(); local_frame_client_ = new DOMStubLocalFrameClient();
dummy_page_holder_ = DummyPageHolder::Create(IntSize(), nullptr, dummy_page_holder_ = DummyPageHolder::Create(IntSize(), nullptr,
local_frame_client_, nullptr); local_frame_client_, nullptr);
} }
...@@ -51,11 +51,13 @@ class ElementVisibilityObserverTest : public ::testing::Test { ...@@ -51,11 +51,13 @@ class ElementVisibilityObserverTest : public ::testing::Test {
Document& GetDocument() { return dummy_page_holder_->GetDocument(); } Document& GetDocument() { return dummy_page_holder_->GetDocument(); }
Page& GetPage() { return dummy_page_holder_->GetPage(); } Page& GetPage() { return dummy_page_holder_->GetPage(); }
StubLocalFrameClient* LocalFrameClient() const { return local_frame_client_; } DOMStubLocalFrameClient* LocalFrameClient() const {
return local_frame_client_;
}
private: private:
std::unique_ptr<DummyPageHolder> dummy_page_holder_; std::unique_ptr<DummyPageHolder> dummy_page_holder_;
Persistent<StubLocalFrameClient> local_frame_client_; Persistent<DOMStubLocalFrameClient> local_frame_client_;
}; };
TEST_F(ElementVisibilityObserverTest, ObserveElementWithoutDocumentFrame) { TEST_F(ElementVisibilityObserverTest, ObserveElementWithoutDocumentFrame) {
......
...@@ -26,9 +26,11 @@ class MockWebMediaPlayer final : public EmptyWebMediaPlayer { ...@@ -26,9 +26,11 @@ class MockWebMediaPlayer final : public EmptyWebMediaPlayer {
MOCK_METHOD1(SetIsEffectivelyFullscreen, void(bool)); MOCK_METHOD1(SetIsEffectivelyFullscreen, void(bool));
}; };
class StubLocalFrameClient : public EmptyLocalFrameClient { class MediaStubLocalFrameClient : public EmptyLocalFrameClient {
public: public:
static StubLocalFrameClient* Create() { return new StubLocalFrameClient; } static MediaStubLocalFrameClient* Create() {
return new MediaStubLocalFrameClient;
}
std::unique_ptr<WebMediaPlayer> CreateWebMediaPlayer( std::unique_ptr<WebMediaPlayer> CreateWebMediaPlayer(
HTMLMediaElement&, HTMLMediaElement&,
...@@ -47,7 +49,7 @@ class HTMLMediaElementEventListenersTest : public ::testing::Test { ...@@ -47,7 +49,7 @@ class HTMLMediaElementEventListenersTest : public ::testing::Test {
protected: protected:
void SetUp() override { void SetUp() override {
page_holder_ = DummyPageHolder::Create(IntSize(800, 600), nullptr, page_holder_ = DummyPageHolder::Create(IntSize(800, 600), nullptr,
StubLocalFrameClient::Create()); MediaStubLocalFrameClient::Create());
} }
Document& GetDocument() { return page_holder_->GetDocument(); } Document& GetDocument() { return page_holder_->GetDocument(); }
......
...@@ -49,7 +49,7 @@ class StubWebMediaPlayer : public EmptyWebMediaPlayer { ...@@ -49,7 +49,7 @@ class StubWebMediaPlayer : public EmptyWebMediaPlayer {
ReadyState ready_state_ = kReadyStateHaveNothing; ReadyState ready_state_ = kReadyStateHaveNothing;
}; };
class StubLocalFrameClient : public EmptyLocalFrameClient { class VideoStubLocalFrameClient : public EmptyLocalFrameClient {
public: public:
// LocalFrameClient // LocalFrameClient
std::unique_ptr<WebMediaPlayer> CreateWebMediaPlayer( std::unique_ptr<WebMediaPlayer> CreateWebMediaPlayer(
...@@ -68,7 +68,7 @@ class VideoPainterTestForSPv2 : public ::testing::Test, ...@@ -68,7 +68,7 @@ class VideoPainterTestForSPv2 : public ::testing::Test,
protected: protected:
void SetUp() override { void SetUp() override {
chrome_client_ = new StubChromeClientForSPv2(); chrome_client_ = new StubChromeClientForSPv2();
local_frame_client_ = new StubLocalFrameClient; local_frame_client_ = new VideoStubLocalFrameClient;
Page::PageClients clients; Page::PageClients clients;
FillWithEmptyClients(clients); FillWithEmptyClients(clients);
clients.chrome_client = chrome_client_.Get(); clients.chrome_client = chrome_client_.Get();
...@@ -89,7 +89,7 @@ class VideoPainterTestForSPv2 : public ::testing::Test, ...@@ -89,7 +89,7 @@ class VideoPainterTestForSPv2 : public ::testing::Test,
private: private:
Persistent<StubChromeClientForSPv2> chrome_client_; Persistent<StubChromeClientForSPv2> chrome_client_;
Persistent<StubLocalFrameClient> local_frame_client_; Persistent<VideoStubLocalFrameClient> local_frame_client_;
std::unique_ptr<DummyPageHolder> page_holder_; std::unique_ptr<DummyPageHolder> page_holder_;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment