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

Side by Side Diff: remoting/host/client_session_unittest.cc

Issue 936553003: Fix VideoFramePump to send keep-alive packets only after the first real frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | remoting/host/video_frame_pump.cc » ('j') | remoting/host/video_frame_pump.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 EXPECT_CALL(*input_injector_, InjectClipboardEvent(EqualsClipboardEvent( 378 EXPECT_CALL(*input_injector_, InjectClipboardEvent(EqualsClipboardEvent(
379 kMimeTypeTextUtf8, "c"))); 379 kMimeTypeTextUtf8, "c")));
380 EXPECT_CALL(*input_injector_, InjectKeyEvent(EqualsUsbEvent(3, true))); 380 EXPECT_CALL(*input_injector_, InjectKeyEvent(EqualsUsbEvent(3, true)));
381 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseEvent(300, 301))); 381 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseEvent(300, 301)));
382 EXPECT_CALL(*input_injector_, InjectKeyEvent(EqualsUsbEvent(3, false))); 382 EXPECT_CALL(*input_injector_, InjectKeyEvent(EqualsUsbEvent(3, false)));
383 } 383 }
384 384
385 ConnectClientSession(); 385 ConnectClientSession();
386 386
387 // With for the first frame. 387 // Wait for the first frame.
388 run_loop.Run(); 388 run_loop.Run();
389 389
390 // Inject test events that are expected to be injected. 390 // Inject test events that are expected to be injected.
391 protocol::ClipboardEvent clipboard_event; 391 protocol::ClipboardEvent clipboard_event;
392 clipboard_event.set_mime_type(kMimeTypeTextUtf8); 392 clipboard_event.set_mime_type(kMimeTypeTextUtf8);
393 clipboard_event.set_data("a"); 393 clipboard_event.set_data("a");
394 connection_->clipboard_stub()->InjectClipboardEvent(clipboard_event); 394 connection_->clipboard_stub()->InjectClipboardEvent(clipboard_event);
395 395
396 protocol::KeyEvent key_event; 396 protocol::KeyEvent key_event;
397 key_event.set_pressed(true); 397 key_event.set_pressed(true);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 mouse_event.set_x(300); 439 mouse_event.set_x(300);
440 mouse_event.set_y(301); 440 mouse_event.set_y(301);
441 connection_->input_stub()->InjectMouseEvent(mouse_event); 441 connection_->input_stub()->InjectMouseEvent(mouse_event);
442 442
443 client_session_->DisconnectSession(); 443 client_session_->DisconnectSession();
444 client_session_->OnConnectionClosed(connection_, protocol::OK); 444 client_session_->OnConnectionClosed(connection_, protocol::OK);
445 client_session_.reset(); 445 client_session_.reset();
446 } 446 }
447 447
448 // crbug.com/458691 448 TEST_F(ClientSessionTest, LocalInputTest) {
449 TEST_F(ClientSessionTest, DISABLED_LocalInputTest) {
450 CreateClientSession(); 449 CreateClientSession();
451 450
452 protocol::MouseEvent mouse_event1; 451 protocol::MouseEvent mouse_event1;
453 mouse_event1.set_x(100); 452 mouse_event1.set_x(100);
454 mouse_event1.set_y(101); 453 mouse_event1.set_y(101);
455 protocol::MouseEvent mouse_event2; 454 protocol::MouseEvent mouse_event2;
456 mouse_event2.set_x(200); 455 mouse_event2.set_x(200);
457 mouse_event2.set_y(201); 456 mouse_event2.set_y(201);
458 protocol::MouseEvent mouse_event3; 457 protocol::MouseEvent mouse_event3;
459 mouse_event3.set_x(300); 458 mouse_event3.set_x(300);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseEvent(100, 101))) 494 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseEvent(100, 101)))
496 .InSequence(s); 495 .InSequence(s);
497 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseEvent(200, 201))) 496 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseEvent(200, 201)))
498 .InSequence(s); 497 .InSequence(s);
499 EXPECT_CALL(session_event_handler_, OnSessionClosed(_)) 498 EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
500 .InSequence(s); 499 .InSequence(s);
501 500
502 ConnectClientSession(); 501 ConnectClientSession();
503 } 502 }
504 503
505 // crbug.com/458691 504 TEST_F(ClientSessionTest, RestoreEventState) {
506 TEST_F(ClientSessionTest, DISABLED_RestoreEventState) {
507 CreateClientSession(); 505 CreateClientSession();
508 506
509 protocol::KeyEvent key1; 507 protocol::KeyEvent key1;
510 key1.set_pressed(true); 508 key1.set_pressed(true);
511 key1.set_usb_keycode(1); 509 key1.set_usb_keycode(1);
512 510
513 protocol::KeyEvent key2; 511 protocol::KeyEvent key2;
514 key2.set_pressed(true); 512 key2.set_pressed(true);
515 key2.set_usb_keycode(2); 513 key2.set_usb_keycode(2);
516 514
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 .InSequence(s); 550 .InSequence(s);
553 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseButtonEvent( 551 EXPECT_CALL(*input_injector_, InjectMouseEvent(EqualsMouseButtonEvent(
554 protocol::MouseEvent::BUTTON_LEFT, false))) 552 protocol::MouseEvent::BUTTON_LEFT, false)))
555 .InSequence(s); 553 .InSequence(s);
556 EXPECT_CALL(session_event_handler_, OnSessionClosed(_)) 554 EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
557 .InSequence(s); 555 .InSequence(s);
558 556
559 ConnectClientSession(); 557 ConnectClientSession();
560 } 558 }
561 559
562 // crbug.com/458691 560 TEST_F(ClientSessionTest, ClampMouseEvents) {
563 TEST_F(ClientSessionTest, DISABLED_ClampMouseEvents) {
564 CreateClientSession(); 561 CreateClientSession();
565 562
566 Expectation authenticated = 563 Expectation authenticated =
567 EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_)) 564 EXPECT_CALL(session_event_handler_, OnSessionAuthenticated(_))
568 .WillOnce(Return(true)); 565 .WillOnce(Return(true));
569 EXPECT_CALL(*input_injector_, StartPtr(_)) 566 EXPECT_CALL(*input_injector_, StartPtr(_))
570 .After(authenticated); 567 .After(authenticated);
571 EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_)) 568 EXPECT_CALL(session_event_handler_, OnSessionChannelsConnected(_))
572 .After(authenticated); 569 .After(authenticated);
573 EXPECT_CALL(session_event_handler_, OnSessionClosed(_)) 570 EXPECT_CALL(session_event_handler_, OnSessionClosed(_))
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 785
789 DisconnectClientSession(); 786 DisconnectClientSession();
790 StopClientSession(); 787 StopClientSession();
791 788
792 // ext1 was instantiated and wrapped the video capturer. 789 // ext1 was instantiated and wrapped the video capturer.
793 EXPECT_TRUE(extension.was_instantiated()); 790 EXPECT_TRUE(extension.was_instantiated());
794 EXPECT_TRUE(extension.has_wrapped_video_capturer()); 791 EXPECT_TRUE(extension.has_wrapped_video_capturer());
795 } 792 }
796 793
797 } // namespace remoting 794 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/video_frame_pump.cc » ('j') | remoting/host/video_frame_pump.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698