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

Side by Side Diff: dbus/end_to_end_async_unittest.cc

Issue 24554002: dbus: Replace PostTaskTo*Thread methods with Get*TaskRunner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « dbus/bus.cc ('k') | dbus/exported_object.cc » ('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 (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/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 const std::string kHugeMessage(kHugePayloadSize, 'o'); 573 const std::string kHugeMessage(kHugePayloadSize, 'o');
574 574
575 // Send the huge signal from the exported object. 575 // Send the huge signal from the exported object.
576 test_service_->SendTestSignal(kHugeMessage); 576 test_service_->SendTestSignal(kHugeMessage);
577 // This caused a DCHECK failure before. Ensure that the issue is fixed. 577 // This caused a DCHECK failure before. Ensure that the issue is fixed.
578 WaitForTestSignal(); 578 WaitForTestSignal();
579 ASSERT_EQ(kHugeMessage, test_signal_string_); 579 ASSERT_EQ(kHugeMessage, test_signal_string_);
580 } 580 }
581 581
582 TEST_F(EndToEndAsyncTest, DisconnectedSignal) { 582 TEST_F(EndToEndAsyncTest, DisconnectedSignal) {
583 bus_->PostTaskToDBusThread(FROM_HERE, 583 bus_->GetDBusTaskRunner()->PostTask(FROM_HERE,
584 base::Bind(&Bus::ClosePrivateConnection, 584 base::Bind(&Bus::ClosePrivateConnection,
585 base::Unretained(bus_.get()))); 585 base::Unretained(bus_.get())));
586 // OnDisconnected callback quits message loop. 586 // OnDisconnected callback quits message loop.
587 message_loop_.Run(); 587 message_loop_.Run();
588 EXPECT_EQ(1, on_disconnected_call_count_); 588 EXPECT_EQ(1, on_disconnected_call_count_);
589 } 589 }
590 590
591 class SignalMultipleHandlerTest : public EndToEndAsyncTest { 591 class SignalMultipleHandlerTest : public EndToEndAsyncTest {
592 public: 592 public:
593 SignalMultipleHandlerTest() { 593 SignalMultipleHandlerTest() {
594 } 594 }
595 595
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 test_service_->SendTestSignal(kMessage); 638 test_service_->SendTestSignal(kMessage);
639 // Receive the signal with the object proxy. 639 // Receive the signal with the object proxy.
640 WaitForTestSignal(); 640 WaitForTestSignal();
641 // Verify the string WAS received by the original handler. 641 // Verify the string WAS received by the original handler.
642 ASSERT_EQ(kMessage, test_signal_string_); 642 ASSERT_EQ(kMessage, test_signal_string_);
643 // Verify the signal WAS ALSO received by the additional handler. 643 // Verify the signal WAS ALSO received by the additional handler.
644 ASSERT_EQ(kMessage, additional_test_signal_string_); 644 ASSERT_EQ(kMessage, additional_test_signal_string_);
645 } 645 }
646 646
647 } // namespace dbus 647 } // namespace dbus
OLDNEW
« no previous file with comments | « dbus/bus.cc ('k') | dbus/exported_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698