| 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 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2738 EXPECT_EQ("foo=bar; hello=world", GetCookies(cm.get(), url)); | 2738 EXPECT_EQ("foo=bar; hello=world", GetCookies(cm.get(), url)); |
| 2739 } | 2739 } |
| 2740 | 2740 |
| 2741 class CookieMonsterNotificationTest : public CookieMonsterTest { | 2741 class CookieMonsterNotificationTest : public CookieMonsterTest { |
| 2742 public: | 2742 public: |
| 2743 CookieMonsterNotificationTest() | 2743 CookieMonsterNotificationTest() |
| 2744 : test_url_("http://www.google.com/foo"), | 2744 : test_url_("http://www.google.com/foo"), |
| 2745 store_(new MockPersistentCookieStore), | 2745 store_(new MockPersistentCookieStore), |
| 2746 monster_(new CookieMonster(store_.get(), NULL)) {} | 2746 monster_(new CookieMonster(store_.get(), NULL)) {} |
| 2747 | 2747 |
| 2748 virtual ~CookieMonsterNotificationTest() {} | 2748 ~CookieMonsterNotificationTest() override {} |
| 2749 | 2749 |
| 2750 CookieMonster* monster() { return monster_.get(); } | 2750 CookieMonster* monster() { return monster_.get(); } |
| 2751 | 2751 |
| 2752 protected: | 2752 protected: |
| 2753 const GURL test_url_; | 2753 const GURL test_url_; |
| 2754 | 2754 |
| 2755 private: | 2755 private: |
| 2756 scoped_refptr<MockPersistentCookieStore> store_; | 2756 scoped_refptr<MockPersistentCookieStore> store_; |
| 2757 scoped_refptr<CookieMonster> monster_; | 2757 scoped_refptr<CookieMonster> monster_; |
| 2758 }; | 2758 }; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2847 scoped_ptr<CookieStore::CookieChangedSubscription> sub1( | 2847 scoped_ptr<CookieStore::CookieChangedSubscription> sub1( |
| 2848 monster()->AddCallbackForCookie(test_url_, "abc", | 2848 monster()->AddCallbackForCookie(test_url_, "abc", |
| 2849 base::Bind(&CountCalls, &calls1))); | 2849 base::Bind(&CountCalls, &calls1))); |
| 2850 SetCookie(monster(), test_url_, "abc=def"); | 2850 SetCookie(monster(), test_url_, "abc=def"); |
| 2851 base::MessageLoop::current()->RunUntilIdle(); | 2851 base::MessageLoop::current()->RunUntilIdle(); |
| 2852 EXPECT_EQ(1, calls0); | 2852 EXPECT_EQ(1, calls0); |
| 2853 EXPECT_EQ(1, calls1); | 2853 EXPECT_EQ(1, calls1); |
| 2854 } | 2854 } |
| 2855 | 2855 |
| 2856 } // namespace net | 2856 } // namespace net |
| OLD | NEW |