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

Side by Side Diff: blimp/common/logging_unittest.cc

Issue 1970463004: Blimp: Add BlobChannel Helium messages and delegate impls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/common/logging.cc ('k') | blimp/common/proto/BUILD.gn » ('j') | 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 <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/create_blimp_message.h"
10 #include "blimp/common/logging.h" 11 #include "blimp/common/logging.h"
11 #include "blimp/common/proto/blimp_message.pb.h" 12 #include "blimp/common/proto/blimp_message.pb.h"
13 #include "blimp/common/proto/blob_channel.pb.h"
12 #include "blimp/net/test_common.h" 14 #include "blimp/net/test_common.h"
13 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
15 17
16 using testing::Return; 18 using testing::Return;
17 19
18 namespace blimp { 20 namespace blimp {
19 namespace { 21 namespace {
20 22
21 const int kTargetTab = 123; 23 const int kTargetTab = 123;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 RenderWidgetMessage::CREATED); 215 RenderWidgetMessage::CREATED);
214 VerifyLogOutput("type=RENDER_WIDGET subtype=CREATED render_widget_id=123", 216 VerifyLogOutput("type=RENDER_WIDGET subtype=CREATED render_widget_id=123",
215 created_msg); 217 created_msg);
216 218
217 BlimpMessage deleted_msg = base_msg; 219 BlimpMessage deleted_msg = base_msg;
218 deleted_msg.mutable_render_widget()->set_type(RenderWidgetMessage::DELETED); 220 deleted_msg.mutable_render_widget()->set_type(RenderWidgetMessage::DELETED);
219 VerifyLogOutput("type=RENDER_WIDGET subtype=DELETED render_widget_id=123", 221 VerifyLogOutput("type=RENDER_WIDGET subtype=DELETED render_widget_id=123",
220 deleted_msg); 222 deleted_msg);
221 } 223 }
222 224
225 TEST_F(LoggingTest, BlobChannel) {
226 BlobChannelMessage* blob_message = nullptr;
227 std::unique_ptr<BlimpMessage> blimp_message =
228 CreateBlimpMessage(&blob_message);
229 blob_message->mutable_transfer_blob()->set_blob_id("AAA");
230 blob_message->mutable_transfer_blob()->set_payload("123");
231
232 VerifyLogOutput(
233 "type=BLOB_CHANNEL subtype=TRANSFER_BLOB id=\"414141\" payload_size=3",
234 *blimp_message);
235 }
236
223 TEST_F(LoggingTest, Settings) { 237 TEST_F(LoggingTest, Settings) {
224 BlimpMessage message; 238 BlimpMessage message;
225 message.mutable_settings() 239 message.mutable_settings()
226 ->mutable_engine_settings() 240 ->mutable_engine_settings()
227 ->set_record_whole_document(true); 241 ->set_record_whole_document(true);
228 message.mutable_settings()->mutable_engine_settings()->set_client_os_info( 242 message.mutable_settings()->mutable_engine_settings()->set_client_os_info(
229 "wibble"); 243 "wibble");
230 VerifyLogOutput( 244 VerifyLogOutput(
231 "type=SETTINGS subtype=ENGINE_SETTINGS record_whole_document=true " 245 "type=SETTINGS subtype=ENGINE_SETTINGS record_whole_document=true "
232 "client_os_info=\"wibble\"", 246 "client_os_info=\"wibble\"",
233 message); 247 message);
234 } 248 }
235 249
236 } // namespace 250 } // namespace
237 } // namespace blimp 251 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/common/logging.cc ('k') | blimp/common/proto/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698