| 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 "net/cookies/cookie_store_unittest.h" | 5 #include "net/cookies/cookie_store_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // saving the provided callback and sending a quit to the message loop. | 771 // saving the provided callback and sending a quit to the message loop. |
| 772 void ExpectLoadCall() { | 772 void ExpectLoadCall() { |
| 773 EXPECT_CALL(*persistent_store_.get(), Load(testing::_)) | 773 EXPECT_CALL(*persistent_store_.get(), Load(testing::_)) |
| 774 .WillOnce(testing::DoAll(testing::SaveArg<0>(&loaded_callback_), | 774 .WillOnce(testing::DoAll(testing::SaveArg<0>(&loaded_callback_), |
| 775 QuitCurrentMessageLoop())); | 775 QuitCurrentMessageLoop())); |
| 776 } | 776 } |
| 777 | 777 |
| 778 // Declares an expectation that PersistentCookieStore::LoadCookiesForKey | 778 // Declares an expectation that PersistentCookieStore::LoadCookiesForKey |
| 779 // will be called, saving the provided callback and sending a quit to the | 779 // will be called, saving the provided callback and sending a quit to the |
| 780 // message loop. | 780 // message loop. |
| 781 void ExpectLoadForKeyCall(std::string key, bool quit_queue) { | 781 void ExpectLoadForKeyCall(const std::string& key, bool quit_queue) { |
| 782 if (quit_queue) | 782 if (quit_queue) |
| 783 EXPECT_CALL(*persistent_store_.get(), LoadCookiesForKey(key, testing::_)) | 783 EXPECT_CALL(*persistent_store_.get(), LoadCookiesForKey(key, testing::_)) |
| 784 .WillOnce( | 784 .WillOnce( |
| 785 testing::DoAll(PushCallbackAction(&loaded_for_key_callbacks_), | 785 testing::DoAll(PushCallbackAction(&loaded_for_key_callbacks_), |
| 786 QuitCurrentMessageLoop())); | 786 QuitCurrentMessageLoop())); |
| 787 else | 787 else |
| 788 EXPECT_CALL(*persistent_store_.get(), LoadCookiesForKey(key, testing::_)) | 788 EXPECT_CALL(*persistent_store_.get(), LoadCookiesForKey(key, testing::_)) |
| 789 .WillOnce(PushCallbackAction(&loaded_for_key_callbacks_)); | 789 .WillOnce(PushCallbackAction(&loaded_for_key_callbacks_)); |
| 790 } | 790 } |
| 791 | 791 |
| (...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3051 monster()->AddCallbackForCookie( | 3051 monster()->AddCallbackForCookie( |
| 3052 test_url_, "abc", | 3052 test_url_, "abc", |
| 3053 base::Bind(&RecordCookieChanges, &cookies1, nullptr))); | 3053 base::Bind(&RecordCookieChanges, &cookies1, nullptr))); |
| 3054 SetCookie(monster(), test_url_, "abc=def"); | 3054 SetCookie(monster(), test_url_, "abc=def"); |
| 3055 base::MessageLoop::current()->RunUntilIdle(); | 3055 base::MessageLoop::current()->RunUntilIdle(); |
| 3056 EXPECT_EQ(1U, cookies0.size()); | 3056 EXPECT_EQ(1U, cookies0.size()); |
| 3057 EXPECT_EQ(1U, cookies0.size()); | 3057 EXPECT_EQ(1U, cookies0.size()); |
| 3058 } | 3058 } |
| 3059 | 3059 |
| 3060 } // namespace net | 3060 } // namespace net |
| OLD | NEW |