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

Side by Side Diff: blimp/client/core/render_widget/blimp_document_unittest.cc

Issue 2400923002: Move BlimpInputManager to BlimpDocument from BlimpCompositor. (Closed)
Patch Set: Removed unnecessary DCHECK. Created 4 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 unified diff | Download patch
« no previous file with comments | « blimp/client/core/render_widget/blimp_document_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/client/core/render_widget/blimp_document.h" 5 #include "blimp/client/core/render_widget/blimp_document.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" 9 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h"
10 #include "blimp/client/core/compositor/blob_image_serialization_processor.h" 10 #include "blimp/client/core/compositor/blob_image_serialization_processor.h"
11 #include "blimp/client/core/input/blimp_input_manager.h"
11 #include "blimp/client/core/render_widget/blimp_document_manager.h" 12 #include "blimp/client/core/render_widget/blimp_document_manager.h"
12 #include "blimp/client/core/render_widget/mock_render_widget_feature.h" 13 #include "blimp/client/core/render_widget/mock_render_widget_feature.h"
13 #include "blimp/client/test/compositor/mock_compositor_dependencies.h" 14 #include "blimp/client/test/compositor/mock_compositor_dependencies.h"
14 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 17
17 using testing::_; 18 using testing::_;
18 19
19 namespace blimp { 20 namespace blimp {
20 namespace client { 21 namespace client {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 71 }
71 72
72 TEST_F(BlimpDocumentTest, ForwardMessagesToManager) { 73 TEST_F(BlimpDocumentTest, ForwardMessagesToManager) {
73 BlimpDocument doc(kDefaultDocumentId, compositor_dependencies_.get(), 74 BlimpDocument doc(kDefaultDocumentId, compositor_dependencies_.get(),
74 document_manager_.get()); 75 document_manager_.get());
75 EXPECT_CALL(*document_manager_, SendCompositorMessage(_, _)).Times(1); 76 EXPECT_CALL(*document_manager_, SendCompositorMessage(_, _)).Times(1);
76 EXPECT_CALL(*document_manager_, SendWebGestureEvent(_, _)).Times(1); 77 EXPECT_CALL(*document_manager_, SendWebGestureEvent(_, _)).Times(1);
77 78
78 // When sending messages to the engine, ensure the messages are forwarded 79 // When sending messages to the engine, ensure the messages are forwarded
79 // to the document manager. 80 // to the document manager.
80 BlimpCompositorClient* client = static_cast<BlimpCompositorClient*>(&doc); 81 BlimpCompositorClient* compositor_client =
82 static_cast<BlimpCompositorClient*>(&doc);
83 cc::proto::CompositorMessage fake_message;
84 compositor_client->SendCompositorMessage(fake_message);
81 85
82 cc::proto::CompositorMessage fake_message; 86 BlimpInputManagerClient* input_manager_client =
83 client->SendCompositorMessage(fake_message); 87 static_cast<BlimpInputManagerClient*>(&doc);
84
85 blink::WebGestureEvent fake_gesture; 88 blink::WebGestureEvent fake_gesture;
86 client->SendWebGestureEvent(fake_gesture); 89 input_manager_client->SendWebGestureEvent(fake_gesture);
87 } 90 }
88 91
89 } // namespace 92 } // namespace
90 } // namespace client 93 } // namespace client
91 } // namespace blimp 94 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/core/render_widget/blimp_document_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698