OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <stack> | 5 #include <stack> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 reader_.reset(service_->storage()->CreateResponseReader( | 637 reader_.reset(service_->storage()->CreateResponseReader( |
638 GURL(), 0, written_response_id_)); | 638 GURL(), 0, written_response_id_)); |
639 ReadResponseBody(new IOBuffer(kBlockSize), kBlockSize); | 639 ReadResponseBody(new IOBuffer(kBlockSize), kBlockSize); |
640 EXPECT_TRUE(reader_->IsReadPending()); | 640 EXPECT_TRUE(reader_->IsReadPending()); |
641 reader_.reset(); | 641 reader_.reset(); |
642 | 642 |
643 // Wait a moment to verify no callbacks. | 643 // Wait a moment to verify no callbacks. |
644 MessageLoop::current()->PostDelayedTask( | 644 MessageLoop::current()->PostDelayedTask( |
645 FROM_HERE, base::Bind(&AppCacheResponseTest::VerifyNoCallbacks, | 645 FROM_HERE, base::Bind(&AppCacheResponseTest::VerifyNoCallbacks, |
646 base::Unretained(this)), | 646 base::Unretained(this)), |
647 10); | 647 base::TimeDelta::FromMilliseconds(10)); |
648 } | 648 } |
649 | 649 |
650 void VerifyNoCallbacks() { | 650 void VerifyNoCallbacks() { |
651 EXPECT_TRUE(!write_callback_was_called_); | 651 EXPECT_TRUE(!write_callback_was_called_); |
652 EXPECT_TRUE(!read_callback_was_called_); | 652 EXPECT_TRUE(!read_callback_was_called_); |
653 TestFinished(); | 653 TestFinished(); |
654 } | 654 } |
655 | 655 |
656 // Data members | 656 // Data members |
657 | 657 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 | 709 |
710 TEST_F(AppCacheResponseTest, DeleteWithinCallbacks) { | 710 TEST_F(AppCacheResponseTest, DeleteWithinCallbacks) { |
711 RunTestOnIOThread(&AppCacheResponseTest::DeleteWithinCallbacks); | 711 RunTestOnIOThread(&AppCacheResponseTest::DeleteWithinCallbacks); |
712 } | 712 } |
713 | 713 |
714 TEST_F(AppCacheResponseTest, DeleteWithIOPending) { | 714 TEST_F(AppCacheResponseTest, DeleteWithIOPending) { |
715 RunTestOnIOThread(&AppCacheResponseTest::DeleteWithIOPending); | 715 RunTestOnIOThread(&AppCacheResponseTest::DeleteWithIOPending); |
716 } | 716 } |
717 | 717 |
718 } // namespace appcache | 718 } // namespace appcache |
OLD | NEW |