OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |