Chromium Code Reviews| Index: blimp/client/core/render_widget/blimp_document_unittest.cc |
| diff --git a/blimp/client/core/render_widget/blimp_document_unittest.cc b/blimp/client/core/render_widget/blimp_document_unittest.cc |
| index 26e46464144b89752c324401f5b0ba3f530932fb..181c714670469a129fe9414e8daab264ba43c280 100644 |
| --- a/blimp/client/core/render_widget/blimp_document_unittest.cc |
| +++ b/blimp/client/core/render_widget/blimp_document_unittest.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" |
| #include "blimp/client/core/compositor/blob_image_serialization_processor.h" |
| +#include "blimp/client/core/input/blimp_input_manager.h" |
| #include "blimp/client/core/render_widget/blimp_document_manager.h" |
| #include "blimp/client/core/render_widget/mock_render_widget_feature.h" |
| #include "blimp/client/test/compositor/mock_compositor_dependencies.h" |
| @@ -21,7 +22,6 @@ namespace client { |
| namespace { |
| const int kDefaultContentId = 1; |
| -const int kDefaultDocumentId = 1; |
|
Khushal
2016/10/07 03:40:15
Why remove this?
xingliu
2016/10/10 19:00:17
Moved it back, this is added in the previous patch
|
| class MockBlimpDocumentManager : public BlimpDocumentManager { |
| public: |
| @@ -63,27 +63,27 @@ class BlimpDocumentTest : public testing::Test { |
| }; |
| TEST_F(BlimpDocumentTest, Constructor) { |
| - BlimpDocument doc(kDefaultDocumentId, compositor_dependencies_.get(), |
| - document_manager_.get()); |
| - EXPECT_EQ(doc.document_id(), kDefaultDocumentId); |
| + BlimpDocument doc(1, compositor_dependencies_.get(), document_manager_.get()); |
| + EXPECT_EQ(doc.document_id(), 1); |
| EXPECT_NE(doc.GetCompositor(), nullptr); |
| } |
| TEST_F(BlimpDocumentTest, ForwardMessagesToManager) { |
| - BlimpDocument doc(kDefaultDocumentId, compositor_dependencies_.get(), |
| - document_manager_.get()); |
| + BlimpDocument doc(1, compositor_dependencies_.get(), document_manager_.get()); |
| EXPECT_CALL(*document_manager_, SendCompositorMessage(_, _)).Times(1); |
| EXPECT_CALL(*document_manager_, SendWebGestureEvent(_, _)).Times(1); |
| // When sending messages to the engine, ensure the messages are forwarded |
| // to the document manager. |
| - BlimpCompositorClient* client = static_cast<BlimpCompositorClient*>(&doc); |
| - |
| + BlimpCompositorClient* compositor_client = |
| + static_cast<BlimpCompositorClient*>(&doc); |
| cc::proto::CompositorMessage fake_message; |
| - client->SendCompositorMessage(fake_message); |
| + compositor_client->SendCompositorMessage(fake_message); |
| + BlimpInputManagerClient* input_manager_client = |
| + static_cast<BlimpInputManagerClient*>(&doc); |
| blink::WebGestureEvent fake_gesture; |
| - client->SendWebGestureEvent(fake_gesture); |
| + input_manager_client->SendWebGestureEvent(fake_gesture); |
| } |
| } // namespace |