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

Side by Side Diff: mojo/system/message_pipe_dispatcher_unittest.cc

Issue 611733002: Mojo: Convert OVERRIDE -> override in mojo/{embedder,system}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « mojo/system/message_pipe_dispatcher.h ('k') | mojo/system/platform_handle_dispatcher.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a 5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a
6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to 6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to
7 // increase tolerance and reduce observed flakiness (though doing so reduces the 7 // increase tolerance and reduce observed flakiness (though doing so reduces the
8 // meaningfulness of the test). 8 // meaningfulness of the test).
9 9
10 #include "mojo/system/message_pipe_dispatcher.h" 10 #include "mojo/system/message_pipe_dispatcher.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 write_dispatcher_(write_dispatcher), 524 write_dispatcher_(write_dispatcher),
525 messages_written_(messages_written), 525 messages_written_(messages_written),
526 bytes_written_(bytes_written) { 526 bytes_written_(bytes_written) {
527 *messages_written_ = 0; 527 *messages_written_ = 0;
528 *bytes_written_ = 0; 528 *bytes_written_ = 0;
529 } 529 }
530 530
531 virtual ~WriterThread() { Join(); } 531 virtual ~WriterThread() { Join(); }
532 532
533 private: 533 private:
534 virtual void Run() OVERRIDE { 534 virtual void Run() override {
535 // Make some data to write. 535 // Make some data to write.
536 unsigned char buffer[kMaxMessageSize]; 536 unsigned char buffer[kMaxMessageSize];
537 for (size_t i = 0; i < kMaxMessageSize; i++) 537 for (size_t i = 0; i < kMaxMessageSize; i++)
538 buffer[i] = static_cast<unsigned char>(i); 538 buffer[i] = static_cast<unsigned char>(i);
539 539
540 // Number of messages to write. 540 // Number of messages to write.
541 *messages_written_ = static_cast<size_t>(base::RandInt(1000, 6000)); 541 *messages_written_ = static_cast<size_t>(base::RandInt(1000, 6000));
542 542
543 // Write messages. 543 // Write messages.
544 for (size_t i = 0; i < *messages_written_; i++) { 544 for (size_t i = 0; i < *messages_written_; i++) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 read_dispatcher_(read_dispatcher), 577 read_dispatcher_(read_dispatcher),
578 messages_read_(messages_read), 578 messages_read_(messages_read),
579 bytes_read_(bytes_read) { 579 bytes_read_(bytes_read) {
580 *messages_read_ = 0; 580 *messages_read_ = 0;
581 *bytes_read_ = 0; 581 *bytes_read_ = 0;
582 } 582 }
583 583
584 virtual ~ReaderThread() { Join(); } 584 virtual ~ReaderThread() { Join(); }
585 585
586 private: 586 private:
587 virtual void Run() OVERRIDE { 587 virtual void Run() override {
588 unsigned char buffer[kMaxMessageSize]; 588 unsigned char buffer[kMaxMessageSize];
589 Waiter w; 589 Waiter w;
590 HandleSignalsState hss; 590 HandleSignalsState hss;
591 MojoResult result; 591 MojoResult result;
592 592
593 // Read messages. 593 // Read messages.
594 for (;;) { 594 for (;;) {
595 // Wait for it to be readable. 595 // Wait for it to be readable.
596 w.Init(); 596 w.Init();
597 hss = HandleSignalsState(); 597 hss = HandleSignalsState();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 EXPECT_EQ(total_messages_written, total_messages_read); 720 EXPECT_EQ(total_messages_written, total_messages_read);
721 EXPECT_EQ(total_bytes_written, total_bytes_read); 721 EXPECT_EQ(total_bytes_written, total_bytes_read);
722 722
723 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); 723 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close());
724 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); 724 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close());
725 } 725 }
726 726
727 } // namespace 727 } // namespace
728 } // namespace system 728 } // namespace system
729 } // namespace mojo 729 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe_dispatcher.h ('k') | mojo/system/platform_handle_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698