Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <sstream> | 5 #include <sstream> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "blimp/common/logging.h" | 10 #include "blimp/common/logging.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 base_msg.set_type(BlimpMessage::COMPOSITOR); | 47 base_msg.set_type(BlimpMessage::COMPOSITOR); |
| 48 base_msg.set_target_tab_id(kTargetTab); | 48 base_msg.set_target_tab_id(kTargetTab); |
| 49 VerifyLogOutput("type=COMPOSITOR render_widget_id=0 target_tab_id=123", | 49 VerifyLogOutput("type=COMPOSITOR render_widget_id=0 target_tab_id=123", |
| 50 base_msg); | 50 base_msg); |
| 51 } | 51 } |
| 52 | 52 |
| 53 TEST_F(LoggingTest, Input) { | 53 TEST_F(LoggingTest, Input) { |
| 54 BlimpMessage base_msg; | 54 BlimpMessage base_msg; |
| 55 base_msg.set_type(BlimpMessage::INPUT); | 55 base_msg.set_type(BlimpMessage::INPUT); |
| 56 base_msg.set_target_tab_id(kTargetTab); | 56 base_msg.set_target_tab_id(kTargetTab); |
| 57 VerifyLogOutput("type=INPUT render_widget_id=0 target_tab_id=123", base_msg); | 57 base_msg.mutable_input()->set_type(InputMessage::Type_GestureScrollBegin); |
| 58 base_msg.mutable_input()->set_render_widget_id(1); | |
| 59 base_msg.mutable_input()->set_timestamp_seconds(2); | |
| 60 VerifyLogOutput( | |
| 61 "type=INPUT render_widget_id=1 timestamp_seconds=2.000000 " | |
| 62 "subtype=GestureScrollBegin target_tab_id=123", | |
| 63 base_msg); | |
|
Kevin M
2016/04/05 16:57:39
Add additional tests to get coverage over all subt
haibinlu
2016/04/05 17:53:22
Done.
| |
| 58 } | 64 } |
| 59 | 65 |
| 60 TEST_F(LoggingTest, Navigation) { | 66 TEST_F(LoggingTest, Navigation) { |
| 61 BlimpMessage base_msg; | 67 BlimpMessage base_msg; |
| 62 base_msg.set_type(BlimpMessage::NAVIGATION); | 68 base_msg.set_type(BlimpMessage::NAVIGATION); |
| 63 base_msg.set_target_tab_id(kTargetTab); | 69 base_msg.set_target_tab_id(kTargetTab); |
| 64 | 70 |
| 65 BlimpMessage navigation_state_msg = base_msg; | 71 BlimpMessage navigation_state_msg = base_msg; |
| 66 navigation_state_msg.mutable_navigation()->set_type( | 72 navigation_state_msg.mutable_navigation()->set_type( |
| 67 NavigationMessage::NAVIGATION_STATE_CHANGED); | 73 NavigationMessage::NAVIGATION_STATE_CHANGED); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 created_msg); | 186 created_msg); |
| 181 | 187 |
| 182 BlimpMessage deleted_msg = base_msg; | 188 BlimpMessage deleted_msg = base_msg; |
| 183 deleted_msg.mutable_render_widget()->set_type(RenderWidgetMessage::DELETED); | 189 deleted_msg.mutable_render_widget()->set_type(RenderWidgetMessage::DELETED); |
| 184 VerifyLogOutput("type=RENDER_WIDGET subtype=DELETED render_widget_id=123", | 190 VerifyLogOutput("type=RENDER_WIDGET subtype=DELETED render_widget_id=123", |
| 185 deleted_msg); | 191 deleted_msg); |
| 186 } | 192 } |
| 187 | 193 |
| 188 } // namespace | 194 } // namespace |
| 189 } // namespace blimp | 195 } // namespace blimp |
| OLD | NEW |